adapt master to develop master 5.42.0
authorKatja Luther <k.luther@bgbm.org>
Fri, 2 Feb 2024 07:30:23 +0000 (08:30 +0100)
committerKatja Luther <k.luther@bgbm.org>
Fri, 2 Feb 2024 07:30:23 +0000 (08:30 +0100)
917 files changed:
.gitattributes
.gitignore
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/pom.xml
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/LifeCycleManager.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/TaxonomicEditorPlugin.java
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Default.java
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.bulkeditor/pom.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/e4/handler/NewObjectHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/DeleteHandlerE4.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForTaxonNodeHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputType.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonBulkEditorInput.java [moved from eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java with 91% similarity]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/AgentCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/NameCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/e4/ReferencingObjectsViewE4.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.cdmlib/build.properties
eu.etaxonomy.taxeditor.cdmlib/pom.xml
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteController.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationState.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCachingProxy.java [moved from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java with 78% similarity]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/lazyloading/CdmLazyLoader.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/RemoteExecutionTimestampsUtil.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfo.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/source/CdmServerInfoConfig.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CachedCommonServiceImpl.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/RemoteInvocationTermCacher.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TimestampingHttpInvokerRequestExecutor.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySession.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySession.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/ICdmEntitySessionManager.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java [deleted file]
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java
eu.etaxonomy.taxeditor.cdmlib/src/main/resources/log4j2.xml
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.editor/fragment.e4xmi
eu.etaxonomy.taxeditor.editor/pom.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/AppModelId.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/ChooseFromMultipleTaxonNodesDialog.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/AreasSelectionDialog.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/DescriptiveDataSetEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/DescriptiveDataSetNavigator.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/character/CharacterEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/CreateDescriptiveDataSetHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/DeleteDescriptiveDataSetHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CategoricalDataHistogram.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CdmContentProposalAdapter.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CellEditorDataConversionConfiguration.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CellSelectionListener.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixConfigLabelAccumulator.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixListDataProvider.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataComboElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataDialogComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/MatrixRowComparator.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/MatrixUtility.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/SpecimenColumnPropertyAccessor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalComboBoxDataProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataCellEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialogComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDisplayConverter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/handler/AggregationHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/handler/CreateDefaultTaxonDescriptionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/handler/CreateTaxonDescriptionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/handler/DeleteDescriptionHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/quantitative/QuantitativeDataDialog.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/quantitative/QuantitativeDataDialogComposite.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/quantitative/QuantitativeDataDialogEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/quantitative/QuantitativeDataEditModeDisplayConverter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/supplementalInfo/SupplementalInfoDisplayConverter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInput.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputE4.java with 85% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputDataChangeBehaviourE4.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/e4/CdmAuthorityEditorE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonBaseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/AbstractIdentificationEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/AbstractGraphKeyEditor.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/AbstractGraphKeyEditorE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/KeyEditorDataChangeBehaviourE4.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/handler/ApplyLayoutHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyGraphEditorE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/PolytomousKeyListEditorE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/IDropTargetable.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/IDropTargetableE4.java with 79% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonEditor.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java with 81% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroup.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupE4.java with 77% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainer.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainerE4.java with 94% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractHomotypicalGroupContainer.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractHomotypicalGroupContainerE4.java with 83% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedGroup.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedGroupE4.java with 86% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedNameContainerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ConceptContainer.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ConceptContainerE4.java with 93% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactory.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactoryE4.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/HomotypicalSynonymGroup.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/HomotypicalSynonymGroupE4.java with 85% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/MisappliedGroup.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/MisappliedGroupE4.java with 75% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/NameViewer.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/NameViewerE4.java with 98% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/SynonymContainerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDragListenerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDropTargetEffect.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDropTargetListener.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/dnd/NameEditorDropTargetListenerE4.java with 73% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java with 93% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToMisapplicationHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToMisapplicationHandlerE4.java with 93% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToProParteSynonymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToProParteSynonymHandlerE5.java with 93% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToSynonymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeToSynonymHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHeterotypicSynonymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHeterotypicSynonymHandlerE4.java with 91% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHomotypicSynonymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateHomotypicSynonymHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateMisapplicationHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateMisapplicationHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateProParteSynonymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateProParteSynonymHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateSynonymInHomotypicalGroupHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/CreateSynonymInHomotypicalGroupHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteAllEmptyNamesHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteAllEmptyNamesHandlerE4.java with 83% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteTaxonBaseHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteTaxonBaseHandlerE4.java with 96% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/MoveSynonymToAnotherAcceptedTaxonHandlerE4.java with 93% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SetBasionymHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SetBasionymHandlerE4.java with 92% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedHandler.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedHandlerE4.java with 97% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/SwapSynonymAndAcceptedSetNameInSourceHandlerE5.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/operation/MoveSynonymToAnotherAcceptedTaxonOperationE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicGroupOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToMisapplicationOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateNewTaxonBaseOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExistingHomotypicalGroupOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInNewGroupOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteSynonymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonBaseOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionColumnAccessor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditorPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java [deleted file]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptRelationViewer.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/CreateConceptRelationHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/DeleteConceptRelationHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/handler/OpenRelatedConceptHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/ConceptGraphContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/graph/e4/ConceptGraphViewE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AbstractAddDerivativeHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/SingleReadReuseHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/MoveDerivateOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/searchFilter/DerivateSearchCompositeController.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveLabelProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewerComparator.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewerSorter.java with 54% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/CreateDescriptionElementHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DeleteHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DescriptionsMenuPropertyTesterE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/DynamicFeatureMenuE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsSetNameInSourceHandlerE5.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandlerE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/SetDefaultDescriptionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/AddDerivedUnitFacadeMediaOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateTaxonDescriptionOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteTaxonDescriptionOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/DeleteTaxonNameDescriptionOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionElementsOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionToOtherTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/SetDefaultDescriptionOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/e4/MediaViewPartE4.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AbstractMoveImageHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/DeleteMediaHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/e4/UsesViewPartE4.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToConceptOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToMisapplicationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExisitingHomotypicalGroupOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteMisapplicationOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteSynonymOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperationTest.java
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.feature.platform/pom.xml
eu.etaxonomy.taxeditor.feature/feature.xml
eu.etaxonomy.taxeditor.feature/pom.xml
eu.etaxonomy.taxeditor.help/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.help/pom.xml
eu.etaxonomy.taxeditor.local/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.local/build.properties
eu.etaxonomy.taxeditor.local/fragment.e4xmi [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.local/pom.xml
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/handler/SwitchUserHandlerE4.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/server/CdmStoreConnectorLocal.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/server/CdmStoreLocal.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/server/RemotingLoginDialogLocal.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/view/datasource/e4/handler/AbstractDataSourceHandler.java [moved from eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/view/datasource/e4/handler/AbstractDataSourceHandlerE4.java with 97% similarity]
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/view/datasource/e4/handler/CloneDataSourceHandlerE4.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/view/datasource/e4/handler/DeleteDataSourceHandlerE4.java
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/view/datasource/e4/handler/EditDataSourceHandlerE4.java
eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular.lib/pom.xml
eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular/pom.xml
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/e4/AlignmentEditorE4.java
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
eu.etaxonomy.taxeditor.navigation/pom.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/AppModelId.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartDataChangeBehaviorE4.java [deleted file]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/RefreshNodesOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages.properties
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/l10n/messages_de.properties
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/EmptyRoot.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/Root.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorDataChangeBehaviorE4.java [deleted file]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/ChangeAcceptedTaxonToSynonymHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CloneClassificationHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CopyHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/CreateClassificationHierarchyHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/DeleteHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/DeleteTaxonNodeHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/MoveFactualDataHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/MoveFactualDataSetNameInSourceHandlerE5.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/MoveTaxonNodeHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewClassificationHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetSecReferenceForSubtreeHandlerE4.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/ChangeAcceptedTaxonToSynonymOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CloneClassificationOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateClassification.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateNewTaxonHierarchyOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreatePolytomousKey.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/e4/SearchResultViewE4.java
eu.etaxonomy.taxeditor.printpublisher/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.printpublisher/build.properties
eu.etaxonomy.taxeditor.printpublisher/pom.xml
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizard.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/fragment.e4xmi
eu.etaxonomy.taxeditor.store/icons/ban_new.gif [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/icons/no_entry.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/icons/no_entry_2.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/icons/no_entry_3.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/pom.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/CdmLightExportAdminPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralAdminPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/DistributionAdminPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/FactualDataAdminPreferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/LanguageRepresentationAdminPreferencePage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/MediaMetaDataPreference.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairUpdateSortIndicesWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/CdmEntitySessionInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ICharacterMatrix.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermSorter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/FeatureDtoContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermBasePropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermDtoContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermDtoLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermTreeViewerComparator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermDragListenerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermDropAdapterE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/handler/CreateDefinedTermHandlerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/handler/DeleteTermBaseHandlerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/handler/MoveDefinedTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateTermVocabularyOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/MoveDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/event/WorkbenchEventConstants.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenPasswordWizzardHandlerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/ReconnectHandlerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/AbstractImportWizard.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/AbstractImportWizardE4.java with 89% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/AbstractOpenImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/GenericConfiguratorWizardPageE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/AbcdImportConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/AbcdImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/OpenAbcdImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/distribution/ExcelDistributionUpdateWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/distribution/OpenExcelDistributionImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/OpenExcelSpecimenImportWizard.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/SpecimenCdmExcelImportWizardE4.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/taxa/ExcelNormalExplicitTaxaImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/taxa/OpenExcelTaxaImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/owl/OpenOwlImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/owl/OwlImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ris/OpenRisImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ris/RISImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/sdd/OpenSddImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/sdd/SddImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/tcs/OpenTcsImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/tcs/TcsImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/AbstractExportWizard.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/AbstractExportWizardE4.java with 78% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/AbstractOpenExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/cdmlight/CdmLightExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/cdmlight/OpenCdmLightExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/ColExportWizardE4.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/OpenColExportWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/CsvExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/OpenCsvExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/name/CsvNameExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/name/OpenCsvNameExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/print/OpenCsvPrintExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/dwca/DarwinCoreArchiveExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/dwca/OpenDwcaExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/jaxb/JaxbExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/jaxb/OpenJaxbExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/owl/OpenOwlTermExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/owl/OwlTermExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/owl/OwlTermExportWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/sdd/OpenSddExportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/sdd/SddExportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/OpenWfoBackboneExportWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/WfoBackboneExportWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractDataChangeBehaviour.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DefaultTermComparator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/FeatureNodeContainerTree.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IDerivedUnitFacadePart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IDirtyMarkable.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/AbstractNewEntityWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/AbstractNewEntityWizardParentChild.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/AmplificationGeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/ExternalReferenceServiceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewClassificationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewCollectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewCommonNameReferenceWizard.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewFeatureVocabularyWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGroupWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizardDialog.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/PolytomousKeyWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/PrimerWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/VocabularyWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPersistentPostOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/CdmUpdateOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/e4/CdmHandlerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbcdImportPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbcdImportProvider.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbstractGeneralTermPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbstractVocabularySelectionPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AreaCheckBoxTreeComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/BiocaseProvideConfig.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmLightExportPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmPreferenceCache.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmStorePropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CommonNameVocabularyPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DistributionDetailsViewPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DistributionGeneralPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DistributionStatusPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/EditorPreferencePredicate.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/EnableComputedDescriptions.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExperimentalFeaturesPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/FactualDataPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/GeneralPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/GeneralTermPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IOPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageEditorPreferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguagePreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageRepresentationPreferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ListComponent.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LocalOrDefaultEnum.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NameDetailsConfigurator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NameDetailsViewConfiguration.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NamePreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NamedAreaVocabularyPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NavigatorOrderEnum.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalCodePreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishEnumX.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishFlagLocalPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/RankPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SearchDialogPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SearchPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SecundumReferenceHandling.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SupplementalDataPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonPreferencesMisappliedNames.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TermOrderXX.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/TermTreePreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/UIPreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CdmPreferencePage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CommonNameLanguagePreferences.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/FeatureMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/NameFeatureMenuPreference.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AreaViewerComparator.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPerAreaStatusPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPerAreaStatusWizard.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusAdminWizard.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusWizard.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/CdmCheckBoxTreeViewer.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/CheckBoxTreeComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/GeneralVocabularyPreferencePage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/NamedAreaWrapper.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/TermSelectionWizardPage.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/VocabularyTermWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/AppModelId.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/LoginManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/TermStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/UsageTermCollection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/UseObjectStore.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/AvailableTermsWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/AvailableTermsWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/TermChooseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/TermChooseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/ITermTreeEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermNodeDragListener.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermNodeDtoDragListener.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermTreeDtoDropAdapter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermTreeDtoEditorComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermTreeEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/AbstractAddTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/AddChildTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/AddTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/CopyTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/PasteTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/handler/RemoveTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/UuidAndTitleCacheLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/AbstractComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/OriginalSourceTypeComparator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermCollectionComboElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/VocabularyComboElement.java with 76% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/term/TermComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/CloneClassificationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/SuperAreaSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/SetSecundumConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/wizard/NamedAreaTermDtoContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmEnumSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredIdentifierSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AgentSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AmplificationSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ClassificationSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CollectionSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CollectorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameNamedAreaSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/DerivedUnitSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FieldUnitSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FilterDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GroupSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/MediaSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorTeamSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalPersonAuthorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/OriginalSourceTypeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PersonSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PrimerSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/RightsSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SearchDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationBaseSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationTypeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeAndBoolean.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionNaturalOrderDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TeamSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/UserSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmEntityWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractFormSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/GatheringEventUnitElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MinMaxTextSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RepresentationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TimePeriodElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ToggleableTextElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/EditPasswordElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/password/PasswordWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/EmptyElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/ICdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/ITaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/NomenclaturalTeamMemberElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamMemberSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamOrPersonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/AbstractEditWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/CloneClassificationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/CloneClassificationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/EditTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeAgentRelationCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ExternalLinksSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferencedEntityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DerivedUnitElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescribedSpecimenSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementMediaSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/GeoScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/MediaDetailsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/SourceComparator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/AbstractDetailedDescriptionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CategoricalDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CommonNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/DistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/IndividualsAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/QuantitativeDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TemporalDataDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TextDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/AbstractApplicableElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/AbstractApplicableElementForDto.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDtoDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDtoDetailSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDtoDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDtoDetailSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureStateWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/InapplicableIfEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/InapplicableIfEntityCollectionSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/OnlyApplicableIfEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/OnlyApplicableIfEntityCollectionSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailElementForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityCollectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupSelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/TaxonomicScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AbstractTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NomenclaturalStatusSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/RuleConsideredElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/operation/DeleteTypeDesignationOperation.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractDeterminationEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractSpecimenOrObservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectingAreaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectingAreasDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectionWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CurrentDeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitMediaSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeoScopePolyKeyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OccurrenceStatusElement.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OriginalLabelDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/StatusCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenAbstractDeterminationEventDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenCurrentDeterminationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenSourceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AbstractSampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AbstractUnboundEntityCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationCloningDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationCloningDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGelPhotoCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGelPhotoDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationPrimerDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationPrimerDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/CurrentSampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/PrimerGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationHistoryDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceContigFileCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceReferenceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadPherogramCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/AdvancedSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceAdvancedSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SingleSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractSourcedEntityElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CreditElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CreditSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/ExtensionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/HeadlineDtoSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/RightsElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/RightsSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/AbstractIdentifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/DerivedUnitFacadeIdentifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/IdentifierElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/identifier/IdentifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/ParsingMessagesSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonOfRelationshipElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/GroupsByUserDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/GroupsByUserDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/FeatureDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/LanguageDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/MeasurementUnitDtoCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/NamedAreaLevelDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/PresenceAbsenceTermDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsCollectionSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsDtoCollectionSection.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesElement.java with 52% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierDtoCollectionsElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierDtoVocabulariesElement.java with 54% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesCollectionSection.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesDtoCollectionSection.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateCollectionElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionElement.java with 50% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateCollectionSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateCollectionsDtoElement.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyDtoCollectionElement.java with 50% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateDtoCollectionSection.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyDtoCollectionSection.java with 52% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionSection.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StatisticalMeasureCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StatisticalMeasureDtoCollectionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermMediaSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/TermVocabularyDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/ClassificationSelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/CollectorSelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElementWithAbbreviatedTitle.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/TaxonNodeSelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/translation/TermTranslationWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/TaxonTreeNodeLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/GbifResponseImportView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SaveImportedSpecimenAction.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPart.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java with 76% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataPartE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataViewerE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerContentProvider.java [moved from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistContentProvider.java with 75% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerLabelProvider.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerViewPart.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerRepository.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerViewerComparator.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/AbstractRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/CreateRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/DeleteRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/EditRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveDownRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveUpRemoteServerHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizard.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/derivative/DerivateLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/FilterComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/SearchController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/occurrence/OccurrenceSearchController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearchController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearchResult.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearchResultComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/specimen/SpecimenProviderSelectionComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/SessionsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/GfBioTerminologyImportComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/GfBioTerminologyImportPresenter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/OntologyTermContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/HierarchyParser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/OntologyTermParser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/ParserUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/SuggestParser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/TermParser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/TerminologyParser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/wrapper/HierarchyTermWrapper.java
eu.etaxonomy.taxeditor.store/src/test/java/eu/etaxonomy/taxeditor/store/NameProtectTitleCacheTest.java
eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.test/pom.xml
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/CdmServiceCacherTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/lazyloading/RemoteLazyLoadingTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonEditorTest.java [moved from eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java with 98% similarity]
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/IOServiceImportTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/service/ServiceInterceptorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManagerTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/MockConversationEnabled.java
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.xml
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonEditorTest.xml [moved from eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.xml with 100% similarity]
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/operation/TaxonNavigatorTest.xml
eu.etaxonomy.taxeditor.test/src/test/resources/eu/etaxonomy/taxeditor/service/IOServiceExportTest.xml
eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db
eu.etaxonomy.taxeditor.workbench/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.workbench/pom.xml
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/handler/OpenAdminPreferencesHandler.java
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/handler/OpenPreferencesHandler.java
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre
eu.etaxonomy.taxeditor/pom.xml
eu.etaxonomy.taxeditor/rcp.target
pom.xml

index 8812ddcea5f06f5b926184cd161e165445638a9b..c3ebb972bbef4d6f17e5a8c0070f9390d84c486e 100644 (file)
@@ -322,7 +322,6 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/po
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java -text
-eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroup.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractHomotypicalGroupContainer.java -text
@@ -1181,7 +1180,6 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvE
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvNameExportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/CsvPrintExportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/DarwinCoreArchiveExportWizard.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java -text
@@ -1766,7 +1764,6 @@ eu.etaxonomy.taxeditor.test/src/main/resources/datasources.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/cdm.datasources.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/PolytomousKeyTest.xml -text
-eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNameEditorTest.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/model/TaxonNavigatorTest.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/cdm/testRemotingApplicationContext.xml -text
 eu.etaxonomy.taxeditor.test/src/main/resources/eu/etaxonomy/taxeditor/lazyloading/AbstractLazyInitializerTest.xml -text
@@ -1780,7 +1777,6 @@ eu.etaxonomy.taxeditor.test/src/main/resources/unitils.properties -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmClientCachingTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/api/cache/CdmModelGetMethodCacherTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/PolytomousKeyTest.java -text
-eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNameEditorTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/cdm/model/TaxonNavigatorTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/application/menu/general/NewMenuTest.java -text
 eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/httpinvoker/BaseRemotingTest.java -text
index 5fad05636a791e388727d4d38c9633e294327e43..b99e496b08421d8ccd0938108530e539c4bde929 100644 (file)
@@ -68,6 +68,7 @@ eu.etaxonomy.taxeditor.cdmlib/lib/spring-core-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-expression-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-jdbc-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-oxm-4.*.jar
+eu.etaxonomy.taxeditor.cdmlib/lib/spring-orm-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-security-core-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-test-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/spring-tx-4.*.jar
@@ -88,6 +89,8 @@ eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/poi-ooxml-schemas-4.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections-3.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/commons-collections4-4.*.jar
+eu.etaxonomy.taxeditor.cdmlib/lib/commons-beanutils-1.*.jar
+eu.etaxonomy.taxeditor.cdmlib/lib/json-lib-2.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/commons-math3-3.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/jaxb-api-2.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/javax.activation-api-1.*.jar
@@ -97,6 +100,7 @@ eu.etaxonomy.taxeditor.cdmlib/lib/usertype.core-7.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-core-5.*.Final.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-entitymanager-5.*.Final.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-envers-5.*.Final.jar
+eu.etaxonomy.taxeditor.cdmlib/lib/hibernate-search-engine-5.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/antlr-2.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/cglib-nodep-3.*.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/ehcache-2.*.jar
index a8edce5e94a27936705cc274a8aafd8141a3382c..fa088d5dae998b90ffed3a328b871146e6694292 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Application
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/plugin
index 0e16c4ba708675068242989a5f20ebe70f25138d..755ba26d245a83a760fda5a1abc5febd98507923 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index 969b31488e1ef8ec3d196d77f78711b4ce0a8c5b..ae058587103de352454d81411886bf5f1e2b830f 100644 (file)
@@ -14,7 +14,7 @@ import org.eclipse.ui.statushandlers.StatusAdapter;
 import org.springframework.remoting.RemoteAccessException;
 import org.springframework.remoting.RemoteConnectFailureException;
 
-import eu.etaxonomy.cdm.database.PermissionDeniedException;
+import eu.etaxonomy.cdm.persistence.permission.PermissionDeniedException;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmAuthenticationException;
@@ -97,6 +97,7 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                        else if (t instanceof NoHttpResponseException
                                  || t.getCause() instanceof CdmAuthenticationException
                                  || (t.getMessage() != null && t.getMessage().contains("status code = 403"))){
+                               t.printStackTrace();
                         MessagingUtils.informationDialog("Access denied", MessagingUtils.ACCESS_DENIED);
                     }else if (includesCause(t, OptionalDataException.class)){
                         MessagingUtils.informationDialog("Error (OptionalDataException)",
@@ -137,7 +138,8 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                }
 
                /**
-                * analyzes whether the
+                * Analyzes whether the throwable includes an exception of type clazz
+                * in the stacktrace.
          */
         private <T extends Exception> boolean includesCause(Throwable t, Class<? extends Throwable> clazz) {
             boolean result = false;
index 62f65a993570858af453f9975d653b8666526182..ab267fafc900dc377489e819d4741b811f64347d 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2017 EDIT
 * European Distributed Institute of Taxonomy
@@ -156,7 +155,6 @@ public class LifeCycleManager implements IContextListener{
                 .getActiveWorkbenchWindow();
         if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowChecklistPerspective.getKey())){
 
-
             IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
             IWorkbenchPage page = window.getActivePage();
             page.setPerspective(registry.findPerspectiveWithId("eu.etaxonomy.taxeditor.perspective.checklistperspective"));
@@ -164,7 +162,6 @@ public class LifeCycleManager implements IContextListener{
             EditorUtil.setMediaVisible(false);
         }else{
 
-
             IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
             IWorkbenchPage page = window.getActivePage();
             page.setPerspective(registry.findPerspectiveWithId("eu.etaxonomy.taxeditor.application.perspective.taxonomic"));
@@ -173,21 +170,13 @@ public class LifeCycleManager implements IContextListener{
         hideParts();
 
         PreferencesUtil.checkNomenclaturalCode();
-
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void contextRefresh(IProgressMonitor monitor) {
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
-
-}
+}
\ No newline at end of file
index e29e240f16fd3535308aecef4c37047864001b01..fa9f52c95339edd6e7cd0435e61b77136500f1f9 100644 (file)
@@ -1,6 +1,7 @@
 package eu.etaxonomy.taxeditor;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.equinox.p2.core.IProvisioningAgent;
 import org.eclipse.equinox.p2.engine.IProfileRegistry;
 import org.eclipse.equinox.p2.operations.ProvisioningSession;
@@ -21,8 +22,8 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @author n.hoffmann
  */
 public class TaxonomicEditorPlugin extends AbstractUIPlugin {
-       
-       private static final Logger logger = LogManager.getLogger(TaxonomicEditorPlugin.class);
+
+       private static final Logger logger = LogManager.getLogger();
 
        // The plug-in ID
        /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.application"</code> */
@@ -107,13 +108,13 @@ public class TaxonomicEditorPlugin extends AbstractUIPlugin {
            if (ui == null) {
                ServiceReference<?> reference = bundleContext.getServiceReference(IProvisioningAgent.SERVICE_NAME);
                IProvisioningAgent agent = (IProvisioningAgent) bundleContext.getService(reference);
-              
+
                session = new ProvisioningSession(agent);
-               
+
                Policy policy = null;// = (Policy) ServiceHelper.getService(ProvUIActivator.getContext(), Policy.class.getName());
                if (policy == null) {
                    policy = new Policy();
-                   
+
                }
                ui = new ProvisioningUI(session, IProfileRegistry.SELF, policy);
            }
index 4972b98806d25cb970d4a9b8e1940c2e2a010737..345ce17b0a8f9bd476668dc5f4d054a3f155c21f 100644 (file)
@@ -24,7 +24,7 @@ public abstract class Default implements IPerspectiveFactory {
        protected static final String DETAILS_VIEW = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_DETAILS_DETAILSPARTE4;
        protected static final String SUPPLEMENTAL_VIEW = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_SUPPLEMENTALDATA_SUPPLEMENTALDATAPARTE4;
        protected static final String NAVIGATOR = eu.etaxonomy.taxeditor.navigation.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_NAVIGATION_NAVIGATOR;
-       protected static final String NAME_EDITOR = eu.etaxonomy.taxeditor.editor.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4;
+       protected static final String NAME_EDITOR = eu.etaxonomy.taxeditor.editor.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR;
        protected static final String FACTUAL_DATA_VIEW = eu.etaxonomy.taxeditor.editor.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVE_E4_FACTUALDATAPARTE4;
        protected static final String MEDIA_VIEW = eu.etaxonomy.taxeditor.editor.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_MEDIA_E4_MEDIAVIEWPARTE4;
        protected static final String SEARCH_RESULTS = eu.etaxonomy.taxeditor.navigation.AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_NAVIGATION_SEARCH_E4_SEARCHRESULTVIEWE4;
index d3d54e72910d81d52f170e6d2ccbe61fbdd8ae15..893377d66a937649e61ffb1aceec86f096e3bca8 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Bulkeditor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
index bca660e420e729c893453c97f87a0e8d35af393c..ef056e03d52c034eee170f7c6abaeb958e67d5d3 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>5.33.0</version>
+               <version>5.42.0</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 8ab75bdbafd74a0dadb43268cd1c46548c1c29d4..cf688172909187135c34f616e2c6657e3e7535b3 100644 (file)
@@ -90,7 +90,7 @@ public class NewObjectHandler {
                 }
                 bulkEditor.getEditorInput().getModel().add(createdEntity);
                 if (createdEntity instanceof CdmBase){
-                    if (!((CdmBase)createdEntity).isPersited()){
+                    if (!((CdmBase)createdEntity).isPersisted()){
                         bulkEditor.getEditorInput().addSaveCandidate((CdmBase)createdEntity);
                         bulkEditor.setDirty();
                     }
index 6fe83c4dd4425f1f490e890b821d180c6afe80b3..308bf0694d64d0d08acc332aef449db194b38ede 100644 (file)
@@ -16,7 +16,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.MediaEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonBulkEditorInput;
 
 /**
  * @author p.ciardelli
@@ -58,7 +58,7 @@ public class BulkEditorPropertyTester extends PropertyTester {
             return bulkEditor.getEditorInput() instanceof OccurrenceEditorInput;
                }
         else if(IS_TAXON_EDITOR.equals(property)){
-            return bulkEditor.getEditorInput() instanceof TaxonEditorInput;
+            return bulkEditor.getEditorInput() instanceof TaxonBulkEditorInput;
         }
         else if(IS_MEDIA_EDITOR.equals(property)){
             return bulkEditor.getEditorInput() instanceof MediaEditorInput;
index f2dddc570450e094f1dc903818244f774bc32c35..210fbf6c993cd13eead87f0a04f4c6a94d29860b 100644 (file)
@@ -40,9 +40,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
@@ -61,13 +59,11 @@ import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.MediaEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonBulkEditorInput;
 import eu.etaxonomy.taxeditor.editor.IBulkEditor;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -88,7 +84,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @author pplitzner
  * @since Sep 8, 2017
  */
-public class BulkEditor implements IPartContentHasDetails, IConversationEnabled, IPostOperationEnabled,
+public class BulkEditor implements IPartContentHasDetails, IPostOperationEnabled,
         IDirtyMarkable, IDerivedUnitFacadePart, IPartContentHasFactualData,
         IPartContentHasSupplementalData, IPartContentHasMedia, IE4SavablePart, ITaxonEditor, IBulkEditor {
 
@@ -97,8 +93,6 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
 
     private AbstractBulkEditorInput input;
 
-    private ConversationHolder conversation;
-
     @Inject
     private IEventBroker eventBroker;
 
@@ -111,7 +105,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
     private BulkEditorQuery lastQuery = null;
 
     private BulkEditorComposite bulkEditorComposite;
-    
+
     private Set<AbstractPostOperation> operations = new HashSet<>();
 
     @Inject
@@ -120,7 +114,6 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
 
     public void init(AbstractBulkEditorInput<?> input){
            this.input = input;
-           this.conversation = input.getConversation();
            thisPart.setLabel(input.getEditorName());
 
            bulkEditorComposite.init(input);
@@ -147,7 +140,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
             String operationlabel = entry.getLabel();
             try {
                 entry.addContext(IOperationHistory.GLOBAL_UNDO_CONTEXT);
-                
+
                 status = entry.execute(new NullProgressMonitor(), uiInfoAdapter);
             } catch (ExecutionException e) {
                 MessagingUtils.operationDialog(AbstractUtility.class, e, TaxeditorStorePlugin.PLUGIN_ID, operationlabel, null);
@@ -168,17 +161,14 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
         }
         input.saveModel(resetMerge);
 
-//       IStructuredSelection selection = getSelection();
-
         dirty.setDirty(false);
         input.dispose();
         input.bind();
-        conversation.commit(true);
 
         if (lastQuery != null){
             bulkEditorComposite.performSearch(lastQuery, selection);
         }
-       
+
     }
 
 
@@ -186,12 +176,11 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
                return new StructuredSelection(this.bulkEditorComposite.getLastSelectedObject());
        }
 
-       @Focus
+       @Override
+    @Focus
        public void setFocus() {
         //make sure to bind again if maybe in another view the conversation was unbound
-        if(conversation!=null && !conversation.isBound()){
-            conversation.bind();
-        }
+
         if(input!=null && input.getCdmEntitySession()!= null) {
             input.getCdmEntitySession().bind();
         }
@@ -202,10 +191,6 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
 
        @PreDestroy
        public void dispose() {
-           if(conversation!=null){
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-           }
            if(input!=null){
                input.dispose();
            }
@@ -241,6 +226,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
         return bulkEditorComposite.getCellSelection();
     }
 
+    @Override
     public void setSelection(IStructuredSelection selection){
         bulkEditorComposite.setSelection(selection);
     }
@@ -266,10 +252,6 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
         bulkEditorComposite.copyDataToClipboard();
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
-
     @Override
     public boolean canAttachMedia() {
         return true;
@@ -291,7 +273,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
             if (element instanceof DescriptionBase){
                 if (element instanceof TaxonNameDescription){
                     TaxonName changedName = ((TaxonNameDescription)element).getTaxonName();
-                    if (getEditorInput() instanceof TaxonEditorInput){
+                    if (getEditorInput() instanceof TaxonBulkEditorInput){
                         IStructuredSelection sel = getSelection();
                         Object firstElement = sel.getFirstElement();
                         if (firstElement instanceof TaxonBase){
@@ -311,7 +293,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
                 if (((DescriptionElementBase)element).getInDescription() instanceof TaxonNameDescription){
                     TaxonName changedName = ((TaxonNameDescription)((DescriptionElementBase)element).getInDescription()).getTaxonName();
                     //check whether the bulk editor is taxon or name bulk editor
-                    if (getEditorInput() instanceof TaxonEditorInput){
+                    if (getEditorInput() instanceof TaxonBulkEditorInput){
                         IStructuredSelection sel = getSelection();
                         Object firstElement = sel.getFirstElement();
                         if (firstElement instanceof TaxonBase){
@@ -333,7 +315,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
             }else if (element instanceof Media && input instanceof MediaEditorInput){
                getEditorInput().addSaveCandidate((Media)element);
                 input.replaceInModel((Media)element);
-            }else if (element instanceof Media ) {             
+            }else if (element instanceof Media ) {
                 IStructuredSelection sel = getSelection();
                 Object firstElement = sel.getFirstElement();
                 if (firstElement instanceof TaxonBase){
@@ -344,13 +326,13 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
                     SpecimenOrObservationBase changedSpecimen = (SpecimenOrObservationBase)sel.getFirstElement();
                     getEditorInput().addSaveCandidate(changedSpecimen);
                     input.replaceInModel(changedSpecimen);
-                } 
+                }
             }else if(element instanceof Group){
                  Group oldGroup = ((GroupEditorInput)input).getEntityFromModel((Group)element);
                  ((GroupEditorInput)input).getSaveUserCandidates().addAll(oldGroup.getMembers());
                  getEditorInput().addSaveCandidate((Group)element);
                  input.replaceInModel((CdmBase) element);
-            }else if(element instanceof TaxonName && input instanceof TaxonEditorInput){
+            }else if(element instanceof TaxonName && input instanceof TaxonBulkEditorInput){
                 IStructuredSelection sel = this.getSelection();
                 TaxonBase taxonBase = null;
                 if (sel.getFirstElement() instanceof TaxonBase){
@@ -375,7 +357,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
                        getEditorInput().addSaveCandidate(taxon);
                        input.replaceInModel(taxon);
                 }
-                
+
             }
             else{
                 getEditorInput().addSaveCandidate((CdmBase)element);
@@ -401,10 +383,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
         return false;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
+
 
     public BulkEditorQuery getLastQuery() {
        return lastQuery;
@@ -440,7 +419,7 @@ public class BulkEditor implements IPartContentHasDetails, IConversationEnabled,
     @Inject
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_NAME_EDITOR) List<CdmBase> cdmBases) {
-        if (getEditorInput() instanceof TaxonEditorInput){
+        if (getEditorInput() instanceof TaxonBulkEditorInput){
             for (CdmBase cdmBase: cdmBases){
                 if (getEditorInput().getModel().contains(cdmBase)){
                     input.performSearch(lastQuery, getSelection());
index 281530ce509b10fe69a73b92491cffa70ea504aa..a38d496d58ebea8074aadb124566f1d808c8d985 100644 (file)
@@ -102,7 +102,7 @@ public class DeleteHandlerE4 {
         Set<CdmBase> removeFromSelection = new HashSet();
         for(selection.iterator();iterator.hasNext();){
             CdmBase cdmBase = (CdmBase) iterator.next();
-            if (!cdmBase.isPersited()){
+            if (!cdmBase.isPersisted()){
                 editor.getEditorInput().getModel().remove(cdmBase);
                 editor.getEditorInput().getSaveCandidates().remove(cdmBase);
                 removeFromSelection.add(cdmBase);
@@ -131,7 +131,7 @@ public class DeleteHandlerE4 {
         iterator = selection.iterator();
         for(selection.iterator();iterator.hasNext();){
             CdmBase cdmBase = (CdmBase) iterator.next();
-            if (cdmBase.isPersited()){
+            if (cdmBase.isPersisted()){
                 delete(cdmBase, shell, editor);
             }
         }
index 1bdb0ba6da651fc4198d8b4b136d981b767bbad9..53c57f8edf1a01960083e98a80f8582500c7bc6e 100644 (file)
@@ -15,14 +15,14 @@ import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonBulkEditorInput;
 import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4;
 
 public class OpenBulkEditorForTaxonNodeHandler extends DefaultOpenHandlerBaseE4<ITaxonTreeNode, TaxonNodeDto> {
 
     @Override
     protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) {
-        AbstractBulkEditorInput<?> input = TaxonEditorInput.getInstance();
+        AbstractBulkEditorInput<?> input = TaxonBulkEditorInput.getInstance();
         input.setEntityUuid(entity.getTaxonUuid());
         BulkEditorUtil.openBulkEditor(input, modelService, partService, application);
     }
index 2d9c59d181f1335bd682252109bbad65fa8d4429..973188067ec9528800c9663d03d65dbc15a3f415 100644 (file)
@@ -25,7 +25,6 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import ca.odell.glazedlists.BasicEventList;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
@@ -81,13 +80,13 @@ public abstract class AbstractBulkEditorInput<T extends CdmBase>
        private HashMap<T, Set<T>> mergedEntities = new HashMap<>();
 
        private IEntityCreator<T> entityCreator;
-       private final ConversationHolder conversation;
+
 
     private Job searchJob;
 
        public AbstractBulkEditorInput() {
            super(true);
-           this.conversation = CdmStore.createConversation();
+
        }
 
        static public AbstractBulkEditorInput<?> NewInstance(BulkEditorInputType inputType) {
@@ -279,7 +278,7 @@ public abstract class AbstractBulkEditorInput<T extends CdmBase>
             }
             //-> continue with standard search
 
-            int pageSize = configurator.getPageSize()!=null?configurator.getPageSize():getPageSize();
+            int pageSize = configurator.getPageSize() != null ? configurator.getPageSize():getPageSize();
             configurator.setPageSize(pageSize);
                        long count = countEntities(configurator);
                        int totalWork = count>Integer.MAX_VALUE?Integer.MAX_VALUE:(int)count;
@@ -474,9 +473,7 @@ public abstract class AbstractBulkEditorInput<T extends CdmBase>
         return null;
     }
 
-       public ConversationHolder getConversation() {
-               return conversation;
-       }
+
 
        public Set<T> getSaveCandidates() {
         return saveCandidates;
index bdff3049c5f51fddb1073472d74b9a05a433eb39..8a549c94373ec8eae9c5f080d264c7c07ab7a591 100644 (file)
@@ -39,7 +39,7 @@ public enum BulkEditorInputType {
        OCCURRENCE(Messages.BulkEditorInputType_4, OccurrenceEditorInput.ID),
        USER(Messages.BulkEditorInputType_5, UserEditorInput.ID),
        GROUP(Messages.BulkEditorInputType_6, GroupEditorInput.ID),
-       TAXON(Messages.BulkEditorInputType_7, TaxonEditorInput.ID),
+       TAXON(Messages.BulkEditorInputType_7, TaxonBulkEditorInput.ID),
        MEDIA(Messages.BulkEditorInputType_8, MediaEditorInput.ID);
 
        public String id;
@@ -119,7 +119,7 @@ public enum BulkEditorInputType {
                        return USER;
                } else if (input instanceof GroupEditorInput) {
                        return GROUP;
-               } else if (input instanceof TaxonEditorInput){
+               } else if (input instanceof TaxonBulkEditorInput){
                        return TAXON;
                }else if (input instanceof MediaEditorInput){
             return MEDIA;
@@ -145,7 +145,7 @@ public enum BulkEditorInputType {
                case GROUP:
                        return new GroupEditorInput();
                case TAXON:
-                       return new TaxonEditorInput();
+                       return new TaxonBulkEditorInput();
                case MEDIA:
             return new MediaEditorInput();
                default:
index ecd3af8b118f6f6e9b39cf07c2e41dcf6974d4a5..74999921351485f3d2a651099c5e6ed9ba2e1141 100644 (file)
@@ -143,7 +143,7 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonName> {
        @Override
        public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {
                configurator.setPropertyPaths(getPropertyPaths());
-               return CdmStore.getSearchManager().findNames(configurator, this.getConversation());
+               return CdmStore.getSearchManager().findNames(configurator);
        }
 
        @Override
@@ -206,10 +206,10 @@ public class NameEditorInput extends AbstractBulkEditorInput<TaxonName> {
         public void addSaveCandidate(TaxonName name){
            if (!name.getHybridChildRelations().isEmpty()){
                for (HybridRelationship rel: name.getHybridChildRelations()){
-                   if (!rel.getParentName().isPersited()){
+                   if (!rel.getParentName().isPersisted()){
                        super.addSaveCandidate(rel.getParentName());
                    }
-                   if (!rel.getHybridName().isPersited()){
+                   if (!rel.getHybridName().isPersisted()){
                     super.addSaveCandidate(rel.getHybridName());
                 }
                }
index 37d37ce59743712903ec44cf5a0ca36d8b867f0e..429acb0d949a7e7f4c7899f18d1284d9632ff9dc 100644 (file)
@@ -6,7 +6,6 @@
 * 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.input;
 
 import java.util.ArrayList;
@@ -17,6 +16,7 @@ import java.util.UUID;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
+import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
@@ -37,8 +37,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author n.hoffmann
  * @created Jun 16, 2010
  */
-public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObservationBase> {
-
+public class OccurrenceEditorInput 
+               extends AbstractBulkEditorInput<SpecimenOrObservationBase> {
 
        public static final String ID = "bulkeditor.input.occurrence"; //$NON-NLS-1$
 
@@ -177,7 +177,7 @@ public class OccurrenceEditorInput extends AbstractBulkEditorInput<SpecimenOrObs
        @Override
        protected List<SpecimenOrObservationBase> listEntities(
                        IIdentifiableEntityServiceConfigurator configurator) {
-               return CdmStore.getSearchManager().findOccurrences(configurator, false);
+               return CdmStore.getSearchManager().findOccurrences((FindOccurrencesConfigurator)configurator, false);
        }
 
     @Override
similarity index 91%
rename from eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonEditorInput.java
rename to eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/TaxonBulkEditorInput.java
index ad617976f4298b4d989379b7aba0ae014873fa7f..ecb779f98a54d44ce3e458562f6c33ee68c9cb38 100644 (file)
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\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
-package eu.etaxonomy.taxeditor.bulkeditor.input;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Arrays;\r
-import java.util.List;\r
-import java.util.UUID;\r
-\r
-import eu.etaxonomy.cdm.api.service.INameService;\r
-import eu.etaxonomy.cdm.api.service.ITaxonService;\r
-import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;\r
-import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;\r
-import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;\r
-import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
-import eu.etaxonomy.cdm.model.name.HybridRelationship;\r
-import eu.etaxonomy.cdm.model.name.TaxonName;\r
-import eu.etaxonomy.cdm.model.taxon.Synonym;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
-import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;\r
-import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;\r
-import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.TaxonCreator;\r
-import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;\r
-import eu.etaxonomy.taxeditor.l10n.Messages;\r
-import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
-\r
-public class TaxonEditorInput extends AbstractBulkEditorInput<TaxonBase>{\r
-\r
-       private static TaxonEditorInput instance;\r
-\r
-       public static final String ID = "bulkeditor.input.taxon";\r
-\r
-       private static final String PROPERTY_PUBLISH = "Publish";\r
-\r
-       private List<TaxonName> saveNameCandidates = new ArrayList<>();\r
-\r
-       public static AbstractBulkEditorInput getInstance() {\r
-               if (instance == null) {\r
-                       instance = new TaxonEditorInput();\r
-               }\r
-\r
-               return instance;\r
-       }\r
-\r
-    @Override\r
-    protected List<String> getPropertyKeys_internal() {\r
-        List<String> propertyKeysInternal = new ArrayList<>();\r
-        propertyKeysInternal.add(PROPERTY_PUBLISH);\r
-        return propertyKeysInternal;\r
-    }\r
-\r
-    @Override\r
-    public Object getPropertyValue(TaxonBase cdmBase, String property) {\r
-        if(property.equals(PROPERTY_PUBLISH)){\r
-            return cdmBase.isPublish();\r
-        }\r
-        return super.getPropertyValue(cdmBase, property);\r
-    }\r
-\r
-    @Override\r
-    public boolean isBooleanProperty(String property) {\r
-        if(property.equals(PROPERTY_PUBLISH)){\r
-            return true;\r
-        }\r
-        return super.isBooleanProperty(property);\r
-    }\r
-\r
-    @Override\r
-       public String getName() {\r
-               return BulkEditorInputType.TAXON.label;\r
-       }\r
-\r
-       public static Object getID() {\r
-               return ID;\r
-       }\r
-\r
-       @Override\r
-    public List<IBulkEditorSortProvider<TaxonBase>> getSortProviders() {\r
-        List<IBulkEditorSortProvider<TaxonBase>> sortProviders = super.getSortProviders();\r
-\r
-        sortProviders.add(0, new IdentifiableEntitySortProvider<TaxonBase>());\r
-\r
-        return sortProviders;\r
-    }\r
-\r
-       @Override\r
-       public boolean isMergingEnabled() {\r
-               return false;\r
-       }\r
-       @Override\r
-       public TaxonBase save(TaxonBase entity) {\r
-           return CdmStore.getService(ITaxonService.class).merge(entity, true).getMergedEntity();\r
-       }\r
-\r
-    @Override\r
-    protected long countEntities(IIdentifiableEntityServiceConfigurator configurator) {\r
-        return CdmStore.getService(ITaxonService.class).countByTitle(configurator);\r
-    }\r
-\r
-       @Override\r
-       public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {\r
-//             IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<>();\r
-//             newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized());\r
-//             newConfig.setMatchMode(MatchMode.ANYWHERE);\r
-           List<String> propertyPaths = getPropertyPaths();\r
-           configurator.setPropertyPaths(propertyPaths);\r
-               List<TaxonBase> taxa =  CdmStore.getSearchManager().findTaxa(configurator);\r
-               List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>();\r
-               for (TaxonBase taxon:taxa){\r
-\r
-                       if (taxon instanceof Taxon){\r
-                               taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class));\r
-                       }else{\r
-                               taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Synonym.class));\r
-                       }\r
-               }\r
-               return taxaCopy;\r
-       }\r
-\r
-       @Override\r
-       protected TaxonBase loadEntity(UUID entityUuid) {\r
-               List<String> propertyPaths = Arrays.asList(new String[]{});\r
-               return CdmStore.getService(ITaxonService.class).load(entityUuid, propertyPaths);\r
-       }\r
-\r
-       @Override\r
-    public boolean delete(TaxonBase entity, DeleteConfiguratorBase config) {\r
-               if (entity instanceof Taxon){\r
-                       TaxonDeletionConfigurator taxonConfig = null;\r
-                       if (config instanceof TaxonDeletionConfigurator){\r
-                               taxonConfig = (TaxonDeletionConfigurator)config;\r
-                       }else{\r
-\r
-                       }\r
-\r
-                       return CdmStore.getService(ITaxonService.class).deleteTaxon(entity.getUuid(), taxonConfig, null) != null;\r
-               } else{\r
-                       SynonymDeletionConfigurator synConfig = null;\r
-                       if (config instanceof SynonymDeletionConfigurator){\r
-                               synConfig = (SynonymDeletionConfigurator)config;\r
-                       }else{\r
-\r
-                       }\r
-\r
-                       return CdmStore.getService(ITaxonService.class).deleteSynonym(entity.getUuid(), synConfig) != null;\r
-               }\r
-       }\r
-\r
-       @Override\r
-       protected IEntityCreator<TaxonBase> createEntityCreator() {\r
-               return new TaxonCreator();\r
-       }\r
-\r
-    @Override\r
-    public void merge() {\r
-\r
-    }\r
-\r
-    @Override\r
-    public void addSaveCandidate(TaxonBase taxonBase){\r
-        if (taxonBase == null){\r
-            MessagingUtils.info(Messages.TAXON_EDITOR_INPUT_Selection_lost);\r
-            return;\r
-        }\r
-        if (!taxonBase.getName().getHybridChildRelations().isEmpty()){\r
-            for (HybridRelationship rel: taxonBase.getName().getHybridChildRelations()){\r
-                if (!rel.getParentName().isPersited()){\r
-                    this.saveNameCandidates.add(rel.getParentName());\r
-                }\r
-                if (!rel.getHybridName().isPersited()){\r
-                    this.saveNameCandidates.add(rel.getHybridName());\r
-                }\r
-            }\r
-        }\r
-\r
-        super.addSaveCandidate(taxonBase);\r
-    }\r
-\r
-    @Override\r
-    public void saveModel(boolean resetMerge){\r
-        CdmStore.getService(INameService.class).save(this.saveNameCandidates);\r
-        super.saveModel(resetMerge);\r
-    }\r
-\r
-    private List<String> getPropertyPaths(){\r
-        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {\r
-        "descriptions.descriptionElements.*",\r
-        "typeDesignations"});\r
-\r
-        return taxonBasePropertyPaths;\r
-   }\r
-\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.bulkeditor.input;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.api.service.INameService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.HybridRelationship;
+import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
+import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
+import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.TaxonCreator;
+import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+public class TaxonBulkEditorInput extends AbstractBulkEditorInput<TaxonBase>{
+
+       private static TaxonBulkEditorInput instance;
+
+       public static final String ID = "bulkeditor.input.taxon";
+
+       private static final String PROPERTY_PUBLISH = "Publish";
+
+       private List<TaxonName> saveNameCandidates = new ArrayList<>();
+
+       public static AbstractBulkEditorInput getInstance() {
+               if (instance == null) {
+                       instance = new TaxonBulkEditorInput();
+               }
+
+               return instance;
+       }
+
+    @Override
+    protected List<String> getPropertyKeys_internal() {
+        List<String> propertyKeysInternal = new ArrayList<>();
+        propertyKeysInternal.add(PROPERTY_PUBLISH);
+        return propertyKeysInternal;
+    }
+
+    @Override
+    public Object getPropertyValue(TaxonBase cdmBase, String property) {
+        if(property.equals(PROPERTY_PUBLISH)){
+            return cdmBase.isPublish();
+        }
+        return super.getPropertyValue(cdmBase, property);
+    }
+
+    @Override
+    public boolean isBooleanProperty(String property) {
+        if(property.equals(PROPERTY_PUBLISH)){
+            return true;
+        }
+        return super.isBooleanProperty(property);
+    }
+
+    @Override
+       public String getName() {
+               return BulkEditorInputType.TAXON.label;
+       }
+
+       public static Object getID() {
+               return ID;
+       }
+
+       @Override
+    public List<IBulkEditorSortProvider<TaxonBase>> getSortProviders() {
+        List<IBulkEditorSortProvider<TaxonBase>> sortProviders = super.getSortProviders();
+
+        sortProviders.add(0, new IdentifiableEntitySortProvider<TaxonBase>());
+
+        return sortProviders;
+    }
+
+       @Override
+       public boolean isMergingEnabled() {
+               return false;
+       }
+       @Override
+       public TaxonBase save(TaxonBase entity) {
+           return CdmStore.getService(ITaxonService.class).merge(entity, true).getMergedEntity();
+       }
+
+    @Override
+    protected long countEntities(IIdentifiableEntityServiceConfigurator configurator) {
+        return CdmStore.getService(ITaxonService.class).countByTitle(configurator);
+    }
+
+       @Override
+       public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {
+//             IFindTaxaAndNamesConfigurator<TaxonBase> newConfig = new FindTaxaAndNamesConfiguratorImpl<>();
+//             newConfig.setTitleSearchString(configurator.getTitleSearchStringSqlized());
+//             newConfig.setMatchMode(MatchMode.ANYWHERE);
+           List<String> propertyPaths = getPropertyPaths();
+           configurator.setPropertyPaths(propertyPaths);
+               List<TaxonBase> taxa =  CdmStore.getSearchManager().findTaxa(configurator);
+               List<TaxonBase> taxaCopy = new ArrayList<TaxonBase>();
+               for (TaxonBase taxon:taxa){
+
+                       if (taxon instanceof Taxon){
+                               taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Taxon.class));
+                       }else{
+                               taxaCopy.add(HibernateProxyHelper.deproxy(taxon, Synonym.class));
+                       }
+               }
+               return taxaCopy;
+       }
+
+       @Override
+       protected TaxonBase loadEntity(UUID entityUuid) {
+               List<String> propertyPaths = Arrays.asList(new String[]{});
+               return CdmStore.getService(ITaxonService.class).load(entityUuid, propertyPaths);
+       }
+
+       @Override
+    public boolean delete(TaxonBase entity, DeleteConfiguratorBase config) {
+               if (entity instanceof Taxon){
+                       TaxonDeletionConfigurator taxonConfig = null;
+                       if (config instanceof TaxonDeletionConfigurator){
+                               taxonConfig = (TaxonDeletionConfigurator)config;
+                       }else{
+
+                       }
+
+                       return CdmStore.getService(ITaxonService.class).deleteTaxon(entity.getUuid(), taxonConfig, null) != null;
+               } else{
+                       SynonymDeletionConfigurator synConfig = null;
+                       if (config instanceof SynonymDeletionConfigurator){
+                               synConfig = (SynonymDeletionConfigurator)config;
+                       }else{
+
+                       }
+
+                       return CdmStore.getService(ITaxonService.class).deleteSynonym(entity.getUuid(), synConfig) != null;
+               }
+       }
+
+       @Override
+       protected IEntityCreator<TaxonBase> createEntityCreator() {
+               return new TaxonCreator();
+       }
+
+    @Override
+    public void merge() {
+
+    }
+
+    @Override
+    public void addSaveCandidate(TaxonBase taxonBase){
+        if (taxonBase == null){
+            MessagingUtils.info(Messages.TAXON_EDITOR_INPUT_Selection_lost);
+            return;
+        }
+        if (!taxonBase.getName().getHybridChildRelations().isEmpty()){
+            for (HybridRelationship rel: taxonBase.getName().getHybridChildRelations()){
+                if (!rel.getParentName().isPersisted()){
+                    this.saveNameCandidates.add(rel.getParentName());
+                }
+                if (!rel.getHybridName().isPersisted()){
+                    this.saveNameCandidates.add(rel.getHybridName());
+                }
+            }
+        }
+
+        super.addSaveCandidate(taxonBase);
+    }
+
+    @Override
+    public void saveModel(boolean resetMerge){
+        CdmStore.getService(INameService.class).save(this.saveNameCandidates);
+        super.saveModel(resetMerge);
+    }
+
+    private List<String> getPropertyPaths(){
+        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
+            "descriptions.descriptionElements.*",
+            "typeDesignations"});
+
+        return taxonBasePropertyPaths;
+   }
+}
\ No newline at end of file
index 8090cc796f041906a1036ac1b4a87b97ccbe92c0..cdd9615255ebc32afa78b54cdede15ed0afd8d7f 100644 (file)
@@ -12,7 +12,8 @@ package eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
@@ -20,14 +21,12 @@ import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 
 /**
- * <p>TeamOrPersonCreator class.</p>
- *
  * @author p.ciardelli
  * @created 18.09.2009
  */
 public class AgentCreator implements IEntityCreator<TeamOrPersonBase> {
 
-    private static final Logger logger = LogManager.getLogger(AgentCreator.class);
+    private static final Logger logger = LogManager.getLogger();
 
        @Override
     public TeamOrPersonBase createEntity(String text) {
@@ -53,11 +52,6 @@ public class AgentCreator implements IEntityCreator<TeamOrPersonBase> {
                return teamOrPerson;
        }
 
-       /**
-        * <p>getKeyLabelPairs</p>
-        *
-        * @return a {@link java.util.Map} object.
-        */
        @Override
     public Map<Object, String> getKeyLabelPairs() {
                Map<Object, String> result = new HashMap<>();
index b7075e47f46059b8d4a492cf4b0b2a629719e825..f228ae3a6b9abc5a8cfffcc49c90f15d6fabefc1 100644 (file)
@@ -6,7 +6,6 @@
 * 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.input.entitycreator;
 
 import java.util.Comparator;
@@ -22,8 +21,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>NameCreator class.</p>
- *
  * @author p.ciardelli
  * @created 07.07.2009
  */
@@ -42,11 +39,6 @@ public class NameCreator implements IEntityCreator<TaxonName> {
                return ParseHandler.parseName(text, (Rank) key);
        }
 
-       /**
-        * <p>getKeyLabelPairs</p>
-        *
-        * @return a {@link java.util.Map} object.
-        */
         @Override
     public Map<Rank, String> getKeyLabelPairs() {
                Map<Rank, String> result = new TreeMap<Rank, String>(
@@ -65,4 +57,4 @@ public class NameCreator implements IEntityCreator<TaxonName> {
                // TODO Auto-generated method stub
                return false;
        }
-}
+}
\ No newline at end of file
index 0b178a88b95209e331affa301fc0cdd42f4dc84f..e5c4a2f30673a3fb9e5421eaa5b3a98017e2a18a 100644 (file)
@@ -24,7 +24,8 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -100,7 +101,7 @@ import eu.etaxonomy.taxeditor.editor.IReferencingObjectsView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.DescriptionHelper;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 
 /**
  * This view loads and presents referencing objects information asynchronously.
@@ -112,9 +113,11 @@ import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
  * @author a.mueller
  * @since Aug 16, 2017
  */
-public class ReferencingObjectsViewE4 extends AbstractCdmEditorPartE4 implements IReferencingObjectsView{
+public class ReferencingObjectsViewE4
+        extends AbstractCdmEditorPart<TableViewer>
+        implements IReferencingObjectsView{
 
-    private static final Logger logger = LogManager.getLogger(ReferencingObjectsViewE4.class);
+    private static final Logger logger = LogManager.getLogger();
 
     private static final List<ReferencingObjectDto> EMPTY_LIST = Arrays.asList();  //immutable empty list
     private static final RefObjectDtoComparator COMPARATOR = new RefObjectDtoComparator();
@@ -351,7 +354,7 @@ public class ReferencingObjectsViewE4 extends AbstractCdmEditorPartE4 implements
         to.setReferencedEntity(from.getReferencedEntity());
     }
 
-    private Set<ReferencingObjectDto> loadReferencingObjects(UUID entity, Class objectClass) {
+    private Set<ReferencingObjectDto> loadReferencingObjects(UUID entity, Class<? extends CdmBase> objectClass) {
                //TODO why do we need to load the referenced object here
         CdmBase referencedObject = null;
         try {
@@ -397,15 +400,22 @@ public class ReferencingObjectsViewE4 extends AbstractCdmEditorPartE4 implements
 
                if (referencedObject != null){
                        setOfReferencingObjects = CdmStore.getCommonService().getReferencingObjectDtos(referencedObject);
-                       return setOfReferencingObjects;
+                       if (setOfReferencingObjects != null){
+                           return setOfReferencingObjects;
+                       }else{
+                           //for some reason sometimes this seems to return null, whenever it is called
+                    throw new RuntimeException("getReferencingObjectDtos() did not return a value for object uuid: " + referencedObject.getUuid() + ", class: " + referencedObject.getClass());
+                       }
+               }else{
+                   throw new RuntimeException("referenced object could not be retrieved for uuid: " + entity + ", class: " + objectClass);
                }
 
         } catch (Exception e) {
             logger.debug("Error retrieving referencing objects", e);
             e.printStackTrace();
             updateDescriptionLabel("The referencing objects view could not be loaded completely. Some problems occurred: " + e.getMessage());
+            return null;
         }
-               return null;
        }
 
        /**
@@ -557,7 +567,8 @@ public class ReferencingObjectsViewE4 extends AbstractCdmEditorPartE4 implements
                dto.itemClass = cdmBase.getClass();
                dto.itemId = cdmBase.getId();
                }else if  (firstElement instanceof UuidAndTitleCache<?>){
-                   UuidAndTitleCache<? extends CdmBase> element = (UuidAndTitleCache<? extends CdmBase>) firstElement;
+                   @SuppressWarnings("unchecked")
+            UuidAndTitleCache<? extends CdmBase> element = (UuidAndTitleCache<? extends CdmBase>) firstElement;
                    dto.typeName = CdmUtils.userFriendlyClassName(element.getType());
                    dto.itemLabel = element.getTitleCache();
             if (CdmUtils.isBlank(dto.itemLabel)){
index f0b383be6c31e9ff144df549b199033ed315fb9e..f04c2aed78f2ac7a1033561341f2c1b7132ec06e 100644 (file)
@@ -40,10 +40,10 @@ GROUP_CREATOR_Name_not_accepted=Groupname not accepted
 ReferencingObjectsLabelProvider_No_description_available=No description available
 ConvertPerson2TeamHandler_warning=While reloading the data an exception occurred
 ConvertPerson2TeamHandler_lable=Convert Person to Team
-DeleteHandler_CAN_BE_DELETED=can be deleted but related object(s) could not be deleted. 
+DeleteHandler_CAN_BE_DELETED= can be deleted but related object(s) could not be deleted. 
 DeleteHandler_CONFIRM=Confirm Deletion
-DeleteHandler_COULD_NOT_BE_DELETED=could not be deleted.
-DeleteHandler_ALREADY_DELETED=was already deleted
+DeleteHandler_COULD_NOT_BE_DELETED= could not be deleted.
+DeleteHandler_ALREADY_DELETED= was already deleted
 DeleteHandler_DELETE=Delete
 DeleteHandler_DELETE_NOT_POSSIBLE=Delete not possible
 DeleteHandler_EXCEPTION=An exception occurred.
index d4afdb783c010cfe0c8fe857fd4848d5ed6dae12..51ca720252207575ca79a4b3b1c1783b7cac2afe 100644 (file)
@@ -2,21 +2,26 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: CDM Library Dependencies Plugin
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Eclipse-BundleShape: dir
-Export-Package: com.sun.istack.internal.tools,
+Export-Package: com.fasterxml.jackson.core,
+ com.fasterxml.jackson.core.type,
+ com.fasterxml.jackson.databind,
+ com.fasterxml.jackson.databind.node,
+ com.sun.istack.internal.tools,
  com.sun.istack.internal.ws,
  eu.etaxonomy.cdm,
  eu.etaxonomy.cdm.api.application,
  eu.etaxonomy.cdm.api.cache,
  eu.etaxonomy.cdm.api.conversation,
- eu.etaxonomy.cdm.api.facade,
+ eu.etaxonomy.cdm.api.filter,
  eu.etaxonomy.cdm.api.remoting,
  eu.etaxonomy.cdm.api.service,
  eu.etaxonomy.cdm.api.service.config,
  eu.etaxonomy.cdm.api.service.description,
  eu.etaxonomy.cdm.api.service.dto,
  eu.etaxonomy.cdm.api.service.exception,
+ eu.etaxonomy.cdm.api.service.geo,
  eu.etaxonomy.cdm.api.service.l10n,
  eu.etaxonomy.cdm.api.service.longrunningService,
  eu.etaxonomy.cdm.api.service.lsid,
@@ -56,16 +61,19 @@ Export-Package: com.sun.istack.internal.tools,
  eu.etaxonomy.cdm.ext.occurrence.gbif,
  eu.etaxonomy.cdm.ext.openurl,
  eu.etaxonomy.cdm.ext.sru,
+ eu.etaxonomy.cdm.facade,
  eu.etaxonomy.cdm.filter,
  eu.etaxonomy.cdm.format,
  eu.etaxonomy.cdm.format.common,
  eu.etaxonomy.cdm.format.description,
+ eu.etaxonomy.cdm.format.description.distribution,
  eu.etaxonomy.cdm.format.taxon,
  eu.etaxonomy.cdm.hibernate,
  eu.etaxonomy.cdm.hibernate.search,
  eu.etaxonomy.cdm.io.api.application,
  eu.etaxonomy.cdm.io.berlinModel,
  eu.etaxonomy.cdm.io.cdmLight,
+ eu.etaxonomy.cdm.io.coldp,
  eu.etaxonomy.cdm.io.common,
  eu.etaxonomy.cdm.io.common.events,
  eu.etaxonomy.cdm.io.common.mapping,
@@ -87,7 +95,6 @@ Export-Package: com.sun.istack.internal.tools,
  eu.etaxonomy.cdm.io.markup,
  eu.etaxonomy.cdm.io.markup.handler,
  eu.etaxonomy.cdm.io.pilotOutputHtml,
- eu.etaxonomy.cdm.io.reference.endnote.in,
  eu.etaxonomy.cdm.io.reference.ris.in,
  eu.etaxonomy.cdm.io.sdd,
  eu.etaxonomy.cdm.io.sdd.ikeyplus,
@@ -96,12 +103,12 @@ Export-Package: com.sun.istack.internal.tools,
  eu.etaxonomy.cdm.io.service,
  eu.etaxonomy.cdm.io.specimen,
  eu.etaxonomy.cdm.io.specimen.abcd206.in,
- eu.etaxonomy.cdm.io.specimen.excel.in,
  eu.etaxonomy.cdm.io.specimen.gbif.in,
  eu.etaxonomy.cdm.io.taxonx,
  eu.etaxonomy.cdm.io.tcsxml,
  eu.etaxonomy.cdm.io.tcsxml.in,
  eu.etaxonomy.cdm.io.tcsxml.out,
+ eu.etaxonomy.cdm.io.wfo.out,
  eu.etaxonomy.cdm.jaxb,
  eu.etaxonomy.cdm.model,
  eu.etaxonomy.cdm.model.agent,
@@ -178,7 +185,6 @@ Export-Package: com.sun.istack.internal.tools,
  eu.etaxonomy.taxeditor.remoting.source,
  eu.etaxonomy.taxeditor.service,
  eu.etaxonomy.taxeditor.session,
- eu.etaxonomy.taxeditor.session.mock,
  jakarta.validation,
  javax.persistence,
  junit.framework;uses:="org.junit.runner.manipulation,org.junit.runner,org.junit.runner.notification",
@@ -188,6 +194,7 @@ Export-Package: com.sun.istack.internal.tools,
  net.sf.ehcache.store,
  net.sf.ehcache.util,
  org.aopalliance.aop,
+ org.apache.commons.collections4,
  org.apache.commons.collections4.map,
  org.apache.commons.dbcp,
  org.apache.commons.imaging,
@@ -253,7 +260,6 @@ Export-Package: com.sun.istack.internal.tools,
  org.joda.time.field;uses:="org.joda.time",
  org.joda.time.format;uses:="org.joda.time",
  org.joda.time.tz;uses:="org.joda.time",
- org.json,
  org.junit;uses:="org.hamcrest",
  org.junit.runner,
  org.slf4j,
@@ -347,21 +353,21 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.swt
 Bundle-ClassPath: .,
  lib/aspectjweaver-1.9.7.jar,
- lib/cdmlib-commons-5.33.0.jar,
- lib/cdmlib-ext-5.33.0.jar,
- lib/cdmlib-io-5.33.0.jar,
- lib/cdmlib-model-5.33.0.jar,
- lib/cdmlib-api-5.33.0.jar,
- lib/cdmlib-persistence-5.33.0.jar,
- lib/cdmlib-cache-5.33.0.jar,
- lib/cdmlib-services-5.33.0.jar,
+ lib/cdmlib-commons-5.42.0.jar,
+ lib/cdmlib-ext-5.42.0.jar,
+ lib/cdmlib-io-5.42.0.jar,
+ lib/cdmlib-model-5.42.0.jar,
+ lib/cdmlib-api-5.42.0.jar,
+ lib/cdmlib-persistence-5.42.0.jar,
+ lib/cdmlib-cache-5.42.0.jar,
+ lib/cdmlib-services-5.42.0.jar,
  lib/commons-codec-1.15.jar,
  lib/commons-collections4-4.4.jar,
  lib/commons-dbcp-1.4.jar,
  lib/commons-imaging-1.0-alpha3.jar,
  lib/commons-io-2.11.0.jar,
  lib/commons-lang3-3.12.0.jar,
- lib/commons-text-1.9.jar,
+ lib/commons-text-1.10.0.jar,
  lib/commons-lang-2.6.jar,
  lib/commons-pool-1.6.jar,
  lib/ehcache-2.10.6.jar,
@@ -370,6 +376,7 @@ Bundle-ClassPath: .,
  lib/hibernate-core-5.4.33.Final.jar,
  lib/hibernate-envers-5.4.33.Final.jar,
  lib/hibernate-validator-6.2.3.Final.jar,
+ lib/hibernate-search-engine-5.11.10.Final.jar,
  lib/byte-buddy-1.12.10.jar,
  lib/javax.persistence-api-2.2.jar,
  lib/jackson-annotations-2.13.3.jar,
@@ -379,9 +386,9 @@ Bundle-ClassPath: .,
  lib/jdom-1.1.3.jar,
  lib/joda-time-2.10.14.jar,
  lib/jcl-over-slf4j-1.7.36.jar,
- lib/log4j-api-2.18.0.jar,
- lib/log4j-core-2.18.0.jar,
- lib/log4j-slf4j-impl-2.18.0.jar,
+ lib/log4j-api-2.19.0.jar,
+ lib/log4j-core-2.19.0.jar,
+ lib/log4j-slf4j-impl-2.19.0.jar,
  lib/slf4j-api-1.7.36.jar,
  lib/lsid-client-1.1.2.jar,
  lib/spring-aop-4.3.30.RELEASE.jar,
@@ -393,14 +400,15 @@ Bundle-ClassPath: .,
  lib/spring-security-core-4.2.20.RELEASE.jar,
  lib/spring-tx-4.3.30.RELEASE.jar,
  lib/spring-web-4.3.30.RELEASE.jar,
+ lib/spring-orm-4.3.30.RELEASE.jar,
  lib/tools.jar,
  lib/jakarta.validation-api-3.0.2.jar,
+ lib/validation-api-2.0.1.Final.jar,
  lib/xml-apis-1.4.01.jar,
  lib/opencsv-2.3.jar,
  lib/junit-4.13.2.jar,
- lib/json-20220320.jar,
  lib/antlr-2.7.7.jar,
- lib/postgresql-42.3.6.jar,
+ lib/postgresql-42.5.1.jar,
  lib/lucene-core-5.5.5.jar,
  lib/lucene-queryparser-5.5.5.jar,
  lib/lucene-analyzers-common-5.5.5.jar,
index 45ed62ab109e1df382737003bbbee110a2268b65..7a0270b24b53c7000458a5d8d36823d3e9213938 100644 (file)
@@ -1,27 +1,28 @@
 bin.includes = META-INF/,\
                .,\
                lib/aspectjweaver-1.9.7.jar,\
-               lib/cdmlib-commons-5.33.0.jar,\
-               lib/cdmlib-ext-5.33.0.jar,\
-               lib/cdmlib-io-5.33.0.jar,\
-               lib/cdmlib-model-5.33.0.jar,\
-               lib/cdmlib-api-5.33.0.jar,\
-               lib/cdmlib-persistence-5.33.0.jar,\
-               lib/cdmlib-services-5.33.0.jar,\
-               lib/commons-codec-1.15.jar,\
+               lib/cdmlib-commons-5.42.0.jar,\
+               lib/cdmlib-ext-5.42.0.jar,\
+               lib/cdmlib-io-5.42.0.jar,\
+               lib/cdmlib-model-5.42.0.jar,\
+               lib/cdmlib-api-5.42.0.jar,\
+               lib/cdmlib-persistence-5.42.0.jar,\
+               lib/cdmlib-services-5.42.0.jar,\
                lib/commons-collections4-4.4.jar,\
+               lib/commons-codec-1.15.jar,\
                lib/commons-dbcp-1.4.jar,\
                lib/commons-io-2.11.0.jar,\
                lib/commons-lang-2.6.jar,\
                lib/commons-lang3-3.12.0.jar,\
                lib/commons-pool-1.6.jar,\
                lib/commons-math3-3.6.1.jar,\
-               lib/commons-text-1.9.jar,\
+               lib/commons-text-1.10.0.jar,\
                lib/commons-imaging-1.0-alpha3.jar,\
                lib/ehcache-2.10.6.jar,\
                lib/h2-1.4.190.jar,\
                lib/hibernate-core-5.4.33.Final.jar,\
                lib/hibernate-envers-5.4.33.Final.jar,\
+               lib/hibernate-search-engine-5.11.10.Final.jar,\
                lib/lucene-core-5.5.5.jar,\
                lib/byte-buddy-1.12.10.jar,\
                lib/antlr-2.7.7.jar,\
@@ -36,9 +37,9 @@ bin.includes = META-INF/,\
                lib/jboss-logging-3.4.3.Final.jar,\
                lib/jdom-1.1.3.jar,\
                lib/joda-time-2.10.14.jar,\
-               lib/log4j-api-2.18.0.jar,\
-               lib/log4j-core-2.18.0.jar,\
-               lib/log4j-slf4j-impl-2.18.0.jar,\
+               lib/log4j-api-2.19.0.jar,\
+               lib/log4j-core-2.19.0.jar,\
+               lib/log4j-slf4j-impl-2.19.0.jar,\
                           lib/slf4j-api-1.7.36.jar,\
                lib/lsid-client-1.1.2.jar,\
                lib/jcl-over-slf4j-1.7.36.jar,\
@@ -50,15 +51,16 @@ bin.includes = META-INF/,\
                lib/spring-security-core-4.2.20.RELEASE.jar,\
                lib/spring-tx-4.3.30.RELEASE.jar,\
                lib/spring-web-4.3.30.RELEASE.jar,\
+               lib/spring-orm-4.3.30.RELEASE.jar,\
                lib/tools.jar,\
                lib/jakarta.validation-api-3.0.2.jar,\
+               lib/validation-api-2.0.1.Final.jar,\
                lib/xml-apis-1.4.01.jar,\
                lib/opencsv-2.3.jar,\
                lib/junit-4.13.2.jar,\
-               lib/json-20220320.jar,\
-               lib/postgresql-42.3.6.jar,\
+               lib/postgresql-42.5.1.jar,\
                lib/mchange-commons-java-0.2.11.jar,\
-               lib/cdmlib-cache-5.33.0.jar,\
+               lib/cdmlib-cache-5.42.0.jar,\
                lib/org.swtchart_0.10.0.v20160212.jar,\
                lib/mysql-connector-java-8.0.29.jar,\
                lib/c3p0-0.9.5.2.jar,\
index f01862b1dc3689b61d8fe103df2d207859983cbe..0a583b8adb2b385bef23d0d73e63cfe35c70eb18 100644 (file)
@@ -4,7 +4,7 @@
   <parent>\r
     <groupId>eu.etaxonomy</groupId>\r
     <artifactId>taxeditor-parent</artifactId>\r
-    <version>5.33.0</version>\r
+    <version>5.42.0</version>\r
   </parent>\r
   <modelVersion>4.0.0</modelVersion>\r
   <artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
@@ -13,6 +13,7 @@
       <jackson.version>2.13.3</jackson.version>\r
       <poi.version>4.1.2</poi.version>\r
       <hibernate.version>5.4.33.Final</hibernate.version>\r
+      <hibernate-search.version>5.11.10.Final</hibernate-search.version>\r
       <lucene.version>5.5.5</lucene.version>\r
       <spring.version>4.3.30.RELEASE</spring.version>                         <!-- checked 2021-12, further upgrade possible -->\r
       <spring-security.version>4.2.20.RELEASE</spring-security.version>       <!-- checked 2021-12, further upgrade possible -->\r
               <includeArtifactIds>\r
                 httpclient,JavaAPIforKml,iiif-apis,commons-lang3,commons-lang,commons-text,\r
                 commons-codec,commons-io,\r
-                json,\r
                 log4j-core,log4j-api,slf4j-api,jboss-logging,jcl-over-slf4j,log4j-slf4j-impl,\r
                 lucene-analyzers-common,lucene-core,lucene-queryparser,lucene-suggest,lucene-sandbox,\r
                 commons-imaging,jackson-databind,jackson-annotations,jackson-core,\r
-                jakarta.validation-api,\r
+                jakarta.validation-api,validation-api,\r
                 ehcache,\r
                 hibernate-validator,\r
                 spring-context,spring-aspects,spring-beans,\r
                 spring-tx,spring-web,spring-core,spring-aop,\r
-                spring-jdbc,spring-security-core,\r
+                spring-jdbc,spring-orm,\r
+                spring-security-core,\r
                 aspectjweaver,\r
                 byte-buddy,\r
-                hibernate-core,hibernate-envers,antlr,\r
+                hibernate-core,hibernate-envers,hibernate-search-engine,\r
+                antlr,\r
                 javax.persistence-api,\r
                 xml-apis,lsid-client,jdom,\r
                 commons-collections4,commons-math3,\r
       <!-- used e.g. by CdmServerUtils -->\r
       <groupId>org.apache.commons</groupId>\r
       <artifactId>commons-text</artifactId>\r
-      <version>1.9</version>\r
+      <version>1.10.0</version>\r
     </dependency>\r
       <dependency>\r
       <!-- used in AuthenticatingHttpInvokerRequestExecutor -->\r
       <artifactId>httpcore</artifactId>\r
       <version>4.4.15</version>\r
     </dependency>\r
-    <dependency>\r
-      <!-- used e.g. by CdmServerInfo -->\r
+    <!--<dependency>\r
+     \r
       <groupId>org.json</groupId>\r
       <artifactId>json</artifactId>\r
       <version>20220320</version>\r
-    </dependency>\r
-    <dependency>\r
+    </dependency>-->\r
+      <dependency>\r
       <!-- used e.g. by CdmServerInfo -->\r
       <groupId>com.fasterxml.jackson.core</groupId>\r
       <artifactId>jackson-core</artifactId>\r
     \r
     <!-- used by bulkeditor -->\r
     <dependency>\r
-      <!-- used by CharacterMatrix/bulkeditor (LinkedList)  -->\r
+      <!-- used by CharacterMatrix/bulkeditor (LinkedList) and UpdateResult.exceptions (CircularFifoQueue)  -->\r
       <groupId>org.apache.commons</groupId>\r
       <artifactId>commons-collections4</artifactId>\r
       <version>4.4</version>\r
     </dependency>\r
-    \r
-    <!-- used by taxeditor.local -->\r
+        <!-- used by taxeditor.local -->\r
     <dependency>\r
       <!-- used by datasource dialogue finish button  -->\r
       <groupId>com.mchange</groupId>\r
     \r
     <!-- required during RUNTIME -->\r
     \r
+    <dependency>\r
+      <!-- for handling HibernateSystemException, see #10277, TODO try to handle without adding dependency  -->\r
+      <groupId>org.springframework</groupId>\r
+      <artifactId>spring-orm</artifactId>\r
+      <version>${spring.version}</version>\r
+    </dependency>\r
+  <dependency>\r
+      <!-- for handling BridgeException, see #10277, TODO try to handle without adding dependency  -->\r
+      <groupId>org.hibernate</groupId>\r
+      <artifactId>hibernate-search-engine</artifactId>\r
+      <version>${hibernate-search.version}</version>\r
+    </dependency>\r
     <dependency>\r
       <!-- throws exception in bulk editor after search if not present -->\r
       <groupId>org.hibernate</groupId>\r
         <version>2.2.1</version>\r
     </dependency>\r
     \r
+    <dependency>\r
+      <!-- used if a validation result is returned, see https://dev.e-taxonomy.eu/redmine/issues/10182#note-10  -->\r
+      <!-- can probably be removed after switching to jakarta.validation-api with spring 6.x -->\r
+      <groupId>javax.validation</groupId>\r
+      <artifactId>validation-api</artifactId>\r
+      <version>2.0.1.Final</version>\r
+    </dependency>\r
+    \r
     <dependency>\r
       <!-- used in datasource view and in test, maybe enough if in taxeditor.local and taxeditor.test -->\r
       <groupId>com.mchange</groupId>\r
     </dependency>\r
     \r
     <!-- database related, should be moved to local/test when possible -->\r
-    <!-- only for supporting test button in datasource dialogue, dialogue should be moved to taxeditor.webapp -->\r
+    <!-- only for supporting test button in datasource dialogue, dialogue should be moved to taxeditor.local -->\r
     <dependency>\r
       <groupId>mysql</groupId>\r
       <artifactId>mysql-connector-java</artifactId>\r
     <dependency>\r
         <groupId>org.postgresql</groupId>\r
         <artifactId>postgresql</artifactId>\r
-        <version>42.3.6</version>\r
+        <version>42.5.1</version>\r
     </dependency>\r
     \r
     <!-- Only added for correct package export, but reported as needed -->\r
index 131951b0f8da2a91265f25dd066617f6cd6ea537..a9eb78780ceef1b10126a203d869849a7bddf2bc 100644 (file)
@@ -15,10 +15,8 @@ import java.util.List;
 import java.util.Map;\r
 \r
 import org.apache.commons.lang3.StringUtils;\r
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;\r
-import org.springframework.beans.BeansException;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.context.ApplicationContextAware;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
 import org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean;\r
 import org.springframework.remoting.httpinvoker.HttpComponentsHttpInvokerRequestExecutor;\r
 import org.springframework.security.access.AccessDecisionVoter;\r
@@ -32,11 +30,7 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContext;\r
 import org.springframework.security.core.context.SecurityContextHolder;\r
 import org.springframework.stereotype.Component;\r
-import org.springframework.transaction.PlatformTransactionManager;\r
-import org.springframework.transaction.TransactionStatus;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolderMock;\r
 import eu.etaxonomy.cdm.api.service.IAgentService;\r
 import eu.etaxonomy.cdm.api.service.IAnnotationService;\r
 import eu.etaxonomy.cdm.api.service.IClassificationService;\r
@@ -66,17 +60,20 @@ import eu.etaxonomy.cdm.api.service.IRegistrationService;
 import eu.etaxonomy.cdm.api.service.IRightsService;\r
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;\r
 import eu.etaxonomy.cdm.api.service.ITaxonService;\r
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;\r
 import eu.etaxonomy.cdm.api.service.ITermNodeService;\r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.api.service.ITermTreeService;\r
 import eu.etaxonomy.cdm.api.service.ITestService;\r
 import eu.etaxonomy.cdm.api.service.IUserService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.api.service.geo.IDistributionService;\r
 import eu.etaxonomy.cdm.api.service.longrunningService.ILongRunningTasksService;\r
 import eu.etaxonomy.cdm.api.service.media.MediaInfoFactory;\r
 import eu.etaxonomy.cdm.api.service.molecular.IAmplificationService;\r
 import eu.etaxonomy.cdm.api.service.molecular.IPrimerService;\r
 import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;\r
+import eu.etaxonomy.cdm.api.service.registration.IRegistrationWorkingSetService;\r
 import eu.etaxonomy.cdm.api.service.security.IAccountRegistrationService;\r
 import eu.etaxonomy.cdm.api.service.security.IPasswordResetService;\r
 import eu.etaxonomy.cdm.ext.geo.IEditGeoService;\r
@@ -104,10 +101,10 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
  */\r
 @Component\r
 // TODO split into CdmRepository and proper @Configuration class\r
-public class CdmApplicationRemoteConfiguration implements ICdmRepository, ApplicationContextAware  {\r
+public class CdmApplicationRemoteConfiguration implements ICdmRepository {\r
 \r
     @SuppressWarnings("unused")\r
-    private static final Logger logger = LogManager.getLogger(CdmApplicationRemoteConfiguration.class);\r
+    private static final Logger logger = LogManager.getLogger();\r
 \r
     /**\r
      * Timeout for service lookup etc. This timeout (milliseconds) should be more\r
@@ -134,8 +131,6 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
      */\r
     public static final int HTTP_READ_TIMEOUT = 10 * 60 * 1000;\r
 \r
-    protected ApplicationContext applicationContext;\r
-\r
     private ICdmRemoteSource remoteSource;\r
 \r
     //TODO should be something like Map<Class<IService>, IService>, but we have no common service base interface yet\r
@@ -205,16 +200,6 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
 \r
     // ****************************** APPLICATION CONTEXT *************************************************/\r
 \r
-    @Override\r
-    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException{\r
-        this.applicationContext = applicationContext;\r
-    }\r
-\r
-    @Override\r
-    public PlatformTransactionManager getTransactionManager() throws UnsupportedOperationException {\r
-        throw new UnsupportedOperationException("getTransactionManager is not implemented for CdmApplicationRemoteConfiguration");\r
-    }\r
-\r
     public IEditGeoService getEditGeoService() {\r
         return (IEditGeoService) getService(IEditGeoService.class, "/remoting/editgeo.service", new AuthenticatingHttpInvokerRequestExecutor());\r
     }\r
@@ -235,11 +220,6 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
 \r
  // ****************************** GETTER *************************************************/\r
 \r
-    @Override\r
-    public final Object getBean(String name){\r
-        throw new UnsupportedOperationException("getBean is not implemented for CdmApplicationRemoteConfiguration");\r
-    }\r
-\r
     @Override\r
     public IAccountRegistrationService getAccountRegistrationService() {\r
         return (IAccountRegistrationService) getService(IAccountRegistrationService.class, "/remoting/accountregistrationservice.service", new AuthenticatingHttpInvokerRequestExecutor());\r
@@ -290,6 +270,11 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
         return (IDescriptionService) getService(IDescriptionService.class, "/remoting/description.service", new AuthenticatingHttpInvokerRequestExecutor());\r
     }\r
 \r
+    @Override\r
+    public IDistributionService getDistributionService(){\r
+        return (IDistributionService) getService(IDistributionService.class, "/remoting/distribution.service", new AuthenticatingHttpInvokerRequestExecutor());\r
+    }\r
+\r
     @Override\r
     public IDescriptionElementService getDescriptionElementService(){\r
         return (IDescriptionElementService) getService(IDescriptionElementService.class, "/remoting/descriptionelement.service", new AuthenticatingHttpInvokerRequestExecutor());\r
@@ -389,12 +374,6 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
         return new ProviderManager(Arrays.asList((AuthenticationProvider)daoAuthenticationProvider));\r
     }\r
 \r
-\r
-    @Override\r
-    public ConversationHolder NewConversation() {\r
-        return new ConversationHolderMock();\r
-    }\r
-\r
     @Override\r
     public ICollectionService getCollectionService(){\r
         return (ICollectionService) getService(ICollectionService.class, "/remoting/collection.service", new AuthenticatingHttpInvokerRequestExecutor());\r
@@ -405,6 +384,11 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
        return (ITermTreeService) getService(ITermTreeService.class, "/remoting/termtree.service", new AuthenticatingHttpInvokerRequestExecutor());\r
     }\r
 \r
+    @Override\r
+    public ITermCollectionService getTermCollectionService() {\r
+        return (ITermCollectionService) getService(ITermCollectionService.class, "/remoting/termcollection.service", new AuthenticatingHttpInvokerRequestExecutor());\r
+    }\r
+\r
        @Override\r
        public ITermNodeService getTermNodeService() {\r
         return (ITermNodeService) getService(ITermNodeService.class, "/remoting/termnode.service", new AuthenticatingHttpInvokerRequestExecutor());\r
@@ -445,6 +429,11 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
         return (IRegistrationService) getService(IRegistrationService.class, "/remoting/registration.service", new AuthenticatingHttpInvokerRequestExecutor());\r
     }\r
 \r
+    @Override\r
+    public IRegistrationWorkingSetService getRegistrationWorkingSetService() {\r
+        return (IRegistrationWorkingSetService) getService(IRegistrationWorkingSetService.class, "/remoting/registrationworkingset.service", new AuthenticatingHttpInvokerRequestExecutor());\r
+    }\r
+\r
     @Override\r
     public IGroupService getGroupService(){\r
         return (IGroupService) getService(IGroupService.class, "/remoting/group.service", new AuthenticatingHttpInvokerRequestExecutor());\r
@@ -495,26 +484,6 @@ public class CdmApplicationRemoteConfiguration implements ICdmRepository, Applic
         return cdmPermissionEvaluator;\r
     }\r
 \r
-    @Override\r
-    public TransactionStatus startTransaction() throws UnsupportedOperationException {\r
-        throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-    }\r
-\r
-    @Override\r
-    public TransactionStatus startTransaction(Boolean readOnly) throws UnsupportedOperationException {\r
-        throw new UnsupportedOperationException("startTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-    }\r
-\r
-    @Override\r
-    public void commitTransaction(TransactionStatus txStatus) throws UnsupportedOperationException {\r
-        throw new UnsupportedOperationException("commitTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-    }\r
-\r
-       @Override\r
-       public void rollbackTransaction(TransactionStatus arg0) {\r
-        throw new UnsupportedOperationException("rollbackTransaction is not implemented for CdmApplicationRemoteConfiguration");\r
-       }\r
-\r
     @Override\r
     public void authenticate(String username, String password){\r
         UsernamePasswordAuthenticationToken tokenForUser = new UsernamePasswordAuthenticationToken(username, password);\r
index 40f2d4a7b805ab74464d46ffb9877bd42fa65b4d..0e8f73759e3ea17f96ee2878874d632624310c23 100644 (file)
@@ -10,7 +10,8 @@ package eu.etaxonomy.cdm.api.application;
 
 import java.util.List;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.collection.internal.AbstractPersistentCollection;
 import org.hibernate.proxy.AbstractLazyInitializer;
 import org.springframework.context.ApplicationListener;
@@ -29,14 +30,11 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
 
 /**
  * CDM Application Controller class for remoting clients
- *
- * FIXME:Remoting extending {@link CdmApplicationController} is a temporary workaround.
- * The {@link CdmApplicationController} should be split into a CdmApplicationControllerBase
- * class with {@link CdmApplicationController} and this class as subclasses
  */
-public class CdmApplicationRemoteController  extends CdmApplicationController {
+public class CdmApplicationRemoteController
+        extends CdmApplicationControllerBase<ICdmRepository> {
 
-    private static final Logger logger = LogManager.getLogger(CdmApplicationRemoteController.class);
+    private static final Logger logger = LogManager.getLogger();
 
     public static final Resource DEFAULT_REMOTE_APPLICATION_CONTEXT_RESOURCE =
             new ClassPathResource("/eu/etaxonomy/cdm/remotingApplicationContext.xml");
@@ -58,13 +56,6 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
 
     /**
      * Creates new instance of CdmApplicationRemoteController
-     *
-     * @param applicationContextResource
-     * @param remoteSource
-     * @param omitTermLoading
-     * @param progressMonitor
-     * @param listeners
-     * @return
      */
     public static CdmApplicationRemoteController NewInstance(ICdmRemoteSource remoteSource,
             IProgressMonitor progressMonitor,
@@ -91,12 +82,6 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
 
     /**
      * Constructs CdmApplicationRemoteController
-     *
-     * @param applicationContextResource
-     * @param remoteSource
-     * @param omitTermLoading
-     * @param progressMonitor
-     * @param listeners
      */
     private CdmApplicationRemoteController(Resource applicationContextResource,
             ICdmRemoteSource remoteSource,
@@ -131,7 +116,7 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
         progressMonitor.beginTask("Connecting to '" + remoteSource.getName() + "'", nTasks);
 
         progressMonitor.subTask("Initialising CDM Model Cache ...");
-        CdmRemoteCacheManager.getInstance();
+        CdmRemoteCacheManager.INSTANCE();
         CdmRemoteCacheManager.removeEntityCaches();
         progressMonitor.worked(1);
         progressMonitor.subTask("Starting application context ...");
@@ -144,7 +129,6 @@ public class CdmApplicationRemoteController  extends CdmApplicationController {
     @Override
     protected void init(){
         configuration = new CdmApplicationRemoteConfiguration(remoteSource);
-        ((CdmApplicationRemoteConfiguration)configuration).setApplicationContext(applicationContext);
         AbstractLazyInitializer.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
         AbstractPersistentCollection.setConfiguration((CdmApplicationRemoteConfiguration)configuration);
     }
index b8754d1cf69b3679983fd05926b5963bb4ed561a..20a2a65a352dfd3a83086fb493214250458221d2 100644 (file)
@@ -13,7 +13,6 @@ import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
-import eu.etaxonomy.cdm.common.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Dictionary;
@@ -29,11 +28,12 @@ import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
 import org.springframework.security.core.context.SecurityContext;
 
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.ICommonService;
 import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.api.service.ITestService;
 import eu.etaxonomy.cdm.api.service.longrunningService.ILongRunningTasksService;
+import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.taxeditor.service.ICachedCommonService;
@@ -47,14 +47,14 @@ public class CdmApplicationState {
 
     private static CdmApplicationState cdmApplicationState;
 
-    private ICdmRepository appConfig;
+    private CdmApplicationRemoteController appConfig;
 
     private ICdmDataChangeService dataChangeService;
 
     //FIXME SecurityContextHolder.getContext()
     private SecurityContext securityContext;
 
-    private static CdmServiceCacher cdmServiceCacher;
+    private static CdmServiceCachingProxy termProxy;
 
     private static String cdmlibVersion = null;
     private static String cdmlibLastModified = null;
@@ -66,24 +66,20 @@ public class CdmApplicationState {
         return cdmApplicationState;
     }
 
-    public void setAppConfig(ICdmRepository appConfig) {
+    public void setAppConfig(CdmApplicationRemoteController appConfig) {
         this.appConfig = appConfig;
-        if(appConfig instanceof CdmApplicationRemoteController) {
-            CdmBase.setNewEntityListener(new DefaultNewEntityListener());
-        } else {
-            CdmBase.setNewEntityListener(null);
-        }
+        CdmBase.setNewEntityListener(new DefaultNewEntityListener());
     }
 
-    public ICdmRepository getAppConfig() {
+    public CdmApplicationRemoteController getAppConfig() {
         return appConfig;
     }
 
-    public static void setCurrentAppConfig(ICdmRepository appConfig) {
+    public static void setCurrentAppConfig(CdmApplicationRemoteController appConfig) {
         getInstance().setAppConfig(appConfig);
     }
 
-    public static ICdmRepository getCurrentAppConfig() {
+    public static CdmApplicationRemoteController getCurrentAppConfig() {
         return getInstance().getAppConfig();
     }
 
@@ -121,7 +117,7 @@ public class CdmApplicationState {
         getInstance().setAppConfig(null);
         getInstance().setSecurityContext(null);
         cdmApplicationState = null;
-        cdmServiceCacher = null;
+        termProxy = null;
         cdmlibVersion = null;
         cdmlibLastModified = null;
     }
@@ -189,12 +185,12 @@ public class CdmApplicationState {
         return ((CdmApplicationRemoteController)configuration).getCachedCommonService();
     }
 
-    public static CdmServiceCacher getCdmServiceCacher() {
-        return cdmServiceCacher;
+    public static CdmServiceCachingProxy getTermProxy() {
+        return termProxy;
     }
 
-    public static void setCdmServiceCacher(CdmServiceCacher cacher) {
-        cdmServiceCacher = cacher;
+    public static void setTermProxy(CdmServiceCachingProxy cacher) {
+        termProxy = cacher;
     }
 
     public static void updateCdmlibManifestInfo() {
@@ -212,9 +208,10 @@ public class CdmApplicationState {
                 if(jar.startsWith(cdmlibPathPrefix) && jar.endsWith(jarSuffix)) {
                     URL fileURL = bundle.getEntry(jar);
                     File file = null;
+                    String urlString = null;
                     try {
-                        String urlString = FileLocator.resolve(fileURL).toExternalForm().replace(" ", "%20");
-                        
+                       urlString = FileLocator.resolve(fileURL).toExternalForm().replace(" ", "%20");
+
                         file = new File(new URI(urlString).getJavaUri());
                         JarFile jarFile = new JarFile(file);
                         Manifest manifest = jarFile.getManifest();
@@ -235,7 +232,7 @@ public class CdmApplicationState {
                     } catch (IOException ioe) {
                         throw new IllegalStateException(ioe);
                     } catch (IllegalArgumentException iae) {
-                       String message = iae.getMessage().concat("uri" + jar);
+                       String message = iae.getMessage().concat("uri " + jar + "\n " + urlString);
                        throw new IllegalStateException(message);
                        }
                 }
similarity index 78%
rename from eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java
rename to eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCachingProxy.java
index 9db7391fd491b3155e7203392662c8edca00d8ea..4a4c634fbec329546e10f48990d7ef56f1927a6d 100644 (file)
@@ -11,6 +11,8 @@ package eu.etaxonomy.cdm.api.cache;
 import java.io.File;
 import java.util.UUID;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
@@ -28,9 +30,11 @@ import eu.etaxonomy.taxeditor.session.CdmEntitySession;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
+import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.config.CacheConfiguration;
 import net.sf.ehcache.config.DiskStoreConfiguration;
 import net.sf.ehcache.config.SizeOfPolicyConfiguration;
+import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
 
 /**
  * Class which uses CDM services to cache cdm entities
@@ -38,10 +42,15 @@ import net.sf.ehcache.config.SizeOfPolicyConfiguration;
  * FIXME: Currently only handles term entities. It would be
  *        interesting to have a generic method which finds the
  *        correct service to load / cache the entity.
+ * TODO by AM: compare with {@link CdmTermCacher} and merge if possible
  *
  * @author cmathew
  */
-public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySessionManagerObserver {
+public class CdmServiceCachingProxy
+        extends CdmPermanentCacheBase
+        implements ICdmEntitySessionManagerObserver {
+
+    private static final Logger logger = LogManager.getLogger();
 
     private ICdmEntitySessionManager cdmEntitySessionManager;
 
@@ -49,9 +58,14 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
 
     private CacheLoader cacheLoader;
 
+    //NOTE AM: this is currently not used
     @Autowired
     private ConfigFileUtil configFileUtil = null;
 
+    public CdmServiceCachingProxy() {
+        super();
+    }
+
     @Override
     protected void setup() {
 
@@ -59,16 +73,15 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
 
         DefinedTermBase.setCacher(this);
         CdmTransientEntityCacher.setPermanentCacher(this);
-        //TermServiceRequestExecutor.setDefaultCacher(this);
         RemoteInvocationTermCacher.setDefaultCacher(this);
 
         cacheLoader = new CacheLoader(this);
     }
 
+    //FIXME #10218 setting up the cache manager here probably has no effect
+    //      as described in #10214
     private void setUpCacheManager() {
 
-        EhCacheConfiguration cacheConfig = new EhCacheConfiguration();
-
         DiskStoreConfiguration diskStoreConfiguration = new DiskStoreConfiguration();
         File ehcacheFolder = null;
         if(configFileUtil != null){
@@ -82,29 +95,38 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
             ehcacheFolder = ConfigFileUtil.getCdmHomeSubDirFallback("taxeditor-ehcache");
         }
 
-        // FIXME use subfolder per taxeditor version to allow running multiple installations in parallel
+        // FIXME use subfolder per taxeditor version to allow running multiple
+        //   installations in parallel
         // String taxEditorVersion = ..;
         // File ehcacheFolder = new File(ehcacheFolder, taxEditorVersion);
         diskStoreConfiguration.setPath(ehcacheFolder.getAbsolutePath());
 
+        EhCacheConfiguration cacheConfig = new EhCacheConfiguration();
         cacheConfig.setDiskStoreConfiguration(diskStoreConfiguration);
-        addCacheManager(cacheConfig.cacheManager());
+
+        CacheManager cacheManager = cacheConfig.cacheManager();
+        setCacheManager(cacheManager);
     }
 
     @Override
-    protected CacheConfiguration getDefaultCacheConfiguration() {
+    protected CacheConfiguration getPermanentCacheConfiguration() {
+
         // For a better understanding on how to size caches, refer to
-        // http://ehcache.org/documentation/configuration/cache-size
+        // https://www.ehcache.org/documentation/2.8/configuration/cache-size.html
 
+        //probably size of policy configuration is not really needed here
         SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
         sizeOfConfig.setMaxDepth(100);
         sizeOfConfig.setMaxDepthExceededBehavior("abort");
 
-        return new CacheConfiguration(DEFAULT_CACHE_NAME, 0)
-               .eternal(true)
-               .statistics(true)
-               .sizeOfPolicy(sizeOfConfig)
-               .overflowToOffHeap(false);
+        CacheConfiguration config = new CacheConfiguration(PERMANENT_CACHE_NAME, 1000)
+                .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
+                .eternal(false)
+                .sizeOfPolicy(sizeOfConfig)
+                // default ttl and tti set to 1 hour and 20 min
+                .timeToLiveSeconds(60*60*1)
+                .timeToIdleSeconds(60*20);
+        return config;
     }
 
     @Override
@@ -113,6 +135,9 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
         return load(term);
     }
 
+    /**
+     * <code>true</code> if the parameter is a term or a representation
+     */
     @Override
     public boolean isCachable(CdmBase cdmEntity) {
        if(cdmEntity == null){
@@ -145,7 +170,7 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
         // first we check in the active session cache if the
         // entity has been loaded there
         // FIXME:Remoting do we really need the cdmTransientEntityCacher
-        // here. Is it not guaranteed that all every entity which 'isCachable'
+        // here. Is it not guaranteed that every entity which 'isCachable'
         // by this cacher is cached only in this cacher ?
         if(!isCachable(cdmBase) && cdmTransientEntityCacher != null) {
             CdmEntityCacheKey<T> key = CdmTransientEntityCacher.generateKey(cdmBase);
@@ -163,7 +188,7 @@ public class CdmServiceCacher extends CdmCacherBase implements ICdmEntitySession
         T cachedCdmEntity = (T)getFromCache(cdmEntity.getUuid());
 
         if(isCachable(cdmEntity) && cachedCdmEntity == null) {
-            cachedCdmEntity =  cacheLoader.load(cdmEntity, false, true);
+            cachedCdmEntity = cacheLoader.load(cdmEntity, false, true);
         }
         return cachedCdmEntity;
     }
index a35c257b0c90566d6af899941374f28365462a5c..00d1cd49252089cea576b5cae0dc1ca1729e2c99 100644 (file)
@@ -94,7 +94,6 @@ public class CdmLazyLoader {
 
        /**
         *  'Around' advice for the initialization of Collection objects
-        *
         */
        @Around(value = "possibleCollectionLazyInitializationException()")
        public Object preloadCollectionOnDemand(ProceedingJoinPoint pjp) throws Throwable {
index 12b6f6089e2461a362be0f1efbc56222b9330001..c84dc28515000149e55dc6cb3a115465f5a738a0 100644 (file)
@@ -9,19 +9,27 @@
 package eu.etaxonomy.taxeditor.remoting;
 
 /**
+ * Singleton/static class to log the last httpInvoker
+ * request and response metadata.
+ * This is currently static to be easily accessible by MessagingUtils.
+ *
+ * Note: does not work clean in a  multi-thread environment yet.
+ *
  * @author a.kohlbecker
  * @since Jan 17, 2020
  */
 public class RemoteExecutionTimestampsUtil {
 
-    protected static String lastRequestClientTime = null;
+    private static String lastRequestClientTime = null;
 
-    protected static String lastResponseHeaderTime = null;
+    private static String lastResponseHeaderTime = null;
 
-    protected static String lastServiceMethod = null;
+    private static String lastService = null;
+
+    private static String lastMethod = null;
 
-    public RemoteExecutionTimestampsUtil() {
 
+    public RemoteExecutionTimestampsUtil() {
     }
 
     static public String getLastRequestClientTime() {
@@ -40,11 +48,19 @@ public class RemoteExecutionTimestampsUtil {
         lastResponseHeaderTime = time;
     }
 
-    static public String getLastServiceMethod() {
-        return lastServiceMethod;
+    static public String getLastService() {
+        return lastService;
+    }
+
+    static public void setLastService(String lastService) {
+        RemoteExecutionTimestampsUtil.lastService = lastService;
+    }
+
+    static public String getLastMethod() {
+        return lastMethod;
     }
 
-    static public void setLastServiceMethod(String lastMethod) {
-        lastServiceMethod = lastMethod;
+    static public void setLastMethod(String lastMethod) {
+        RemoteExecutionTimestampsUtil.lastMethod = lastMethod;
     }
 }
index a968ea4f50377f0fc87586aa42eca6a9cf8d50a6..98c51e032aa8d632480d14a499ce2286039ee273 100644 (file)
@@ -15,6 +15,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -29,13 +30,14 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.util.EntityUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
@@ -63,6 +65,9 @@ public class CdmServerInfo {
 
     private final static String NAME_DEMO_1 = "demo I";
     private final static String SERVER_DEMO_1 = "160.45.63.230";
+    private final static String NAME_DEMO_2 = "demo II";
+    private final static String SERVER_DEMO_2 = "160.45.63.231";
+
 
     public final static String SERVER_LOCALHOST = "localhost";
     private final static String NAME_LOCALHOST = "localhost";
@@ -136,8 +141,6 @@ public class CdmServerInfo {
         } else {
             addInstancesViaHttp();
         }
-
-
         Collections.sort(instances, new Comparator<CdmInstanceInfo>() {
             @Override
             public int compare(CdmInstanceInfo cii1, CdmInstanceInfo cii2){
@@ -151,13 +154,21 @@ public class CdmServerInfo {
         String url = guessProtocol() + "://" + server + ":" + String.valueOf(port) + "/" + prefix + "info.jsp";
         String responseBody = getResponse(url);
         if(responseBody != null) {
+            JsonNode tree = null;
+            ObjectMapper mapper = new ObjectMapper();
+            JsonNode resultNode = null;
             try {
-                JSONObject info = new JSONObject(responseBody);
-                cdmlibServicesVersion =  info.getString("cdmlibServicesVersion");
-                cdmlibServicesLastModified = info.getString("cdmlibServicesLastModified");
-            } catch (JSONException e) {
-                throw new CdmServerException(e);
+                tree =  mapper.readTree(responseBody);
+
+            if (tree != null) {
+                cdmlibServicesVersion =  tree.get("cdmlibServicesVersion").textValue();
+                cdmlibServicesLastModified = tree.get("cdmlibServicesLastModified").textValue();
+            }
+            } catch (JsonProcessingException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
             }
+
         }
     }
 
@@ -171,24 +182,34 @@ public class CdmServerInfo {
         String responseBody = getResponse(url);
         if(responseBody != null) {
             try {
-                JSONArray array = new JSONArray(responseBody);
-                for(int i=0;i<array.length();i++) {
-                    JSONObject instance = (JSONObject)array.get(i);
-                    if(instance != null) {
-                        JSONObject conf = (JSONObject)instance.get("configuration");
-                        if(conf != null) {
-                            String instanceName = conf.getString("instanceName");
-                            // we need to remove the first (char) forward slash from
-                            // the base path
-                            String basePath = conf.getString("basePath").substring(1);
-                            addInstance(instanceName, basePath);
-                            logger.info("Added instance with name : " + instanceName + ", basePath : " + basePath);
+                JsonNode tree = null;
+                ObjectMapper mapper = new ObjectMapper();
+                JsonNode resultNode = null;
+
+                tree =  mapper.readTree(responseBody);
+                if (tree != null) {
+                    for(int i=0;i<tree.size();i++) {
+                        JsonNode instance = tree.get(i);
+                        if(instance != null) {
+                            JsonNode conf = instance.get("configuration");
+                            if(conf != null) {
+                                String instanceName = conf.get("instanceName").textValue();
+                                // we need to remove the first (char) forward slash from
+                                // the base path
+                                String basePath = conf.get("basePath").textValue().substring(1);
+                                addInstance(instanceName, basePath);
+                                logger.info("Added instance with name : " + instanceName + ", basePath : " + basePath);
+                            }
                         }
                     }
                 }
-            } catch (JSONException e) {
-                throw new CdmServerException(e);
+            } catch (JsonProcessingException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
             }
+
+
+
         }
     }
 
@@ -404,7 +425,7 @@ public class CdmServerInfo {
         return serverInfoList;
     }
 
-    protected static List<CdmServerInfoConfig>  loadFromConfigFile(File file) {
+    public static List<CdmServerInfoConfig>  loadFromConfigFile(File file) {
 
         List<CdmServerInfoConfig> serverList = null;
 
@@ -431,11 +452,27 @@ public class CdmServerInfo {
         return serverList;
     }
 
+    public static boolean saveToConfigFile(Collection<CdmServerInfoConfig> serverList, File file) {
+
+       ObjectMapper mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT);;
+       try {
+          mapper.writeValue(file, serverList);
+
+
+       } catch (IOException e) {
+               throw new RuntimeException(e);
+       }
+
+        return true;
+    }
+
+
     private static List<CdmServerInfoConfig> createDefaultServerConfigList() {
 
         List<CdmServerInfoConfig> serverInfoList = new ArrayList<>();
         serverInfoList.add(new CdmServerInfoConfig(NAME_PRODUCTION, SERVER_PRODUCTION, 443, "", false));
         serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_1, SERVER_DEMO_1, 80, CDMSERVER_PREFIX, false));
+        serverInfoList.add(new CdmServerInfoConfig(NAME_DEMO_2, SERVER_DEMO_2, 80, CDMSERVER_PREFIX, false));
         serverInfoList.add(new CdmServerInfoConfig(NAME_LOCALHOST, SERVER_LOCALHOST, 8080, CDMSERVER_PREFIX, true));
         return serverInfoList;
     }
index 06abdd824282c7166a857140e2c5b078c1c63867..ef58e0093e326e905eb5e038f9a091e249481d41 100644 (file)
@@ -16,7 +16,7 @@ public class CdmServerInfoConfig {
 
     private String name;
     private String server;
-    private int port;
+    private Integer port;
     private String prefix;
     private boolean ignoreCdmLibVersion;
 
@@ -28,10 +28,16 @@ public class CdmServerInfoConfig {
         this.ignoreCdmLibVersion = ignoreCdmLibVersion;
     }
 
-    public CdmServerInfoConfig() {
-
+    public CdmServerInfoConfig(String name) {
+        this.name = name;
+        this.server = "";
+        this.port = null;
+        this.prefix = "";
+        this.ignoreCdmLibVersion = false;
     }
-
+    public CdmServerInfoConfig() {        
+    }
+    
     public String getName() {
         return name;
     }
@@ -48,11 +54,11 @@ public class CdmServerInfoConfig {
         this.server = server;
     }
 
-    public int getPort() {
+    public Integer getPort() {
         return port;
     }
 
-    public void setPort(int port) {
+    public void setPort(Integer port) {
         this.port = port;
     }
 
index 4c119c3dcdda3120ad06ba0f0f9d699a7cd9ba2a..fb51660cb7e26cbb98a9ca2159ca5749ca937ada 100644 (file)
@@ -13,7 +13,6 @@ import java.util.UUID;
 
 import org.springframework.stereotype.Component;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
@@ -47,7 +46,7 @@ public class CachedCommonServiceImpl implements ICachedCommonService {
     private List<String> getPropertyPaths(Object obj) {
         List<String> propertyPaths = null;
         ICdmEntitySession cdmEntitySession =
-                ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
+                CdmApplicationState.getCurrentAppConfig().getCdmEntitySessionManager().getActiveSession();
         if(cdmEntitySession != null) {
             propertyPaths = cdmEntitySession.getPropertyPaths(obj);
         }
@@ -83,5 +82,4 @@ public class CachedCommonServiceImpl implements ICachedCommonService {
     public boolean containsValue(UUID ownerUuid, String fieldName, Object element) {
         return  CdmApplicationState.getCurrentAppConfig().getCommonService().containsValue(ownerUuid, fieldName, element);
     }
-
-}
+}
\ No newline at end of file
index d1bf78cd23bc520c488ea9e2f283b321e5cb86bd..dd0f447c8a061f3d970942c1556eb1b32d2cde12 100644 (file)
@@ -19,7 +19,7 @@ import org.apache.logging.log4j.Logger;
 import org.springframework.remoting.support.RemoteInvocation;
 import org.springframework.remoting.support.RemoteInvocationResult;
 
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 
@@ -30,19 +30,19 @@ import eu.etaxonomy.cdm.model.term.TermType;
  */
 public class RemoteInvocationTermCacher implements IRemoteInvocationTermCacher {
 
-    private static final Logger logger = LogManager.getLogger(RemoteInvocationTermCacher.class);
+    private static final Logger logger = LogManager.getLogger();
 
        private static Map<TermType, RemoteInvocationResult> termTypeMap = new HashMap<>();
 
-       private static CdmServiceCacher cdmServiceCacher;
+       private static CdmServiceCachingProxy termCachingProxy;
 
-       public static void setDefaultCacher(CdmServiceCacher csc) {
-        cdmServiceCacher = csc;
+       public static void setDefaultCacher(CdmServiceCachingProxy termCache) {
+        termCachingProxy = termCache;
     }
 
        @Override
        public void cacheTerms(RemoteInvocation remoteInvoc, RemoteInvocationResult remoteInvocResul) {
-           if(cdmServiceCacher != null) {
+           if(termCachingProxy != null) {
                if(remoteInvoc.getMethodName().equals("listByTermType")) {
                    if(remoteInvoc.getArguments()[1] == null) {
                        Set<DefinedTermBase<?>> terms = new HashSet<>();
@@ -50,7 +50,7 @@ public class RemoteInvocationTermCacher implements IRemoteInvocationTermCacher {
                            terms.addAll((List<DefinedTermBase<?>>)remoteInvocResul.getValue());
 
                            for(DefinedTermBase<?> term : terms) {
-                               cdmServiceCacher.load(term);
+                               termCachingProxy.load(term);
                            }
                            termTypeMap.put((TermType)remoteInvoc.getArguments()[0], remoteInvocResul);
                        }
@@ -62,7 +62,7 @@ public class RemoteInvocationTermCacher implements IRemoteInvocationTermCacher {
        }
 
        @Override
-       public  RemoteInvocationResult termsFromCache(RemoteInvocation ri) {
-               return termTypeMap.get(ri.getArguments()[0]);
+       public  RemoteInvocationResult termsFromCache(RemoteInvocation remoteInvocation) {
+               return termTypeMap.get(remoteInvocation.getArguments()[0]);
        }
 }
\ No newline at end of file
index 44c085fedbe0eb416a1aab4f80f83f01b8637bd8..bfd2169d8a53d812b4878abdeb1f1daededa024d 100644 (file)
@@ -66,11 +66,11 @@ public class TimestampingHttpInvokerRequestExecutor extends HttpComponentsHttpIn
 
         setExecutionRequestClientTimestamp(httpPost.getURI());
 
-        HttpResponse respone = super.executeHttpPost(config, httpClient, httpPost);
+        HttpResponse response = super.executeHttpPost(config, httpClient, httpPost);
 
-        setExecutionResponseHttpHeaderTimestamp(respone);
+        setExecutionResponseHttpHeaderTimestamp(response);
 
-        return respone;
+        return response;
     }
 
     private void setExecutionRequestClientTimestamp(URI requestURI){
@@ -79,7 +79,7 @@ public class TimestampingHttpInvokerRequestExecutor extends HttpComponentsHttpIn
         String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
         RemoteExecutionTimestampsUtil.setLastRequestClientTime(dateTimeStr);
         if(requestURI != null){
-            RemoteExecutionTimestampsUtil.setLastServiceMethod(requestURI.toString());
+            RemoteExecutionTimestampsUtil.setLastService(requestURI.toString());
         }
     }
 
index b3cc56ab767194c3e3f8c7985dfa97b3508b13e3..5fd23d5a653ade11b2316ed3b973efb9aee6a8ac 100644 (file)
@@ -15,7 +15,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
@@ -38,23 +39,23 @@ import net.sf.ehcache.statistics.FlatStatistics;
  */
 public class CdmEntitySession implements ICdmEntitySession  {
 
-    private static final Logger logger = LogManager.getLogger(CdmEntitySession.class);
+    private static final Logger logger = LogManager.getLogger();
 
     private final CdmEntitySessionManager cdmEntitySessionManager;
 
-    private final ICdmEntitySessionEnabled sessionOwner;
+    private final ICdmEntitySessionEnabled<?> sessionOwner;
 
     private ConversationalTransientEntityCacher cdmTransientEntityCacher;
 
-    private List<ICdmEntitySessionEnabled> changeObservers;
+    private List<ICdmEntitySessionEnabled<?>> changeObservers;
 
-    public CdmEntitySession(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
+    public CdmEntitySession(ICdmEntitySessionEnabled<?> sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
         this.sessionOwner = sessionOwner;
         this.cdmEntitySessionManager = cdmEntitySessionManager;
         init(sessionOwner, cdmEntitySessionManager);
     }
 
-    private void init(ICdmEntitySessionEnabled sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
+    private void init(ICdmEntitySessionEnabled<?> sessionOwner, CdmEntitySessionManager cdmEntitySessionManager) {
         this.cdmTransientEntityCacher = new ConversationalTransientEntityCacher(sessionOwner);
         this.changeObservers = new ArrayList<>();
         cdmEntitySessionManager.addToOwnerSessionMap(sessionOwner, this);
@@ -236,7 +237,7 @@ public class CdmEntitySession implements ICdmEntitySession  {
 
     @Override
     public <T extends CdmBase> Collection<T> getRootEntities() {
-        return sessionOwner.getRootEntities();
+        return getOwner().getRootEntities();
     }
 
     public CdmTransientEntityCacher getCacher() {
index 8f54df779c941e3821794abe89627cddc7e8b369..89df1fe56e3cf116d8273541c074cfd539ee306d 100644 (file)
@@ -16,7 +16,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import eu.etaxonomy.cdm.api.service.UpdateResult;
@@ -33,14 +34,12 @@ import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 @Component
 public class CdmEntitySessionManager implements ICdmEntitySessionManager {
 
-    private static final Logger logger = LogManager.getLogger(CdmEntitySessionManager.class);
+    private static final Logger logger = LogManager.getLogger();
 
-    private final Map<ICdmEntitySessionEnabled, ICdmEntitySession> ownerSessionMap = new HashMap<>();
+    private final Map<ICdmEntitySessionEnabled<?>, ICdmEntitySession> ownerSessionMap = new HashMap<>();
 
     private final List<ICdmEntitySessionManagerObserver> sessionObservers = new ArrayList<>();
 
-    //private ICdmEntitySession activeSession;
-
     private final InheritableThreadLocal<ICdmEntitySession> tlActiveSession = new InheritableThreadLocal<>();
 
     private NullSession nullSession;
@@ -51,7 +50,7 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
     @Override
-    public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
+    public ICdmEntitySession newSession(ICdmEntitySessionEnabled<?> sessionOwner, boolean setAsActive) {
         ICdmEntitySession session = ownerSessionMap.get(sessionOwner);
         if(session == null) {
             session = new CdmEntitySession(sessionOwner, this);
@@ -83,7 +82,7 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
     private void setActiveSession(ICdmEntitySession activeSession) {
-       this. tlActiveSession.set(activeSession);
+        this.tlActiveSession.set(activeSession);
         notifyObservers();
     }
 
@@ -93,12 +92,12 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
     @Override
-    public void bind(ICdmEntitySessionEnabled sessionOwner) {
+    public void bind(ICdmEntitySessionEnabled<?> sessionOwner) {
         if(sessionOwner == null) {
             setActiveSession(null);
             return;
         }
-        ICdmEntitySession session  = ownerSessionMap.get(sessionOwner);
+        ICdmEntitySession session = ownerSessionMap.get(sessionOwner);
         if(session == null) {
             throw new CdmClientSessionException("Trying to bind session which does not exist");
         }
@@ -107,16 +106,17 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
     @Override
-    public boolean contains(ICdmEntitySessionEnabled sessionOwner) {
+    public boolean contains(ICdmEntitySessionEnabled<?> sessionOwner) {
         return ownerSessionMap.containsKey(sessionOwner);
     }
 
     @Override
     public <T extends Object> T load(T obj, boolean update) {
-        if(tlActiveSession.get() == null) {
+        ICdmEntitySession session = tlActiveSession.get();
+        if(session == null) {
             return obj;
         } else {
-            return tlActiveSession.get().load(obj, update);
+            return session.load(obj, update);
         }
     }
 
@@ -159,7 +159,7 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
         return tlActiveSession.get().load(cdmBaseList, update);
     }
 
-    void remove(ICdmEntitySessionEnabled owner) {
+    void remove(ICdmEntitySessionEnabled<?> owner) {
         ICdmEntitySession session = ownerSessionMap.get(owner);
         if(session == null) {
             logger.info("No Session connected to owner, nothing to do");
@@ -174,7 +174,7 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
     }
 
     @Override
-    public void dispose(ICdmEntitySessionEnabled owner) {
+    public void dispose(ICdmEntitySessionEnabled<?> owner) {
         ICdmEntitySession session = ownerSessionMap.get(owner);
         if(session != null) {
             session.dispose();
@@ -186,9 +186,9 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
 
     @Override
     public void disposeAll() {
-        Set<ICdmEntitySessionEnabled> owners =
-                new HashSet<ICdmEntitySessionEnabled>(ownerSessionMap.keySet());
-        for(ICdmEntitySessionEnabled owner : owners) {
+        Set<ICdmEntitySessionEnabled<?>> owners =
+                new HashSet<>(ownerSessionMap.keySet());
+        for(ICdmEntitySessionEnabled<?> owner : owners) {
             ICdmEntitySession session = ownerSessionMap.get(owner);
             if(session != null) {
                 session.dispose();
@@ -196,7 +196,7 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
         }
     }
 
-    public void addToOwnerSessionMap(ICdmEntitySessionEnabled owner, ICdmEntitySession session) {
+    public void addToOwnerSessionMap(ICdmEntitySessionEnabled<?> owner, ICdmEntitySession session) {
         ownerSessionMap.put(owner, session);
         notifyObservers();
     }
@@ -211,12 +211,4 @@ public class CdmEntitySessionManager implements ICdmEntitySessionManager {
             sessionObserver.changed();
         }
     }
-
-    @Override
-    public boolean isRemoting() {
-        // FIXME:Remoting stupid method to check whether we are in remoting
-        return true;
-    }
-
-}
-
+}
\ No newline at end of file
index e54026ae3f78e203422420a0058e166d005b5f05..e49b0e8273c0afbf31d5dcdb6e69fc5840e9a7f9 100644 (file)
@@ -1,3 +1,11 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 package eu.etaxonomy.taxeditor.session;
 
 import java.util.Collection;
index abfbbc3437ccfdeadcdd348c1f9e6617521281d8..6676393a8bac0db2042a0b6988cc95a2074b4c4d 100644 (file)
@@ -35,7 +35,7 @@ public interface ICdmEntitySessionManager {
      * @param setAsActive if
      * @return the new session
      */
-    public abstract ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive);
+    public abstract ICdmEntitySession newSession(ICdmEntitySessionEnabled<?> sessionOwner, boolean setAsActive);
 
     /**
      * Makes the {@link NullSession} the active session.
@@ -48,7 +48,7 @@ public interface ICdmEntitySessionManager {
         *
         * @param sessionOwner
         */
-       public abstract void bind(ICdmEntitySessionEnabled sessionOwner);
+       public abstract void bind(ICdmEntitySessionEnabled<?> sessionOwner);
 
        /**
         * Loads an object intto the active session and returns the cached object
@@ -111,9 +111,7 @@ public interface ICdmEntitySessionManager {
 
     public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver);
 
-    public boolean isRemoting();
-
-    public void dispose(ICdmEntitySessionEnabled owner);
+    public void dispose(ICdmEntitySessionEnabled<?> owner);
 
     public void disposeAll();
 
@@ -124,7 +122,7 @@ public interface ICdmEntitySessionManager {
      * @param sessionOwner the session owner
      * @return <code>true</code> if a session exists
      */
-    public boolean contains(ICdmEntitySessionEnabled sessionOwner);
+    public boolean contains(ICdmEntitySessionEnabled<?> sessionOwner);
 
     /**
      * Returns the {@link NullSession} singleton instance (within this session manager)
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySession.java
deleted file mode 100644 (file)
index a96a04a..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
-* Copyright (C) 2015 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.session.mock;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.UUID;
-
-import eu.etaxonomy.cdm.api.service.IService;
-import eu.etaxonomy.cdm.api.service.UpdateResult;
-import eu.etaxonomy.cdm.cache.EntityCacherDebugResult;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.persistence.dto.MergeResult;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
-import net.sf.ehcache.statistics.FlatStatistics;
-
-/**
- * @author cmathew
- * @date 29 Jan 2015
- */
-public class MockCdmEntitySession implements ICdmEntitySession  {
-
-    @Override
-    public <O extends Object> O load(O obj, boolean update) {
-        return obj;
-    }
-
-    @Override
-    public  <T extends CdmBase> T load(T cdmBase, boolean update) {
-        return cdmBase;
-    }
-
-    @Override
-    public  <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
-        return cdmBaseList;
-    }
-
-    @Override
-    public void setEntitiesAsLatest() {
-    }
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void bind() {
-    }
-
-    @Override
-    public  <T extends CdmBase> EntityCacherDebugResult debug(T cdmBase) {
-        return new EntityCacherDebugResult();
-    }
-
-
-    @Override
-    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid) {
-        return service.load(uuid);
-    }
-
-    @Override
-    public <T extends CdmBase> T remoteLoad(IService<T> service, UUID uuid, List<String> propertyPaths) {
-        return service.load(uuid, propertyPaths);
-    }
-
-    @Override
-    public <T extends CdmBase> UUID remoteSave(IService<T> service, T cdmBase) {
-        return service.save(cdmBase).getUuid();
-    }
-
-    @Override
-    public <T extends CdmBase> T remoteUpdate(IService<T> service, T cdmBase) {
-        return cdmBase;
-    }
-
-    @Override
-    public ICdmEntitySessionEnabled getOwner() {
-        return null;
-    }
-
-    @Override
-    public FlatStatistics getCacheStatistics() {
-        return null;
-    }
-
-    @Override
-    public boolean isActive() {
-        return false;
-    }
-
-    @Override
-    public <T extends CdmBase> List<T> getRootEntities() {
-        return null;
-    }
-
-    @Override
-    public <T extends CdmBase> EntityCacherDebugResult debug(Collection<T> cdmBase, boolean includeIgnored) {
-        return null;
-    }
-
-    @Override
-    public <T extends CdmBase> EntityCacherDebugResult debug(boolean includeIgnored) {
-        return null;
-    }
-
-    @Override
-    public <T extends CdmBase> void update() {
-    }
-
-    @Override
-    public UpdateResult load(UpdateResult updateResult, boolean update) {
-        return updateResult;
-    }
-
-    @Override
-    public List<String> getPropertyPaths(Object obj) {
-        return null;
-    }
-
-    @Override
-    public void addNewCdmEntity(CdmBase newEntity) {
-    }
-
-    @Override
-    public <T extends CdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update) {
-        return mergeResult;
-    }
-}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java b/eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/mock/MockCdmEntitySessionManager.java
deleted file mode 100644 (file)
index 6d20263..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
-* Copyright (C) 2015 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.session.mock;
-
-import java.util.Collection;
-
-import eu.etaxonomy.cdm.api.service.UpdateResult;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.ICdmBase;
-import eu.etaxonomy.cdm.persistence.dto.MergeResult;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
-import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManagerObserver;
-
-public class MockCdmEntitySessionManager implements ICdmEntitySessionManager {
-
-       @Override
-       public void bind(ICdmEntitySessionEnabled sessionOwner) {
-       }
-
-       @Override
-       public <T> T load(T obj, boolean update) {
-               return obj;
-       }
-
-       @Override
-       public <T extends CdmBase> T load(T obj, boolean update) {
-               return obj;
-       }
-
-       @Override
-       public <T extends CdmBase> Collection<T> load(Collection<T> cdmBaseList, boolean update) {
-               return cdmBaseList;
-       }
-
-    @Override
-    public ICdmEntitySession newSession(ICdmEntitySessionEnabled sessionOwner, boolean setAsActive) {
-        return new MockCdmEntitySession();
-    }
-
-    @Override
-    public ICdmEntitySession getActiveSession() {
-        return new MockCdmEntitySession();
-    }
-
-    @Override
-    public Collection<ICdmEntitySession> getSessions() {
-        return null;
-    }
-
-    @Override
-    public void addSessionObserver(ICdmEntitySessionManagerObserver sessionObserver) {
-
-    }
-
-    @Override
-    public boolean isRemoting() {
-        return false;
-    }
-
-    @Override
-    public void dispose(ICdmEntitySessionEnabled owner) {
-    }
-
-    @Override
-    public void disposeAll() {
-    }
-
-    @Override
-    public <T extends CdmBase> void update() {
-    }
-
-    @Override
-    public UpdateResult load(UpdateResult updateResult, boolean update) {
-        return updateResult;
-    }
-
-    @Override
-    public boolean contains(ICdmEntitySessionEnabled sessionOwner) {
-        return false;
-    }
-
-    @Override
-    public ICdmEntitySession bindNullSession() {
-        return new MockCdmEntitySession();
-    }
-
-    @Override
-    public ICdmEntitySession getNullSession() {
-        return new MockCdmEntitySession();
-    }
-
-    @Override
-    public <T extends ICdmBase> MergeResult<T> load(MergeResult<T> mergeResult, boolean update) {
-        return mergeResult;
-    }
-}
\ No newline at end of file
index 1cabe61b8c48a271148deb827dd2647d4051a391..5f3da4324222f86c8fd9368dd21ba73ffad51c6d 100644 (file)
@@ -1478,11 +1478,12 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                if (getOwner() != null && !initialized) {
                    Object collectionType = null;
                    Field field = null;
+                   String fieldName = null;
                    Class<?> clazz = null;
                    String codePart = "1";
                        try {
                                String role = getRole();
-                               String fieldName = role.substring(role.lastIndexOf(".") + 1);
+                               fieldName = role.substring(role.lastIndexOf(".") + 1);
                                LOG.info("--> Remote Lazy Initializing Collection " + getRole() + " , owner : " + getOwner().getClass() + "/" + getKey() + " , field : " + fieldName);
                                Object owner = getOwner();
                                CdmBase cdmBase;
@@ -1526,7 +1527,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                                }
                        } catch (Exception ex) {
                            String originalMessage = ex.getMessage();
-                           String message = originalMessage + ", clazz: " + (clazz == null? "" :clazz.getSimpleName())+ ", field: " + field + ", collectionType: " + collectionType + ", at code part: " + codePart;
+                           String message = originalMessage + ", clazz: " + (clazz == null? "" :clazz.getSimpleName())+ ", field: " + field != null? field.getName(): fieldName + ", collectionType: " + collectionType + ", at code part: " + codePart;
                            throw new CdmEagerLoadingException(message);
                        }
                }
index 07b2cf26dd9c43252431fe35cfdc64eefe60b320..8fe0e938f16e8144aec5e8b0cf349bfe005d29bb 100644 (file)
@@ -8,6 +8,9 @@
 */
 package org.springframework.remoting.httpinvoker;
 
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -17,10 +20,10 @@ import org.apache.logging.log4j.Logger;
 import org.springframework.remoting.support.RemoteInvocation;
 import org.springframework.remoting.support.RemoteInvocationResult;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
+import eu.etaxonomy.taxeditor.remoting.RemoteExecutionTimestampsUtil;
 import eu.etaxonomy.taxeditor.service.IRemoteInvocationTermCacher;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
 
@@ -56,6 +59,7 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
         persistingMethods.add("findWithUpdate");
         persistingMethods.add("loadWithUpdate");
         measureDuration = System.getProperty(PROP_KEY_MEASURE_DURATION) != null;
+        //measureDuration = true;
     }
 
     @Override
@@ -74,7 +78,9 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
         }
 
         // A)  if this is a term service call for term lists try to get the terms from the cache
-        if(ITermService.class.isAssignableFrom(originalInvocation.getMethod().getDeclaringClass())){
+
+
+        if(ITermService.class.isAssignableFrom(this.getServiceInterface())){
             return handleTermRequest(invocation, originalInvocation);
         }
         // B) handle other service calls
@@ -92,11 +98,11 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
             //Note AM (2022-06-15): the debug information seem to be misleading (also because cache() is not used/implemented anymore)
             if(persistingMethods.contains(invocation.getMethodName())) {
                 invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), true));
-                logger.debug("Entity cached with updating cached data");
+                if (logger.isDebugEnabled()){logger.debug("Entity cached with updating cached data");}
             } else if(invocationResult.getValue() instanceof UpdateResult){
                 UpdateResult result = (UpdateResult)invocationResult.getValue();
                 if(result.isOk()){
-                    logger.debug("Entity from UpdateResult stored in cache with updating cached data" );
+                    if (logger.isDebugEnabled()){logger.debug("Entity from UpdateResult stored in cache with updating cached data" );}
                     try {
                         cdmEntitySessionManager().load(result, true);
                     } catch (Exception e) {
@@ -106,7 +112,7 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
                 }
             } else {
                 invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), false));
-                logger.debug("Entity cached without updating cached data" );
+                if (logger.isDebugEnabled()){logger.debug("Entity cached without updating cached data" );}
             }
         }
         cache(invocation, invocationResult);
@@ -131,7 +137,7 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
                     String message = "Error when caching terms in TaxEditor";
                     throw new RuntimeException(message, e);
                 }
-                logger.debug("Term list loaded and cached");
+                logger.warn("Term list loaded and cached");
             } else {
                 logger.debug("Term list found in cache, not loaded");
             }
@@ -150,10 +156,16 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
             startTime = System.currentTimeMillis();
         }
         try {
+            //setLastMethod can not be done later as invocation is not avaiable later or super class method are final
+            RemoteExecutionTimestampsUtil.setLastMethod(invocation.getMethodName());
             RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation);
             if(measureDuration){
                 double duration = System.currentTimeMillis() - startTime;
-                logger.info(getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
+
+                LocalDateTime date = LocalDateTime.now();
+                String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
+                System.out.println(dateTimeStr + ": "+ getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
+                logger.info(dateTimeStr + getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]");
             }
             return result;
         } catch(Exception e) {
@@ -175,7 +187,7 @@ public class CachingHttpInvokerProxyFactoryBean extends HttpInvokerProxyFactoryB
     private ICdmEntitySessionManager cdmEntitySessionManager(){
         if(cdmEntitySessionManager == null) {
             cdmEntitySessionManager =
-                    ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager();
+                    CdmApplicationState.getCurrentAppConfig().getCdmEntitySessionManager();
         }
         return cdmEntitySessionManager;
     }
index 5d03120841c00e9f8d2ca241471d85e901324e38..cc5ea9b2a151a79c58591fecdeb073cffbf3d706 100755 (executable)
@@ -4,7 +4,7 @@
     <File name="A1" fileName="A1.log" append="true">
       <XMLLayout/>  <!-- maybe we need to add jackson-dataformat-xml dependency for this -->
     </File>
-    <Console name="STDOUT" target="System.out">
+   <!-- <Console name="STDOUT" target="System.out">
       <PatternLayout  pattern="%d %p [%c] - %m%n"/>
       <Filters>
         <RegexFilter regex=".*has a maxElementsInMemory of 0. This might lead to performance degradation or OutOfMemoryError at Terracotta client.*"
@@ -12,7 +12,7 @@
         <RegexFilter regex=".*object references was reached while attempting to calculate the size of the object graph.*"
           onMatch="DENY"/>
       </Filters>      
-    </Console>
+    </Console>-->
   </Appenders>
   <Loggers>
     <Root level="warn">
@@ -22,7 +22,7 @@
     <Logger name="eu.etaxonomy.taxeditor.handler.update.UpdateHandler" level="info"/>
     <Logger name="org.eclipse.equinox.p2.operations.ProvisioningSession" level="info"/>
     <Logger name="org.eclipse.equinox.internal.p2.engine.ProvisioningPlan" level="info"/>
-    
+    <Logger name="org.springframework.remoting.httpinvoker.CachingHttpInvokerProxyFactoryBean" level="info"/>
     <!-- ### NOT USED 
     <Logger name="org.hibernate.proxy.AbstractLazyInitializer" level="info"/>
     <Logger name="org.hibernate.collection.internal.AbstractPersistentCollection" level="info"/>
index 820c8410807cdbace77a70371df34d6e6401590a..605b7511b77dc51f454115195772a5c80a54b43c 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Editor Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: OSGI-INF/l10n/plugin
@@ -39,6 +39,7 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.e4.core.commands,
  org.eclipse.e4.core.services,
  org.eclipse.e4.core.contexts,
+ org.eclipse.equinox.p2.ui,
  org.eclipse.nebula.widgets.nattable.core,
  org.eclipse.nebula.widgets.nattable.extension.glazedlists,
  org.eclipse.nebula.widgets.nattable.extension.e4;bundle-version="1.1.0",
index a609cc6d400e28b36f611ecc4b59c0b3dcc73209..69032cfda60c29b5172a69047860c2438dc63a65 100755 (executable)
@@ -94,6 +94,7 @@ command.label.131 = Move Factual Dataset to other Taxon and set Name in Sources
 command.name.132 = Move Fact(s) to other Taxon and set Name in Sources if empty\r
 command.label.132 = Move Fact(s) to other Taxon and set Name in Sources if empty\r
 command.name.12 = Move Fact(s) to other Taxon\r
+command.name.133 = Set as default factual data set\r
 category.name.2 = -- New Uses\r
 command.name.14 = New Use\r
 command.name.15 = New Use Summary\r
index 5e77e68909c631c0e381a1758914742809dc9599..22455be553aa977e884bfdaa7e992ba92ab7209a 100644 (file)
@@ -55,6 +55,7 @@ command.label.28 = Verschiebe Faktendaten-Set zu anderem Taxon
 command.label.29 = Verschiebe Fakt(en) zu anderem Taxon
 command.label.30 = L\u00f6schen
 command.label.31 = Speichern
+command.name.133 = Setze Faktendaten-Set als Default
 menu.label.2 = Neue Derivate
 command.label.32 = Neue Nutzung
 command.label.33 = Neue Zusammenfassung
index 8b2fae3f8b764cb8b115fcd75a94e1057321276d..a996f2b01383160e9d28c7810b8505f404fb6897 100644 (file)
       <handlers xmi:id="_tc-7wLy2EeioE565ihOF2g" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionWithSourceHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.CreateDescriptionWithSourceHandler" command="_Z51sQLy2EeioE565ihOF2g"/>
       <handlers xmi:id="_i7ovoL9OEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.MoveDescriptionToOtherTaxonHandlerSetNameInSource" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5" command="_yknsIL9NEemCian_vXpNsA"/>
       <handlers xmi:id="_GakGYL9PEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.MoveDescriptionElementsHandlerSetNameInSource" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.MoveDescriptionElementsSetNameInSourceHandlerE5" command="__8WFwL9OEemCian_vXpNsA"/>
+      <handlers xmi:id="_BKqkwGQfEe6yp7ON-qKPbg" elementId="eu.etaxonomy.taxeditor.editor.handler.5" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.SetDefaultDescriptionHandler" command="_ZyKbwGQbEe6yp7ON-qKPbg"/>
       <menus xsi:type="menu:PopupMenu" xmi:id="_HxxDt4GxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.factualDataView">
         <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_bMfdYIG5EeehlNPrK_b5JA" coreExpressionId="isCdmStoreConnected"/>
         <children xsi:type="menu:DynamicMenuContribution" xmi:id="_2t3BgIHWEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.DynamicFeatureMenuE4"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_qVkKkL9OEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.factualData.moveDescriptionElementSetNameInSource" label="%command.label.132" command="__8WFwL9OEemCian_vXpNsA"/>
         <children xsi:type="menu:MenuSeparator" xmi:id="_pOAxAIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.menuseparator.10"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_rLS9EIGxEeehlNPrK_b5JA" elementId="eu.etaxonomy.taxeditor.editor.factualData.delete" label="%command.label.30" command="_AqgMcIG5EeehlNPrK_b5JA"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_HRQIgGQfEe6yp7ON-qKPbg" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandname133" label="%command.name.133" command="_ZyKbwGQbEe6yp7ON-qKPbg"/>
       </menus>
       <toolbar xmi:id="_sfp2sL2jEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.editor.toolbar.0">
         <children xsi:type="menu:HandledToolItem" xmi:id="_t7kbEL2jEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.editor.handledtoolitem.factual.showIndividualAssociations" label="%command.name.41" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/link_obj.gif" type="Check" command="_4eDWoIy0EeeQaL4TL8oz7Q"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_KT8rYIZ5EeeOc9DZcjNN7g" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.commandlabel44" label="%command.label.44" command="_Ob4xIIZ5EeeOc9DZcjNN7g"/>
       </menus>
     </elements>
-    <elements xsi:type="basic:PartDescriptor" xmi:id="_tLceMIl4Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4" label="%partdescriptor.label.2" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif" tooltip="" allowMultiple="true" category="" closeable="true" dirtyable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4">
+    <elements xsi:type="basic:PartDescriptor" xmi:id="_tLceMIl4Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor" label="%partdescriptor.label.2" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif" tooltip="" allowMultiple="true" category="" closeable="true" dirtyable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor">
       <tags>View</tags>
       <tags>nonRestore</tags>
       <handlers xmi:id="_tLceQIl4Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.handler.SaveHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.SaveHandler" command="_majwMEaQEeeXMc6kSYO7Xg"/>
-      <handlers xmi:id="_DCv88IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHeterotypicSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHeterotypicSynonymHandlerE4" command="_ult4EIvOEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_OqNIQIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHomotypicSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHomotypicSynonymHandlerE4" command="_KpUFsIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_XFc2QIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateSynonymInHomotypicalGroupHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateSynonymInHomotypicalGroupHandlerE4" command="_VPLRIIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_ffY8sIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateMisapplicationHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateMisapplicationHandlerE4" command="_c0byUIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_qKP84IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeSynonymToAcceptedTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeSynonymToAcceptedTaxonHandlerE4" command="_oBnccIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_14GrIIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToSynonymHandlerE4" command="_yh49QIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_8Lzd0IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToMisapplicationHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToMisapplicationHandlerE4" command="_56AaUIvPEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_GTxMUIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteTaxonBaseHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteTaxonBaseHandlerE4" command="_CoVcYIvQEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_OZLNMIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteAllEmptyNamesHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteAllEmptyNamesHandlerE4" command="_L4vQwIvQEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_WWqoMIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4" command="_UFDx8IvQEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_edkd4IvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandlerE4" command="_b2nCsIvQEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_lv9GYIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandlerE4" command="_jNvBQIvQEee7R4eqeQiXZg"/>
-      <handlers xmi:id="_g8QScFgWEeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4" command="_HSKdYFgXEeiQk_eTMvMviQ"/>
-      <handlers xmi:id="_442rEFj-EeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToProParteSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToProParteSynonymHandlerE5" command="_BgX6gFj_EeiQk_eTMvMviQ"/>
+      <handlers xmi:id="_DCv88IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHeterotypicSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHeterotypicSynonymHandler" command="_ult4EIvOEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_OqNIQIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHomotypicSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateHomotypicSynonymHandler" command="_KpUFsIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_XFc2QIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateSynonymInHomotypicalGroupHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateSynonymInHomotypicalGroupHandler" command="_VPLRIIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_ffY8sIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateMisapplicationHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateMisapplicationHandler" command="_c0byUIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_qKP84IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeSynonymToAcceptedTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeSynonymToAcceptedTaxonHandler" command="_oBnccIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_14GrIIvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToSynonymHandler" command="_yh49QIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_8Lzd0IvPEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToMisapplicationHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToMisapplicationHandler" command="_56AaUIvPEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_GTxMUIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteTaxonBaseHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteTaxonBaseHandler" command="_CoVcYIvQEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_OZLNMIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteAllEmptyNamesHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.DeleteAllEmptyNamesHandler" command="_L4vQwIvQEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_WWqoMIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandler" command="_UFDx8IvQEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_edkd4IvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SetBasionymHandler" command="_b2nCsIvQEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_lv9GYIvQEee7R4eqeQiXZg" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.MoveSynonymToAnotherAcceptedTaxonHandler" command="_jNvBQIvQEee7R4eqeQiXZg"/>
+      <handlers xmi:id="_g8QScFgWEeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.CreateProParteSynonymHandler" command="_HSKdYFgXEeiQk_eTMvMviQ"/>
+      <handlers xmi:id="_442rEFj-EeiQk_eTMvMviQ" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToProParteSynonymHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.ChangeToProParteSynonymHandler" command="_BgX6gFj_EeiQk_eTMvMviQ"/>
       <handlers xmi:id="_MYvcYL9MEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedHandlerE4SetNameInSource" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.name.e4.handler.SwapSynonymAndAcceptedSetNameInSourceHandlerE5" command="_tuB4AL9KEemCian_vXpNsA"/>
       <menus xsi:type="menu:PopupMenu" xmi:id="_tLceQYl4Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.popupmenu.nameeditor">
         <children xsi:type="menu:Menu" xmi:id="_R6buoIl5Eeeox7omhvOBWg" elementId="eu.etaxonomy.taxeditor.editor.nameEditor.menu.new" label="%menu.label">
     <elements xsi:type="commands:Command" xmi:id="_zCGQ8JN1EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.charactermatrix.command.addDescription" commandName="%command.commandname.25"/>
     <elements xsi:type="commands:Command" xmi:id="_K2C_oKZAEeq8Gc-K2nsNRg" elementId="eu.etaxonomy.taxeditor.editor.command.aggregation" commandName="%command.commandname.26"/>
     <elements xsi:type="commands:Command" xmi:id="_vWxB4KoiEeqBXdGXVmg_xA" elementId="eu.etaxonomy.taxeditor.editor.command.create_key" commandName="%command.commandname.27"/>
+    <elements xsi:type="commands:Command" xmi:id="_ZyKbwGQbEe6yp7ON-qKPbg" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.command.SetDefaultDescription" commandName="%command.name.133"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_pZmusEalEeeXMc6kSYO7Xg" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.navigation">
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_FPIHQKNwEeebGZ23ERGMGw" elementId="eu.etaxonomy.taxeditor.editor.showViewMenu.conceptGraph" label="%view.name.3" iconURI="" tooltip="%view.name.3" command="_WPjpoDSnEeek0dKsFNy--Q">
     <elements xsi:type="commands:Handler" xmi:id="_HN2_oJN2EeqyUKRuXQ8miw" elementId="eu.etaxonomy.taxeditor.editor.handler.addDescription" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.AddDescriptionHandler" command="_gE3lwIGyEeehlNPrK_b5JA"/>
     <elements xsi:type="commands:Handler" xmi:id="_EBL2EKY_Eeq8Gc-K2nsNRg" elementId="eu.etaxonomy.taxeditor.editor.handler.aggregate" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.AggregationHandler" command="_K2C_oKZAEeq8Gc-K2nsNRg"/>
     <elements xsi:type="commands:Handler" xmi:id="_4HDLwKoiEeqBXdGXVmg_xA" elementId="eu.etaxonomy.taxeditor.editor.handler.create_key" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.handler.GeneratePolytomousKeyHandler" command="_vWxB4KoiEeqBXdGXVmg_xA"/>
+    <elements xsi:type="commands:Handler" xmi:id="_FET3MGQcEe6yp7ON-qKPbg" elementId="eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.SetDefaultDescription" contributionURI="bundleclass://eu.etaxonomy.taxeditor.editor/eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler.SetDefaultDescriptionHandler" command="_ZyKbwGQbEe6yp7ON-qKPbg"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_OyvD8KNOEee5fYT78qEx0A" featurename="children" parentElementId="bulkeditor.menus.openmenu" positionInList="before:eu.etaxonomy.taxeditor.bulkeditor.handledmenuitem.specimen">
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_SZZBkKNOEee5fYT78qEx0A" elementId="eu.etaxonomy.taxeditor.editor.handledmenuitem.specimen_editor" label="%command.label.DERIVATIVE_EDITOR" tooltip="%command.label.DERIVATIVE_EDITOR" command="_PDjFMLsKEeeQJq8FDGEi1g">
index 59a850275fb45e535e80087505783021f7c7465c..1e9b95dc7c4c91cc4435b02d9833066722433e92 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
   
   <modelVersion>4.0.0</modelVersion>
index 5152ba84515beaffaa46837abbb93e127b775943..006924d69baa436d4a9b0fee70ed664a27856acb 100644 (file)
@@ -277,7 +277,7 @@ public class AppModelId {
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_GROUP_AUTHORITY_E4_CDMAUTHORITYEDITORE4 = "eu.etaxonomy.taxeditor.editor.group.authority.e4.CdmAuthorityEditorE4";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_KEY_POLYTOMOUS_E4_POLYTOMOUSKEYGRAPHEDITORE4 = "eu.etaxonomy.taxeditor.editor.key.polytomous.e4.PolytomousKeyGraphEditorE4";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_KEY_POLYTOMOUS_E4_POLYTOMOUSKEYLISTEDITORE4 = "eu.etaxonomy.taxeditor.editor.key.polytomous.e4.PolytomousKeyListEditorE4";
-       public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4 = "eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4";
+       public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR= "eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor";
        //public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_CHECKLIST_E4_CHECKLISTEDITORE4 = "eu.etaxonomy.taxeditor.editor.view.checklist.e4.ChecklistEditorE4";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_CHECKLIST_E4_DISTRIBUTIONEDITORPART = "eu.etaxonomy.taxeditor.editor.view.checklist.e4.DistributionEditorPart";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_CONCEPT_E4_CONCEPTVIEWPARTE4 = "eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4";
index a28be226d741090e231ed6396a10cacfc612d7bd..1c706a6932c84ab39af35b6eb6935eb6a619fcfa 100644 (file)
@@ -13,9 +13,15 @@ import java.util.List;
 import java.util.Set;
 
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.dialogs.ListDialog;
 
@@ -30,15 +36,16 @@ import eu.etaxonomy.taxeditor.editor.l10n.Messages;
  * @created 19.03.2009
  */
 public class ChooseFromMultipleTaxonNodesDialog extends ListDialog {
+    Button okButton;
 
        public static TaxonNode choose(Set<TaxonNode> taxonNodes){
                ChooseFromMultipleTaxonNodesDialog dialog = new ChooseFromMultipleTaxonNodesDialog(EditorUtil.getShell());
                dialog.setInput(taxonNodes);
+               
                int result = dialog.open();
                
-               if(result == IStatus.OK){
+               if(result == IStatus.OK ){                  
                        Classification selectedClassification = (Classification) dialog.getResult()[0];
-                       
                        for(TaxonNode taxonNode : taxonNodes){
                                if(taxonNode.getClassification().equals(selectedClassification)){
                                        return taxonNode;
@@ -47,15 +54,36 @@ public class ChooseFromMultipleTaxonNodesDialog extends ListDialog {
                }
                return null;
        }
+       @Override
+    protected void createButtonsForButtonBar(Composite parent) {
+        okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+        createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+        okButton.setEnabled(false);
+    }
        
        public ChooseFromMultipleTaxonNodesDialog(Shell parent) {
                super(parent);
                setTitle(Messages.ChooseFromMultipleTaxonNodesDialog_CHOOSE_CLASSIFICATION);
                setMessage(Messages.ChooseFromMultipleTaxonNodesDialog_CHOOSE_CLASSIFICATION_MESSAGE);
                setContentProvider(new ClassificationContentProvider());
-               setLabelProvider(new ClassificationLabelProvider());
+               setLabelProvider(new ClassificationLabelProvider());            
        }
        
+       @Override
+    public void create() {
+        super.create();
+        this.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+            @Override
+            public void selectionChanged(SelectionChangedEvent event) {
+                IStructuredSelection s = (IStructuredSelection) event.getSelection();
+                Object obj = s.getFirstElement();
+                if (obj != null) {
+                    okButton.setEnabled(true);
+                }
+              }
+            });
+    }
+       
        private class ClassificationLabelProvider extends LabelProvider{
                @Override
                public String getText(Object element) {
@@ -86,6 +114,7 @@ public class ChooseFromMultipleTaxonNodesDialog extends ListDialog {
                @Override
                public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                        
-               }               
+               }       
+               
        }
 }
\ No newline at end of file
index 95dced8e0daed6e0e23a269848d20ae8bc372145..5e78e8c9b33a702fe50e1fdd1a30131943ebfa39 100644 (file)
@@ -42,15 +42,15 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonBulkEditorInput;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetEditor;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.group.authority.e4.CdmAuthorityEditorE4;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.checklist.e4.DistributionEditorPart;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput;
@@ -69,7 +69,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  */
 public class EditorUtil extends AbstractUtility {
 
-    private static final String NAME_EDITOR_ID = "eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4";
+    private static final String NAME_EDITOR_ID = "eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor";
 
     private static boolean factsVisible = true;
 
@@ -166,7 +166,6 @@ public class EditorUtil extends AbstractUtility {
         }
 
         return partService.showPart(part, PartState.ACTIVATE);
-
     }
 
     public static MPart showPart(String partId, EModelService modelService, EPartService partService){
@@ -182,28 +181,19 @@ public class EditorUtil extends AbstractUtility {
     }
 
        public static void openTaxonNodeE4(UUID taxonNodeUuid, EModelService modelService, EPartService partService, MApplication application) {
-           TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstance(taxonNodeUuid);
-           openNameEditor_internal(input, modelService, partService, application);
+           TaxonEditorInput input = TaxonEditorInput.NewInstance(taxonNodeUuid);
+           openTaxonEditor_internal(input, modelService, partService, application);
        }
 
        public static void openTaxonBaseE4(UUID taxonBaseUuid, EModelService modelService, EPartService partService, MApplication application) {
-           TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstanceFromTaxonBase(taxonBaseUuid);
-           openNameEditor_internal(input, modelService, partService, application);
+           TaxonEditorInput input = TaxonEditorInput.NewInstanceFromTaxonBase(taxonBaseUuid);
+           openTaxonEditor_internal(input, modelService, partService, application);
        }
 
-    public static void openTaxonBaseE4(UUID taxonBaseUuid) {
-        //FIXME E4 this can probably be removed when fully migrated
-        TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstanceFromTaxonBase(taxonBaseUuid);
-
-        EPartService partService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EPartService.class);
-        EModelService modelService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EModelService.class);
-        openNameEditor_internal(input, modelService, partService, null);
-    }
-
-    private static void openNameEditor_internal(TaxonEditorInputE4 input, EModelService modelService, EPartService partService, MApplication application) {
+    private static void openTaxonEditor_internal(TaxonEditorInput input, EModelService modelService, EPartService partService, MApplication application) {
         TaxonBase<?> taxonBase = input.getTaxon();
         TaxonNode node = input.getTaxonNode();
-        if(taxonBase==null){
+        if(taxonBase == null){
             return;
         }
         boolean hasPermission = false;
@@ -216,11 +206,11 @@ public class EditorUtil extends AbstractUtility {
 //        }
         if (taxonBase.isOrphaned()) {
             if(taxonBase.isInstanceOf(Synonym.class)){
-                MessagingUtils.warningDialog(Messages.EditorUtil_ORPHAN_ACCEPTED_TAXON, TaxonEditorInputE4.class, Messages.EditorUtil_ORPHAN_ACCEPTED_TAXON_MESSAGE);
+                MessagingUtils.warningDialog(Messages.EditorUtil_ORPHAN_ACCEPTED_TAXON, TaxonEditorInput.class, Messages.EditorUtil_ORPHAN_ACCEPTED_TAXON_MESSAGE);
                 return;
             }
             else{
-                MessagingUtils.warningDialog(Messages.EditorUtil_ORPHAN_TAXON, TaxonEditorInputE4.class, Messages.EditorUtil_ORPHAN_TAXON_MESSAGE);
+                MessagingUtils.warningDialog(Messages.EditorUtil_ORPHAN_TAXON, TaxonEditorInput.class, Messages.EditorUtil_ORPHAN_TAXON_MESSAGE);
                 return;
             }
         }
@@ -229,26 +219,25 @@ public class EditorUtil extends AbstractUtility {
         //check if part is already opened
         MPart alreadyOpenInOtherClassification = null;
         for (MPart part : parts) {
-               if(part.getObject() instanceof TaxonNameEditorE4
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(input.getTaxon().getUuid())){
+               if(part.getObject() instanceof TaxonEditor
+                    && ((TaxonEditor) part.getObject()).getTaxon()!=null
+                    && ((TaxonEditor) part.getObject()).getTaxon().getUuid().equals(input.getTaxon().getUuid())){
 
                    UUID inputNode = input.getTaxonNode().getUuid();
-                   UUID editorNode = ((TaxonNameEditorE4) part.getObject()).getTaxonNode().getUuid();
+                   UUID editorNode = ((TaxonEditor) part.getObject()).getTaxonNode().getUuid();
                    if (!inputNode.equals(editorNode)){
                        alreadyOpenInOtherClassification = part;
                    }else{
-                       ((TaxonNameEditorE4) part.getObject()).init(input);
+                       ((TaxonEditor) part.getObject()).init(input);
                        partService.activate(part, true);
                        return;
                    }
-
             }
         }
         if (alreadyOpenInOtherClassification != null){
-            boolean doSave = forceUserSaveE4Editor(((TaxonNameEditorE4) alreadyOpenInOtherClassification.getObject()), getShell());
+            boolean doSave = forceUserSaveE4Editor(((TaxonEditor) alreadyOpenInOtherClassification.getObject()), getShell());
             if (doSave){
-                input = TaxonEditorInputE4.NewInstance(input.getTaxonNode().getUuid());
+                input = TaxonEditorInput.NewInstance(input.getTaxonNode().getUuid());
                 partService.hidePart(alreadyOpenInOtherClassification);
             }else {
                 return;
@@ -257,43 +246,32 @@ public class EditorUtil extends AbstractUtility {
 
         MPart part = showPart(NAME_EDITOR_ID, modelService, partService, application);
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
+        TaxonEditor editor = (TaxonEditor) part.getObject();
 //        editor.setDisabled();
         editor.init(input);
 //        editor.setEnabled();
         editor.setFocus();
-        if (factsVisible){
-            showFacts(modelService, partService);
-            factsVisible = false;
-        }
-
-        if (mediaVisible){
-            showMedia(modelService, partService);
-            mediaVisible = false;
-        }
     }
 
     public static void showMedia(EModelService modelService, EPartService partService) {
         String partIdFactualData = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_MEDIA_E4_MEDIAVIEWPARTE4;
         showPart(partIdFactualData, modelService, partService);
-
     }
 
     public static void showFacts(EModelService modelService, EPartService partService) {
         String partIdFactualData = AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DESCRIPTIVE_E4_FACTUALDATAPARTE4;
         showPart(partIdFactualData, modelService, partService);
-
     }
 
     public static Collection<MPart> checkForChanges(UUID taxonUUID, EPartService partService ){
         Collection<MPart> parts = partService.getParts();
-        Collection<MPart> dirtyParts = new HashSet();
+        Collection<MPart> dirtyParts = new HashSet<>();
         //check if part is already opened
         boolean isDirty = false;
         for (MPart part : parts) {
-            if(part.getObject() instanceof TaxonNameEditorE4
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(taxonUUID)){
+            if(part.getObject() instanceof TaxonEditor
+                    && ((TaxonEditor) part.getObject()).getTaxon()!=null
+                    && ((TaxonEditor) part.getObject()).getTaxon().getUuid().equals(taxonUUID)){
                 if (part.isDirty()){
                     dirtyParts.add(part);
                 }
@@ -313,16 +291,16 @@ public class EditorUtil extends AbstractUtility {
         Collection<IE4SavablePart> dirtyParts = new HashSet<>();
         //check if part is already opened
         for (MPart part : parts) {
-            if(part.getObject() instanceof TaxonNameEditorE4
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
-                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().getUuid().equals(taxonUUID)){
+            if(part.getObject() instanceof TaxonEditor
+                    && ((TaxonEditor) part.getObject()).getTaxon()!=null
+                    && ((TaxonEditor) part.getObject()).getTaxon().getUuid().equals(taxonUUID)){
                 if (part.isDirty()){
                     dirtyParts.add((IE4SavablePart) part);
                 }
 
                 break;
             }else if (taxonUUID == null){
-                if (part.isDirty() && (part.getObject() instanceof TaxonNameEditorE4 || (part.getObject() instanceof BulkEditor && ((BulkEditor)part.getObject()).getEditorInput() instanceof TaxonEditorInput))){
+                if (part.isDirty() && (part.getObject() instanceof TaxonEditor || (part.getObject() instanceof BulkEditor && ((BulkEditor)part.getObject()).getEditorInput() instanceof TaxonBulkEditorInput))){
                     dirtyParts.add((IE4SavablePart) part.getObject());
                 }
             }
@@ -339,12 +317,12 @@ public class EditorUtil extends AbstractUtility {
         *            a {@link java.util.UUID} object.
         */
        public static void openEmptyE4(UUID parentNodeUuid) {
-               TaxonEditorInputE4 input = TaxonEditorInputE4
+               TaxonEditorInput input = TaxonEditorInput
                                .NewEmptyInstance(parentNodeUuid);
         EPartService partService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EPartService.class);
         MPart part = partService.createPart(NAME_EDITOR_ID);
         part = partService.showPart(part, PartState.ACTIVATE);
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
+        TaxonEditor editor = (TaxonEditor) part.getObject();
         editor.init(input);
        }
 
@@ -376,17 +354,6 @@ public class EditorUtil extends AbstractUtility {
         EditorUtil.mediaVisible = mediaVisible;
     }
 
-    /**
-        * <p>
-        * forceUserSave
-        * </p>
-        *
-        * @param editor
-        *            a {@link org.eclipse.ui.IEditorPart} object.
-        * @param shell
-        *            a {@link org.eclipse.swt.widgets.Shell} object.
-        * @return a boolean.
-        */
        public static boolean forceUserSave(IEditorPart editor, Shell shell) {
                if (editor.isDirty()) {
 
@@ -491,8 +458,8 @@ public class EditorUtil extends AbstractUtility {
         Collection<MPart> parts = partService.getParts();
         for (MPart part : parts) {
             Object object = part.getObject();
-            if(object instanceof TaxonNameEditorE4){
-                TaxonNameEditorE4 taxonEditor = (TaxonNameEditorE4)object;
+            if(object instanceof TaxonEditor){
+                TaxonEditor taxonEditor = (TaxonEditor)object;
                 TaxonNode node = taxonEditor.getEditorInput().getTaxonNode();
                 if (node.treeIndex()!= null){
                        if(node.treeIndex().startsWith(treeIndex)){
@@ -513,8 +480,8 @@ public class EditorUtil extends AbstractUtility {
         Collection<MPart> parts = partService.getParts();
         for (MPart part : parts) {
             Object object = part.getObject();
-            if(object instanceof TaxonNameEditorE4){
-                TaxonNameEditorE4 taxonEditor = (TaxonNameEditorE4)object;
+            if(object instanceof TaxonEditor){
+                TaxonEditor taxonEditor = (TaxonEditor)object;
                 TaxonNode node = taxonEditor.getEditorInput().getTaxonNode();
                 if (node.treeIndex()!= null){
                     if(node.treeIndex().startsWith(treeIndex)){
@@ -560,11 +527,11 @@ public class EditorUtil extends AbstractUtility {
         }
     }
 
-    public static void updateEditor(TaxonNode taxonNode, TaxonNameEditorE4 editor){
+    public static void updateEditor(TaxonNode taxonNode, TaxonEditor editor){
         String treeIndex = taxonNode.treeIndex();
         TaxonNode node = editor.getEditorInput().getTaxonNode();
         if(node.treeIndex().equals(treeIndex)){
-               TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstance(node.getUuid());
+               TaxonEditorInput input = TaxonEditorInput.NewInstance(node.getUuid());
                editor.init(input);
         }
     }
index 05c634eee4852250637fd63119a1df70ea4ba051..35fd2ba5ea20228b24d61f305fa64f068167750d 100644 (file)
@@ -37,7 +37,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since Oct 29, 2018
  *
  */
-public class AreasSelectionDialog extends Dialog{
+public class AreasSelectionDialog extends Dialog {
 
     private CheckBoxTreeComposite treeComposite;
 
@@ -45,19 +45,20 @@ public class AreasSelectionDialog extends Dialog{
 
     private Collection<TermVocabularyDto> areaVocabularies;
 
-
     protected AreasSelectionDialog(Shell parentShell, List<TermDto> selectedAreas) {
         super(parentShell);
         this.selectedAreas = selectedAreas;
-        this.areaVocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(TermType.NamedArea);
+        this.areaVocabularies = CdmStore.getService(IVocabularyService.class)
+                .findVocabularyDtoByTermType(TermType.NamedArea);
     }
 
     @Override
     protected Control createDialogArea(Composite parent) {
-        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
+        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(),
+                SWT.NONE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         treeComposite.getViewer().setInput(areaVocabularies);
-        Collections.sort(selectedAreas, (o1, o2)->o1.getOrderIndex()-o2.getOrderIndex());
+        Collections.sort(selectedAreas, (o1, o2) -> o1.getOrderIndex() - o2.getOrderIndex());
         treeComposite.setCheckedElements(selectedAreas.toArray());
         treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
         return treeComposite;
@@ -75,7 +76,7 @@ public class AreasSelectionDialog extends Dialog{
         selectedAreas.clear();
         List<Object> checkedElements = Arrays.asList(treeComposite.getViewer().getCheckedElements());
         checkedElements = checkedElements.stream()
-                .filter(element->element instanceof TermDto && !treeComposite.getViewer().getGrayed(element))
+                .filter(element -> element instanceof TermDto && !treeComposite.getViewer().getGrayed(element))
                 .collect(Collectors.toList());
         selectedAreas = new ArrayList(checkedElements);
         super.okPressed();
@@ -86,7 +87,7 @@ public class AreasSelectionDialog extends Dialog{
         return true;
     }
 
-    public List<TermDto> getSelectedAreas(){
+    public List<TermDto> getSelectedAreas() {
         return selectedAreas;
     }
 }
index cd470efc8b799a742801445909b84abba94264fe..040322d0e976789f486d0d53f9f6042bce421dad 100644 (file)
@@ -53,8 +53,6 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITermService;
@@ -89,14 +87,12 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @since Nov 21, 2017
  *
  */
-public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEnabled, 
+public class DescriptiveDataSetEditor implements IE4SavablePart, 
                ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasDetails, 
                IPartContentHasSupplementalData, IDirtyMarkable, IDescriptiveDataSetEditor {
 
     private DescriptiveDataSetComposite composite;
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     private DescriptiveDataSet descriptiveDataSet;
@@ -118,9 +114,6 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
     public void create(Composite parent, IEclipseContext context, @Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
             EMenuService menuService){
         if (CdmStore.isActive()){
-            if(conversation == null){
-                conversation = CdmStore.createConversation();
-            }
             if(cdmEntitySession == null){
                 cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
             }
@@ -292,11 +285,6 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
     @Override
     public void save(IProgressMonitor monitor) {
 
-        if (!conversation.isBound()) {
-            conversation.bind();
-
-        }
-        conversation.commit(true);
         Collection<TermDto> areas = composite.getAreas();
         Object input = composite.getTaxonNodeTree().getInput();
         if(input!=null){
@@ -348,10 +336,6 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
 
     @PreDestroy
     public void dispose() {
-        if (conversation != null) {
-            conversation.close();
-            conversation = null;
-        }
         if(cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
@@ -365,9 +349,7 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
         if(composite!=null){
             composite.setFocus();
         }
-        if (getConversationHolder() != null) {
-            getConversationHolder().bind();
-        }
+
         if(cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
@@ -381,9 +363,7 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
         return descriptiveDataSet;
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
+    
 
     @Override
     public ICdmEntitySession getCdmEntitySession() {
@@ -400,11 +380,6 @@ public class DescriptiveDataSetEditor implements IE4SavablePart, IConversationEn
         return null;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     @Override
     public void changed(Object element) {
         dirty.setDirty(true);
index 59ec521c504f549c8d6b1d19c4c52ebaf46cc055..a3999d53ede413bc1043f2fcbae0f2928ecfe59a 100644 (file)
@@ -38,8 +38,6 @@ import org.eclipse.jface.viewers.ViewerComparator;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IMemento;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
@@ -57,7 +55,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class DescriptiveDataSetNavigator 
-               implements IConversationEnabled, ICdmEntitySessionEnabled<DescriptiveDataSet>, IContextListener{
+               implements ICdmEntitySessionEnabled<DescriptiveDataSet>, IContextListener{
 
     private ListViewer viewer;
 
@@ -66,8 +64,6 @@ public class DescriptiveDataSetNavigator
 
     private ISelectionChangedListener selectionChangedListener;
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     private List<DescriptiveDataSet> descriptiveDataSets;
@@ -121,9 +117,9 @@ public class DescriptiveDataSetNavigator
 
     public void init(){
         if (CdmStore.isActive()){
-            if(conversation == null) {
-                conversation = CdmStore.createConversation();
-            }
+//            if(conversation == null) {
+//                conversation = CdmStore.createConversation();
+//            }
             if(cdmEntitySession == null){
                 cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
             }
@@ -165,9 +161,7 @@ public class DescriptiveDataSetNavigator
         refresh();
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
+    
 
     @Override
     public ICdmEntitySession getCdmEntitySession() {
@@ -184,21 +178,13 @@ public class DescriptiveDataSetNavigator
         return null;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     public ESelectionService getSelService() {
         return selService;
     }
 
     @PreDestroy
     public void dispose() {
-        if (conversation != null) {
-            conversation.close();
-            conversation = null;
-        }
+        
         if(cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
@@ -207,9 +193,7 @@ public class DescriptiveDataSetNavigator
 
     @Focus
     public void setFocus() {
-        if (getConversationHolder() != null) {
-            getConversationHolder().bind();
-        }
+        
         if(cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
index 1502580c1e79b853d6560fa8af2fba874bef09fc..47875796f977fc20f7e7c94692c0bdc69fe919cb 100644 (file)
@@ -56,8 +56,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITermNodeService;
 import eu.etaxonomy.cdm.api.service.ITermTreeService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
@@ -76,10 +74,10 @@ import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.CharacterDto;
 import eu.etaxonomy.cdm.persistence.dto.CharacterNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.AppModelId;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermTreeViewerComparator;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
@@ -111,12 +109,12 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4ViewerPart;
 
 /**
  * Editor for combining structure and property terms to characters.
+ * 
  * @author pplitzner
  * @date 24.05.2017
  */
-public class CharacterEditor implements ICharacterEditor, IConversationEnabled, ISelectionChangedListener,
-        ModifyListener, IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData,
-        IDirtyMarkable, IE4SavablePart {
+public class CharacterEditor implements ICharacterEditor, ISelectionChangedListener, ModifyListener, IE4ViewerPart,
+        IPartContentHasDetails, IPartContentHasSupplementalData, IDirtyMarkable, IE4SavablePart {
 
     private TermTreeDtoEditorComposite characterTreeEditorComposite;
     private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
@@ -130,8 +128,6 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     @Inject
     private MDirtyable dirty;
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     private TermVocabulary vocabulary;
@@ -153,16 +149,15 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
      * Create contents of the view part.
      */
     @PostConstruct
-    public void createControls(Composite parent, EMenuService menuService ) {
-        if (CdmStore.isActive()){
-            if(conversation == null){
-                conversation = CdmStore.createConversation();
-            }
-            if(cdmEntitySession==null){
+    public void createControls(Composite parent, EMenuService menuService) {
+        if (CdmStore.isActive()) {
+            // if(conversation == null){
+            // conversation = CdmStore.createConversation();
+            // }
+            if (cdmEntitySession == null) {
                 cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
             }
-        }
-        else{
+        } else {
             return;
         }
         parent.setLayout(new GridLayout(1, false));
@@ -180,15 +175,19 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
             @Override
             public void widgetSelected(SelectionEvent e) {
-                // hard-coded filter for "built-in" vocabularies Feature and Name Feature
+                // hard-coded filter for "built-in" vocabularies Feature and
+                // Name Feature
                 Set<TermVocabulary> vocabulariesToBeFiltered = new HashSet<>();
-                vocabulariesToBeFiltered.add(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.Feature.getUuid()));
-                vocabulariesToBeFiltered.add(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()));
-                if(vocabulary!=null){
+                vocabulariesToBeFiltered
+                        .add(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.Feature.getUuid()));
+                vocabulariesToBeFiltered
+                        .add(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()));
+                if (vocabulary != null) {
                     vocabulariesToBeFiltered.add(vocabulary);
                 }
-                vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters", btnChooseVoc.getShell(), vocabulariesToBeFiltered, TermType.Character);
-                if(vocabulary!=null){
+                vocabulary = TermVocabularySelectionDialog.select("Select vocabulary for characters",
+                        btnChooseVoc.getShell(), vocabulariesToBeFiltered, TermType.Character);
+                if (vocabulary != null) {
                     txtVocabulary.setText(vocabulary.getLabel());
                 }
             }
@@ -219,7 +218,7 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         propertyViewer.addSelectionChangedListener(this);
 
         int ops = DND.DROP_COPY | DND.DROP_MOVE;
-        Transfer[] transfers = new Transfer[] {CharacterTransfer.getInstance()};
+        Transfer[] transfers = new Transfer[] { CharacterTransfer.getInstance() };
         propertyViewer.addDragSupport(ops, transfers, new CharacterDragListener(structureViewer, propertyViewer));
 
         Composite composite_3 = new Composite(sashForm, SWT.NONE);
@@ -242,42 +241,47 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         btnAddCharacter.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
-                if(!isVocabularySet()){
+                if (!isVocabularySet()) {
                     return;
                 }
-                if (confirmSaveDirty()){
+                if (confirmSaveDirty()) {
                     return;
                 }
                 ISelection structureTreeSelection = structureViewer.getSelection();
                 ISelection propertyTreeSelection = propertyViewer.getSelection();
-                if(structureTreeSelection==null || propertyTreeSelection==null || characterTreeEditorComposite.getFeatureTree()==null){
+                if (structureTreeSelection == null || propertyTreeSelection == null
+                        || characterTreeEditorComposite.getFeatureTree() == null) {
                     MessagingUtils.warningDialog(Messages.CharacterEditor_CANNOT_PERFORM_TITLE, CharacterEditor.this,
                             Messages.CharacterEditor_CANNOT_PERFORM_MESSAGE);
                     return;
                 }
-                Collection<Character> characters = createCharacters((TreeSelection)structureTreeSelection, (TreeSelection)propertyTreeSelection);
-                TermNodeDto parent = characterTreeEditorComposite.getFeatureTree().getRoot();
+                Collection<Character> characters = createCharacters((TreeSelection) structureTreeSelection,
+                        (TreeSelection) propertyTreeSelection);
+                TermNodeDto parent = ((TermTreeDto) characterTreeEditorComposite.getFeatureTree()).getRoot();
                 ISelection sel = characterTreeEditorComposite.getViewer().getSelection();
 
                 TermNodeDto parentNode = parent;
-                if (sel instanceof TreeSelection){
-                    TreeSelection treeSel = (TreeSelection)sel;
+                if (sel instanceof TreeSelection) {
+                    TreeSelection treeSel = (TreeSelection) sel;
                     Object o = treeSel.getFirstElement();
-                    if (o instanceof CharacterNodeDto){
-                        parentNode = (TermNodeDto)o;
+                    if (o instanceof CharacterNodeDto) {
+                        parentNode = (TermNodeDto) o;
                     }
                 }
 
                 for (Character character : characters) {
-                    //add new Character to feature tree
-                    CharacterNodeDto nodeDto = new CharacterNodeDto(CharacterDto.fromCharacter(character), parentNode, 0, parent.getTree(), null, null, null);
+                    // add new Character to feature tree
+                    TermTreeDto tree = (TermTreeDto)getTreeDtoForUuid(parent.getTreeUuid());
+                    CharacterNodeDto nodeDto = new CharacterNodeDto(CharacterDto.fromCharacter(character), parentNode,
+                            0, tree, null, 0, null, null);
                     nodesToSave.put(character, nodeDto);
                     setDirty();
-                    //   result = CdmStore.getService(ITermNodeService.class).createChildFeatureNode(parent.getUuid(), character, vocabulary.getUuid());
+                    // result =
+                    // CdmStore.getService(ITermNodeService.class).createChildFeatureNode(parent.getUuid(),
+                    // character, vocabulary.getUuid());
 
                 }
 
-
                 refresh();
             }
         });
@@ -294,20 +298,20 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
             @Override
             public void widgetSelected(SelectionEvent e) {
 
-                if (confirmSaveDirty()){
+                if (confirmSaveDirty()) {
                     return;
                 }
                 ISelection structureTreeSelection = structureViewer.getSelection();
                 ISelection characterSelection = characterTreeEditorComposite.getViewer().getSelection();
-                if(structureTreeSelection==null || characterSelection ==null){
+                if (structureTreeSelection == null || characterSelection == null) {
                     MessagingUtils.warningDialog(Messages.CharacterEditor_CANNOT_PERFORM_TITLE, CharacterEditor.this,
                             Messages.CharacterEditor_CANNOT_PERFORM_MESSAGE);
                     return;
                 }
 
-                CharacterNodeDto character = (CharacterNodeDto)((TreeSelection)characterSelection).getFirstElement();
-                TermNode ratioToNode = (TermNode)((TreeSelection)structureTreeSelection).getFirstElement();
-                if (character == null){
+                CharacterNodeDto character = (CharacterNodeDto) ((TreeSelection) characterSelection).getFirstElement();
+                TermNode ratioToNode = (TermNode) ((TreeSelection) structureTreeSelection).getFirstElement();
+                if (character == null) {
                     return;
                 }
                 TermDto termDto = character.getTerm();
@@ -315,30 +319,40 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
                 TermNodeDto property = null;
                 Representation structureRepresentation = null;
                 Representation propertyRepresentation = null;
-                Representation ratioToRepresentation = ratioToNode.getTerm().getRepresentation(CdmStore.getDefaultLanguage());
-                if (termDto instanceof CharacterDto){
-                    CharacterDto dto = (CharacterDto)termDto;
+                Representation ratioToRepresentation = ratioToNode.getTerm()
+                        .getRepresentation(CdmStore.getDefaultLanguage());
+                if (termDto instanceof CharacterDto) {
+                    CharacterDto dto = (CharacterDto) termDto;
                     dto.setRatioTo(TermNodeDto.fromNode(ratioToNode, null));
                     structure = dto.getStructure();
-                    structureRepresentation = structure.getTerm().getPreferredRepresentation(CdmStore.getDefaultLanguage());
+                    structureRepresentation = structure.getTerm()
+                            .getPreferredRepresentation(CdmStore.getDefaultLanguage());
                     property = dto.getProperty();
-                    propertyRepresentation = property.getTerm().getPreferredRepresentation(CdmStore.getDefaultLanguage());
+                    propertyRepresentation = property.getTerm()
+                            .getPreferredRepresentation(CdmStore.getDefaultLanguage());
                 }
 
                 String label = null;
                 String abbrevLabel = null;
 
-                if(structureRepresentation!=null && propertyRepresentation!=null){
-                    if(structureRepresentation.getLabel() != null && propertyRepresentation.getLabel() != null && ratioToRepresentation.getLabel() != null){
-                        label = propertyRepresentation.getLabel() + " ratio " +structureRepresentation.getLabel()+" to " +ratioToRepresentation.getLabel() ;
+                if (structureRepresentation != null && propertyRepresentation != null) {
+                    if (structureRepresentation.getLabel() != null && propertyRepresentation.getLabel() != null
+                            && ratioToRepresentation.getLabel() != null) {
+                        label = propertyRepresentation.getLabel() + " ratio " + structureRepresentation.getLabel()
+                                + " to " + ratioToRepresentation.getLabel();
                     }
-                    if(structureRepresentation.getAbbreviatedLabel()!=null && propertyRepresentation.getAbbreviatedLabel()!=null && ratioToRepresentation.getAbbreviatedLabel() != null){
-                        abbrevLabel = propertyRepresentation.getAbbreviatedLabel() + " ratio " +structureRepresentation.getAbbreviatedLabel()+ " to " + ratioToRepresentation.getAbbreviatedLabel();
+                    if (structureRepresentation.getAbbreviatedLabel() != null
+                            && propertyRepresentation.getAbbreviatedLabel() != null
+                            && ratioToRepresentation.getAbbreviatedLabel() != null) {
+                        abbrevLabel = propertyRepresentation.getAbbreviatedLabel() + " ratio "
+                                + structureRepresentation.getAbbreviatedLabel() + " to "
+                                + ratioToRepresentation.getAbbreviatedLabel();
                     }
                 }
-                if(label==null){
-                    //default label
-                    label = property.getTerm().getRepresentation_L10n()+ " ratio " +structure.getTerm().getRepresentation_L10n()+ " to " + ratioToNode.getTerm().getLabel() ;
+                if (label == null) {
+                    // default label
+                    label = property.getTerm().getRepresentation_L10n() + " ratio "
+                            + structure.getTerm().getRepresentation_L10n() + " to " + ratioToNode.getTerm().getLabel();
                 }
                 character.getTerm().getRepresentation(CdmStore.getDefaultLanguage()).setLabel(label);
                 character.getTerm().getRepresentation(CdmStore.getDefaultLanguage()).setAbbreviatedLabel(abbrevLabel);
@@ -354,13 +368,13 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         });
 
         characterTreeEditorComposite = addFeatureTreeEditor(composite_3);
-        initFeatureTreeComposite(TermType.Character, characterTreeEditorComposite, new TermNodeDtoDragListener(characterTreeEditorComposite.getViewer()),
-                new TermTreeDtoDropAdapter(this, characterTreeEditorComposite.getViewer(), sync),
-                null);
+        initFeatureTreeComposite(TermType.Character, characterTreeEditorComposite,
+                new TermNodeDtoDragListener(characterTreeEditorComposite.getViewer()),
+                new TermTreeDtoDropAdapter(this, characterTreeEditorComposite.getViewer(), sync), null);
 
         characterTreeEditorComposite.getLabel_title().setText(Messages.CharacterEditor_CHARACTERS);
 
-        //add context menu to character viewer
+        // add context menu to character viewer
         menuService.registerContextMenu(characterTreeEditorComposite.getViewer().getControl(),
                 AppModelId.POPUPMENU_EU_ETAXONOMY_TAXEDITOR_EDITOR_POPUPMENU_CHARACTEREDITOR);
 
@@ -376,19 +390,20 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         btnRefresh.setImage(ImageResources.getImage(ImageResources.REFRESH));
         btnRefresh.setToolTipText("Refresh");
 
-
         TreeViewer viewer = new TreeViewer(composite);
         viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
         viewer.setContentProvider(new TermTreeContentProvider());
         viewer.setLabelProvider(new TermTreeLabelProvider());
         viewer.setComparator(new TermTreeViewerComparator());
         viewer.addSelectionChangedListener(this);
-        viewer.setInput(CdmStore.getService(ITermTreeService.class).list(termType, null, null, null, TermTreeEditor.TREE_PROPERTY_PATH));
+        viewer.setInput(CdmStore.getService(ITermTreeService.class).list(termType, null, null, null,
+                TermTreeEditor.TREE_PROPERTY_PATH));
         btnRefresh.addSelectionListener(new SelectionAdapter() {
 
             @Override
             public void widgetSelected(SelectionEvent e) {
-                viewer.setInput(CdmStore.getService(ITermTreeService.class).list(termType, null, null, null, TermTreeEditor.TREE_PROPERTY_PATH));
+                viewer.setInput(CdmStore.getService(ITermTreeService.class).list(termType, null, null, null,
+                        TermTreeEditor.TREE_PROPERTY_PATH));
                 refresh(viewer);
             }
         });
@@ -401,75 +416,69 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         return TermTreeEditorComposite;
     }
 
-    private void initFeatureTreeComposite(
-            TermType termType,
-            TermTreeDtoEditorComposite TermTreeEditorComposite,
-            TermNodeDtoDragListener featureNodeDragListener,
-            TermTreeDtoDropAdapter featureNodeDropAdapter,
+    private void initFeatureTreeComposite(TermType termType, TermTreeDtoEditorComposite TermTreeEditorComposite,
+            TermNodeDtoDragListener featureNodeDragListener, TermTreeDtoDropAdapter featureNodeDropAdapter,
             Transfer[] transfers) {
 
-        TermTreeEditorComposite.init(
-                featureNodeDragListener,
-                featureNodeDropAdapter,
-                transfers,
-                this,
-                new FeatureTreeChooserListener(TermTreeEditorComposite, termType),
-                this);
+        TermTreeEditorComposite.init(featureNodeDragListener, featureNodeDropAdapter, transfers, this,
+                new FeatureTreeChooserListener(TermTreeEditorComposite, termType), this);
     }
 
     @Focus
-    public void focus(){
-        if(characterTreeEditorComposite!=null){
+    public void focus() {
+        if (characterTreeEditorComposite != null) {
             characterTreeEditorComposite.getViewer().getControl().setFocus();
         }
-        if(conversation!=null && !conversation.isBound()){
-            conversation.bind();
-        }
-        if(cdmEntitySession != null) {
+        if (cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
     }
 
-    public static Collection<Character> createCharacters(TreeSelection structureTreeSelection, TreeSelection propertyTreeSelection){
+    public static Collection<Character> createCharacters(TreeSelection structureTreeSelection,
+            TreeSelection propertyTreeSelection) {
         Set<Character> characters = new HashSet<>();
-        //get selected structures and properties
+        // get selected structures and properties
         Iterator<TermNode<DefinedTerm>> structureIterator = structureTreeSelection.iterator();
 
-        //create all combinations of structures and properties
-        while(structureIterator.hasNext()){
+        // create all combinations of structures and properties
+        while (structureIterator.hasNext()) {
             Object o = structureIterator.next();
             TermNode<DefinedTerm> structureNode = null;
-            if (o instanceof TermNode){
+            if (o instanceof TermNode) {
                 structureNode = (TermNode<DefinedTerm>) o;
-            }else{
+            } else {
                 return null;
 
             }
 
             Iterator<TermNode<DefinedTerm>> propertiesIterator = propertyTreeSelection.iterator();
-            while(propertiesIterator.hasNext()){
+            while (propertiesIterator.hasNext()) {
                 TermNode<DefinedTerm> propertyNode = propertiesIterator.next();
-                Representation structureRepresentation = structureNode.getTerm().getRepresentation(PreferencesUtil.getGlobalLanguage());
-                if(structureRepresentation==null){
+                Representation structureRepresentation = structureNode.getTerm()
+                        .getRepresentation(PreferencesUtil.getGlobalLanguage());
+                if (structureRepresentation == null) {
                     structureRepresentation = structureNode.getTerm().getRepresentation(Language.DEFAULT());
                 }
-                Representation propertyRepresentation = propertyNode.getTerm().getRepresentation(PreferencesUtil.getGlobalLanguage());
-                if(propertyRepresentation==null){
+                Representation propertyRepresentation = propertyNode.getTerm()
+                        .getRepresentation(PreferencesUtil.getGlobalLanguage());
+                if (propertyRepresentation == null) {
                     propertyRepresentation = propertyNode.getTerm().getRepresentation(Language.DEFAULT());
                 }
                 String label = null;
                 String abbrevLabel = null;
-                if(structureRepresentation!=null && propertyRepresentation!=null){
-                    if(structureRepresentation.getLabel()!=null && propertyRepresentation.getLabel()!=null){
-                        label = structureRepresentation.getLabel()+" "+propertyRepresentation.getLabel();
+                if (structureRepresentation != null && propertyRepresentation != null) {
+                    if (structureRepresentation.getLabel() != null && propertyRepresentation.getLabel() != null) {
+                        label = structureRepresentation.getLabel() + " " + propertyRepresentation.getLabel();
                     }
-                    if(structureRepresentation.getAbbreviatedLabel()!=null && propertyRepresentation.getAbbreviatedLabel()!=null){
-                        abbrevLabel = structureRepresentation.getAbbreviatedLabel()+" "+propertyRepresentation.getAbbreviatedLabel();
+                    if (structureRepresentation.getAbbreviatedLabel() != null
+                            && propertyRepresentation.getAbbreviatedLabel() != null) {
+                        abbrevLabel = structureRepresentation.getAbbreviatedLabel() + " "
+                                + propertyRepresentation.getAbbreviatedLabel();
                     }
                 }
-                if(label!=null){
-                    //default label
-                    label = structureNode.getTerm().getLabel()+" "+propertyNode.getTerm().getLabel();
+                if (label != null) {
+                    // default label
+                    label = structureNode.getTerm().getLabel() + " " + propertyNode.getTerm().getLabel();
                 }
                 Character character = Character.NewInstance(structureNode, propertyNode, null, label, abbrevLabel);
                 CharacterLabelBuilder labelBuilder = CharacterLabelBuilder.NewDefaultInstance();
@@ -485,42 +494,40 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
     @Override
     @Persist
-    public void save(IProgressMonitor monitor){
-        if (!conversation.isBound()) {
-            conversation.bind();
-        }
+    public void save(IProgressMonitor monitor) {
+
         UpdateResult result = new UpdateResult();
         if (nodesToSave != null && this.getVocabulary() != null) {
-            result.includeResult(CdmStore.getService(ITermNodeService.class).saveNewCharacterNodeDtoMap(this.nodesToSave, this.getVocabulary().getUuid()));
+            result.includeResult(CdmStore.getService(ITermNodeService.class)
+                    .saveNewCharacterNodeDtoMap(this.nodesToSave, this.getVocabulary().getUuid()));
         }
         nodesToSave.clear();
-        TermTreeDto featureTree = characterTreeEditorComposite.getFeatureTree();
-        if (operations != null && !operations.isEmpty()){
-            for (AbstractPostOperation<TermNode> operation: operations){
+        TermCollectionDto featureTree = characterTreeEditorComposite.getFeatureTree();
+        if (operations != null && !operations.isEmpty()) {
+            for (AbstractPostOperation<TermNode> operation : operations) {
                 AbstractUtility.executeOperation(operation, sync);
             }
             operations.clear();
-        }
-
-//      TODO: implement update method for dto
-
+        }        
+       
         result.includeResult(CdmStore.getService(ITermNodeService.class).saveCharacterNodeDtoList(this.nodesToUpdate));
+        
         nodesToUpdate.clear();
         // commit the conversation and start a new transaction immediately
-        conversation.commit(true);
-        if (result.getUpdatedObjects() != null && !result.getUpdatedObjects().isEmpty()){
+        // conversation.commit(true);
+        if (result.getUpdatedObjects() != null && !result.getUpdatedObjects().isEmpty()) {
             Object o = result.getUpdatedObjects().iterator().next();
-            if (o instanceof TermNode){
-                TermNode node = (TermNode)o;
-                TermTree updateTree = (TermTree)node.getGraph();
-                if (updateTree != null){
+            if (o instanceof TermNode) {
+                TermNode node = (TermNode) o;
+                TermTree updateTree = (TermTree) node.getGraph();
+                if (updateTree != null) {
                     characterTreeEditorComposite.setSelectedTree(updateTree);
                 }
             }
 
         }
 
-//        initializeTrees();
+        // initializeTrees();
 
         dirty.setDirty(false);
     }
@@ -537,12 +544,9 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     }
 
     @PreDestroy
-    public void dispose(){
-        if(conversation!=null){
-            conversation.close();
-            conversation = null;
-        }
-        if(cdmEntitySession != null) {
+    public void dispose() {
+
+        if (cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
         }
@@ -550,13 +554,14 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     }
 
     public boolean isVocabularySet() {
-        if(vocabulary==null){
-            MessagingUtils.warningDialog("Character creation not possible", this.getClass(), "Please select a vocabulary for the characters.");
+        if (vocabulary == null) {
+            MessagingUtils.warningDialog("Character creation not possible", this.getClass(),
+                    "Please select a vocabulary for the characters.");
         }
-        return vocabulary!=null;
+        return vocabulary != null;
     }
 
-    public boolean confirmSaveDirty(){
+    public boolean confirmSaveDirty() {
         return StoreUtil.promptCheckIsDirty(this);
     }
 
@@ -566,20 +571,18 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
     @Override
     public Map<Object, List<String>> getPropertyPathsMap() {
-        List<String> propertyPaths = Arrays.asList(new String[] {
-                "children", //$NON-NLS-1$
+        List<String> propertyPaths = Arrays.asList(new String[] { "children", //$NON-NLS-1$
                 "feature", //$NON-NLS-1$
                 "featureTree", //$NON-NLS-1$
         });
-        Map<Object, List<String>> propertyPathMap =
-                new HashMap<Object, List<String>>();
-        propertyPathMap.put(TermNode.class,propertyPaths);
+        Map<Object, List<String>> propertyPathMap = new HashMap<Object, List<String>>();
+        propertyPathMap.put(TermNode.class, propertyPaths);
         return propertyPathMap;
     }
 
     @Override
-    public List<TermTreeDto> getRootEntities() {
-        List<TermTreeDto> root = new ArrayList<>();
+    public List<TermCollectionDto> getRootEntities() {
+        List<TermCollectionDto> root = new ArrayList<>();
         root.add(characterTreeEditorComposite.getFeatureTree());
         return root;
     }
@@ -589,45 +592,45 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         return cdmEntitySession;
     }
 
-
     @Focus
     public void setFocus() {
-        if(conversation!=null && !conversation.isBound()){
-            conversation.bind();
-        }
+
     }
 
     @Override
     public void selectionChanged(SelectionChangedEvent event) {
-        //propagate selection
+        // propagate selection
         selService.setSelection(event.getSelection());
         ISelection selStructure = null;
         ISelection selProperty = null;
         selStructure = structureViewer.getSelection();
         selProperty = propertyViewer.getSelection();
 
-        if (selStructure != null && selProperty != null && selStructure instanceof TreeSelection && selProperty instanceof TreeSelection && ((TreeSelection)selStructure).getFirstElement() instanceof TermNode && ((TreeSelection)selProperty).getFirstElement() instanceof TermNode && this.vocabulary != null) {
+        if (selStructure != null && selProperty != null && selStructure instanceof TreeSelection
+                && selProperty instanceof TreeSelection
+                && ((TreeSelection) selStructure).getFirstElement() instanceof TermNode
+                && ((TreeSelection) selProperty).getFirstElement() instanceof TermNode && this.vocabulary != null) {
             btnAddCharacter.setEnabled(true);
-        }else {
+        } else {
             btnAddCharacter.setEnabled(false);
         }
         ISelection selCharacter = this.characterTreeEditorComposite.getViewer().getSelection();
-        if (selStructure != null && selCharacter != null && selStructure instanceof TreeSelection && selCharacter instanceof TreeSelection && ((TreeSelection)selStructure).getFirstElement() instanceof TermNode && ((TreeSelection)selCharacter).getFirstElement() instanceof CharacterNodeDto) {
+        if (selStructure != null && selCharacter != null && selStructure instanceof TreeSelection
+                && selCharacter instanceof TreeSelection
+                && ((TreeSelection) selStructure).getFirstElement() instanceof TermNode
+                && ((TreeSelection) selCharacter).getFirstElement() instanceof CharacterNodeDto) {
             btnAddRatioTo.setEnabled(true);
-        }else {
+        } else {
             btnAddRatioTo.setEnabled(false);
         }
     }
 
-
     @Override
     public void modifyText(ModifyEvent e) {
         characterTreeEditorComposite.getFeatureTree().setTitleCache(((Text) e.widget).getText());
         setDirty();
     }
 
-
-
     @Override
     public void setDirty() {
         dirty.setDirty(true);
@@ -638,28 +641,27 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
         return (IStructuredSelection) characterTreeEditorComposite.getViewer().getSelection();
     }
 
-
     @Override
     public TermType getTermType() {
         return TermType.Character;
     }
 
-    public TermTreeDto getCharacterTree(){
+    public TermCollectionDto getCharacterTree() {
         return characterTreeEditorComposite.getFeatureTree();
     }
 
-
-    public void refresh(TreeViewer viewer){
+    public void refresh(TreeViewer viewer) {
         viewer.refresh();
 
         characterTreeEditorComposite.getViewer().setInput(characterTreeEditorComposite.getViewer().getInput());
     }
 
-    private class FeatureTreeChooserListener extends SelectionAdapter{
+    private class FeatureTreeChooserListener extends SelectionAdapter {
         private TermTreeDtoEditorComposite<Feature> TermTreeEditorComposite;
         private TermType termType;
 
-        public FeatureTreeChooserListener(TermTreeDtoEditorComposite<Feature> TermTreeEditorComposite, TermType termType) {
+        public FeatureTreeChooserListener(TermTreeDtoEditorComposite<Feature> TermTreeEditorComposite,
+                TermType termType) {
             super();
             this.TermTreeEditorComposite = TermTreeEditorComposite;
             this.termType = termType;
@@ -667,23 +669,15 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
         @Override
         public void widgetSelected(SelectionEvent e) {
-            TermTree tree = FeatureTreeSelectionDialog.select(TermTreeEditorComposite.getDisplay().getActiveShell(), null, termType);
-            if(tree!=null){
+            TermTree tree = FeatureTreeSelectionDialog.select(TermTreeEditorComposite.getDisplay().getActiveShell(),
+                    null, termType);
+            if (tree != null) {
                 cdmEntitySession.load(tree, true);
                 TermTreeEditorComposite.setSelectedTree(tree);
             }
         }
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     @Override
     public void changed(Object element) {
         setDirty();
@@ -698,7 +692,7 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     @Override
     public boolean postOperation(Object objectAffectedByOperation) {
         characterTreeEditorComposite.getViewer().refresh();
-        if(objectAffectedByOperation instanceof TermNode){
+        if (objectAffectedByOperation instanceof TermNode) {
             StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
             characterTreeEditorComposite.getViewer().setSelection(selection);
         }
@@ -719,8 +713,8 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     }
 
     @Override
-    public TermNodeDto getNodeDtoForUuid(UUID nodeUuid){
-        return (TermNodeDto)this.characterTreeEditorComposite.getNodeUuidMap().get(nodeUuid);
+    public TermNodeDto getNodeDtoForUuid(UUID nodeUuid) {
+        return (TermNodeDto) this.characterTreeEditorComposite.getNodeUuidMap().get(nodeUuid);
 
     }
 
@@ -732,10 +726,11 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
     @Inject
     @Optional
-    private void addSaveCandidate(@UIEventTopic(WorkbenchEventConstants.ADD_SAVE_CHARACTER) CharacterNodeDto characterNodeDto) {
+    private void addSaveCandidate(
+            @UIEventTopic(WorkbenchEventConstants.ADD_SAVE_CHARACTER) CharacterNodeDto characterNodeDto) {
 
-        if (characterNodeDto != null){
-            if (nodesToUpdate.contains(characterNodeDto)){
+        if (characterNodeDto != null) {
+            if (nodesToUpdate.contains(characterNodeDto)) {
                 nodesToUpdate.remove(characterNodeDto);
             }
             nodesToUpdate.add(characterNodeDto);
@@ -749,8 +744,8 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
     }
 
     @Override
-    public TermTreeDto getTreeDtoForUuid(UUID treeUuid) {
-        if (this.characterTreeEditorComposite.getFeatureTree().getUuid().equals(treeUuid)){
+    public TermCollectionDto getTreeDtoForUuid(UUID treeUuid) {
+        if (this.characterTreeEditorComposite.getFeatureTree().getUuid().equals(treeUuid)) {
             return this.characterTreeEditorComposite.getFeatureTree();
         }
         return null;
@@ -758,8 +753,8 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
     @Override
     public boolean checkDuplicates(UUID termUuid, UUID treeUuid) {
-        for (TermDto dto: characterTreeEditorComposite.getFeatureTree().getTerms()){
-            if (dto != null && dto.getUuid().equals(termUuid)){
+        for (TermDto dto : characterTreeEditorComposite.getFeatureTree().getTerms()) {
+            if (dto != null && dto.getUuid().equals(termUuid)) {
                 return true;
             }
         }
@@ -778,7 +773,4 @@ public class CharacterEditor implements ICharacterEditor, IConversationEnabled,
 
     }
 
-
-
-
 }
index ffad6db60f5ceb569ef4295f2d7378b589371057..8516e72569d8cb3a4540e1edfcff41eadb87d53b 100644 (file)
@@ -35,7 +35,6 @@ public class CreateDescriptiveDataSetHandler {
                DescriptiveDataSet descriptiveDataSet = DescriptiveDataSet.NewInstance();
                descriptiveDataSet.setLabel(dataSetName);
                CdmStore.getService(IDescriptiveDataSetService.class).merge(descriptiveDataSet, true);
-               navigator.getConversationHolder().commit();
                navigator.addDescriptiveDataSet(descriptiveDataSet);
                EditorUtil.openDescriptiveDataSetEditor(descriptiveDataSet.getUuid(), modelService, partService, application);
            }
index 18c8fd5c344ed5047e217d0a1dd2bb6592e14987..1b048e0bd18065c017d53a78041d7051a615ac56 100644 (file)
@@ -66,7 +66,6 @@ public class DeleteDescriptiveDataSetHandler {
                     deleteDescriptiveDataSet(((DescriptiveDataSet) next).getUuid(), deleteConfig);
                     DescriptiveDataSetNavigator navigator = (DescriptiveDataSetNavigator) object;
                     navigator.removeDescriptiveDataSet((DescriptiveDataSet) next);
-                    navigator.getConversationHolder().commit();
                     navigator.getSelService().setSelection(null);
                 }else{
                     MessagingUtils.errorDialog(Messages.DeleteDescriptiveDataSetHandler_DELETE_FAILED_TITLE, DeleteDescriptiveDataSetHandler.class, Messages.DeleteDescriptiveDataSetHandler_DELETE_FAILED_MESSAGE, TaxeditorEditorPlugin.PLUGIN_ID, null, false);
index d84cc8ae208a206384c2a6e885b7e5d41c7c2c14..25e46d498b41fc2580a9c78181977afb2adf122b 100644 (file)
@@ -14,41 +14,40 @@ import java.util.List;
 import org.apache.commons.math3.stat.Frequency;
 
 import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 
 /**
  * @author pplitzner
  * @since Jul 12, 2018
- *
  */
 public class CategoricalDataHistogram {
 
     private Feature feature;
     private Frequency frequency;
-    private List<State> states;
+    private List<DefinedTermBase<?>> states;
 
     public CategoricalDataHistogram(Feature feature) {
         this.feature = feature;
         this.states = new ArrayList<>();
         this.frequency = new Frequency();
         feature.getSupportedCategoricalEnumerations()
-        .forEach(voc->voc.getTerms()
+            .forEach(terms->terms.getDistinctTerms()
                 .forEach(state->states.add(state)));
     }
 
-    public void addState(State state){
+    public void addState(DefinedTermBase<?> state){
         frequency.addValue(state.getLabel());
     }
 
-    public long getCount(State state){
+    public long getCount(DefinedTermBase<?> state){
         return frequency.getCount(state.getLabel());
     }
 
-    public List<State> getStates() {
+    public List<DefinedTermBase<?>> getStates() {
         return states;
     }
 
     public Feature getFeature() {
         return feature;
     }
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CdmContentProposalAdapter.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CdmContentProposalAdapter.java
new file mode 100644 (file)
index 0000000..e4a189b
--- /dev/null
@@ -0,0 +1,2189 @@
+package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
+
+/*******************************************************************************
+ * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Hannes Erven <hannes@erven.at> - Bug 293841 - [FieldAssist] NumLock keyDown event should not close the proposal popup [with patch]
+ *******************************************************************************/
+
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.bindings.keys.KeyStroke;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalListener;
+import org.eclipse.jface.fieldassist.IContentProposalListener2;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.fieldassist.IControlContentAdapter;
+import org.eclipse.jface.fieldassist.IControlContentAdapter2;
+import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
+import org.eclipse.jface.preference.JFacePreferences;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.Util;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * ContentProposalAdapter can be used to attach content proposal behavior to a
+ * control. This behavior includes obtaining proposals, opening a popup dialog,
+ * managing the content of the control relative to the selections in the popup,
+ * and optionally opening up a secondary popup to further describe proposals.
+ * <p>
+ * A number of configurable options are provided to determine how the control
+ * content is altered when a proposal is chosen, how the content proposal popup
+ * is activated, and whether any filtering should be done on the proposals as
+ * the user types characters.
+ * <p>
+ * This class provides some overridable methods to allow clients to manually
+ * control the popup. However, most of the implementation remains private.
+ *
+ * 
+ */
+public class CdmContentProposalAdapter {
+
+       /*
+        * The lightweight popup used to show content proposals for a text field. If
+        * additional information exists for a proposal, then selecting that
+        * proposal will result in the information being displayed in a secondary
+        * popup.
+        */
+       class ContentProposalPopup extends PopupDialog {
+               /*
+                * The listener we install on the popup and related controls to
+                * determine when to close the popup. Some events (move, resize, close,
+                * deactivate) trigger closure as soon as they are received, simply
+                * because one of the registered listeners received them. Other events
+                * depend on additional circumstances.
+                */
+               private final class PopupCloserListener implements Listener {
+                       private boolean scrollbarClicked = false;
+
+                       @Override
+                       public void handleEvent(final Event e) {
+
+                               // If focus is leaving an important widget or the field's
+                               // shell is deactivating
+                               if (e.type == SWT.FocusOut) {
+                                       scrollbarClicked = false;
+                                       /*
+                                        * Ignore this event if it's only happening because focus is
+                                        * moving between the popup shells, their controls, or a
+                                        * scrollbar. Do this in an async since the focus is not
+                                        * actually switched when this event is received.
+                                        */
+                                       e.display.asyncExec(() -> {
+                                               if (isValid()) {
+                                                       if (scrollbarClicked || hasFocus()) {
+                                                               return;
+                                                       }
+                                                       // Workaround a problem on X and Mac, whereby at
+                                                       // this point, the focus control is not known.
+                                                       // This can happen, for example, when resizing
+                                                       // the popup shell on the Mac.
+                                                       // Check the active shell.
+                                                       Shell activeShell = e.display.getActiveShell();
+                                                       if (activeShell == getShell()
+                                                                       || (infoPopup != null && infoPopup
+                                                                                       .getShell() == activeShell)) {
+                                                               return;
+                                                       }
+                                                       /*
+                                                        * System.out.println(e);
+                                                        * System.out.println(e.display.getFocusControl());
+                                                        * System.out.println(e.display.getActiveShell());
+                                                        */
+                                                       close();
+                                               }
+                                       });
+                                       return;
+                               }
+
+                               // Scroll bar has been clicked. Remember this for focus event
+                               // processing.
+                               if (e.type == SWT.Selection) {
+                                       scrollbarClicked = true;
+                                       return;
+                               }
+                               // For all other events, merely getting them dictates closure.
+                               close();
+                       }
+
+                       // Install the listeners for events that need to be monitored for
+                       // popup closure.
+                       void installListeners() {
+                               // Listeners on this popup's table and scroll bar
+                               proposalTable.addListener(SWT.FocusOut, this);
+                               ScrollBar scrollbar = proposalTable.getVerticalBar();
+                               if (scrollbar != null) {
+                                       scrollbar.addListener(SWT.Selection, this);
+                               }
+
+                               // Listeners on this popup's shell
+                               getShell().addListener(SWT.Deactivate, this);
+                               getShell().addListener(SWT.Close, this);
+
+                               // Listeners on the target control
+                               control.addListener(SWT.MouseDoubleClick, this);
+                               control.addListener(SWT.MouseDown, this);
+                               control.addListener(SWT.Dispose, this);
+                               control.addListener(SWT.FocusOut, this);
+                               // Listeners on the target control's shell
+                               Shell controlShell = control.getShell();
+                               controlShell.addListener(SWT.Move, this);
+                               controlShell.addListener(SWT.Resize, this);
+
+                       }
+
+                       // Remove installed listeners
+                       void removeListeners() {
+                               if (isValid()) {
+                                       proposalTable.removeListener(SWT.FocusOut, this);
+                                       ScrollBar scrollbar = proposalTable.getVerticalBar();
+                                       if (scrollbar != null) {
+                                               scrollbar.removeListener(SWT.Selection, this);
+                                       }
+
+                                       getShell().removeListener(SWT.Deactivate, this);
+                                       getShell().removeListener(SWT.Close, this);
+                               }
+
+                               if (control != null && !control.isDisposed()) {
+
+                                       control.removeListener(SWT.MouseDoubleClick, this);
+                                       control.removeListener(SWT.MouseDown, this);
+                                       control.removeListener(SWT.Dispose, this);
+                                       control.removeListener(SWT.FocusOut, this);
+
+                                       Shell controlShell = control.getShell();
+                                       controlShell.removeListener(SWT.Move, this);
+                                       controlShell.removeListener(SWT.Resize, this);
+                               }
+                       }
+               }
+
+               /*
+                * The listener we will install on the target control.
+                */
+               private final class TargetControlListener implements Listener {
+                       // Key events from the control
+                       @Override
+                       public void handleEvent(Event e) {
+                               if (!isValid()) {
+                                       return;
+                               }
+
+                               char key = e.character;
+
+                               // Traverse events are handled depending on whether the
+                               // event has a character.
+                               if (e.type == SWT.Traverse) {
+                                       // If the traverse event contains a legitimate character,
+                                       // then we must set doit false so that the widget will
+                                       // receive the key event. We return immediately so that
+                                       // the character is handled only in the key event.
+                                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=132101
+                                       if (key != 0) {
+                                               e.doit = false;
+                                               return;
+                                       }
+                                       // Traversal does not contain a character. Set doit true
+                                       // to indicate TRAVERSE_NONE will occur and that no key
+                                       // event will be triggered. We will check for navigation
+                                       // keys below.
+                                       e.detail = SWT.TRAVERSE_NONE;
+                                       e.doit = true;
+                               } else {
+                                       // Default is to only propagate when configured that way.
+                                       // Some keys will always set doit to false anyway.
+                                       e.doit = propagateKeys;
+                               }
+
+                               // No character. Check for navigation keys.
+
+                               if (key == 0) {
+                                       int newSelection = proposalTable.getSelectionIndex();
+                                       int visibleRows = (proposalTable.getSize().y / proposalTable
+                                                       .getItemHeight()) - 1;
+                                       switch (e.keyCode) {
+                                       case SWT.ARROW_UP:
+                                               newSelection -= 1;
+                                               if (newSelection < 0) {
+                                                       newSelection = proposalTable.getItemCount() - 1;
+                                               }
+                                               // Not typical - usually we get this as a Traverse and
+                                               // therefore it never propagates. Added for consistency.
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+
+                                               break;
+
+                                       case SWT.ARROW_DOWN:
+                                               newSelection += 1;
+                                               if (newSelection > proposalTable.getItemCount() - 1) {
+                                                       newSelection = 0;
+                                               }
+                                               // Not typical - usually we get this as a Traverse and
+                                               // therefore it never propagates. Added for consistency.
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+
+                                               break;
+
+                                       case SWT.PAGE_DOWN:
+                                               newSelection += visibleRows;
+                                               if (newSelection >= proposalTable.getItemCount()) {
+                                                       newSelection = proposalTable.getItemCount() - 1;
+                                               }
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+                                               break;
+
+                                       case SWT.PAGE_UP:
+                                               newSelection -= visibleRows;
+                                               if (newSelection < 0) {
+                                                       newSelection = 0;
+                                               }
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+                                               break;
+
+                                       case SWT.HOME:
+                                               newSelection = 0;
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+                                               break;
+
+                                       case SWT.END:
+                                               newSelection = proposalTable.getItemCount() - 1;
+                                               if (e.type == SWT.KeyDown) {
+                                                       // don't propagate to control
+                                                       e.doit = false;
+                                               }
+                                               break;
+
+                                       // If received as a Traverse, these should propagate
+                                       // to the control as keydown. If received as a keydown,
+                                       // proposals should be recomputed since the cursor
+                                       // position has changed.
+                                       case SWT.ARROW_LEFT:
+                                       case SWT.ARROW_RIGHT:
+                                               if (e.type == SWT.Traverse) {
+                                                       e.doit = false;
+                                               } else {
+                                                       e.doit = true;
+                                                       String contents = getControlContentAdapter()
+                                                                       .getControlContents(getControl());
+                                                       // If there are no contents, changes in cursor
+                                                       // position have no effect. Note also that we do
+                                                       // not affect the filter text on ARROW_LEFT as
+                                                       // we would with BS.
+                                                       if (contents.length() > 0) {
+                                                               asyncRecomputeProposals(filterText);
+                                                       }
+                                               }
+                                               break;
+
+                                       // Any unknown keycodes will cause the popup to close.
+                                       // Modifier keys are explicitly checked and ignored because
+                                       // they are not complete yet (no character).
+                                       default:
+                                               if (e.keyCode != SWT.CAPS_LOCK && e.keyCode != SWT.NUM_LOCK
+                                                               && e.keyCode != SWT.MOD1
+                                                               && e.keyCode != SWT.MOD2
+                                                               && e.keyCode != SWT.MOD3
+                                                               && e.keyCode != SWT.MOD4) {
+                                                       close();
+                                               }
+                                               return;
+                                       }
+
+                                       // If any of these navigation events caused a new selection,
+                                       // then handle that now and return.
+                                       if (newSelection >= 0) {
+                                               selectProposal(newSelection);
+                                       }
+                                       return;
+                               }
+
+                               // key != 0
+                               // Check for special keys involved in cancelling, accepting, or
+                               // filtering the proposals.
+                               switch (key) {
+                               case SWT.ESC:
+                                       e.doit = false;
+                                       close();
+                                       break;
+
+                               case SWT.LF:
+                               case SWT.CR:
+                                       e.doit = false;
+                                       Object p = getSelectedProposal();
+                                       if (p != null) {
+                                               acceptCurrentProposal();
+                                       } else {
+                                               close();
+                                       }
+                                       break;
+
+                               case SWT.TAB:
+                                       e.doit = false;
+                                       getShell().setFocus();
+                                       return;
+
+                               case SWT.BS:
+                                       // Backspace should back out of any stored filter text
+                                       if (filterStyle != FILTER_NONE) {
+                                               // We have no filter to back out of, so do nothing
+                                               if (filterText.length() == 0) {
+                                                       return;
+                                               }
+                                               // There is filter to back out of
+                                               filterText = filterText.substring(0, filterText
+                                                               .length() - 1);
+                                               asyncRecomputeProposals(filterText);
+                                               return;
+                                       }
+                                       // There is no filtering provided by us, but some
+                                       // clients provide their own filtering based on content.
+                                       // Recompute the proposals if the cursor position
+                                       // will change (is not at 0).
+                                       int pos = getControlContentAdapter().getCursorPosition(
+                                                       getControl());
+                                       // We rely on the fact that the contents and pos do not yet
+                                       // reflect the result of the BS. If the contents were
+                                       // already empty, then BS should not cause
+                                       // a recompute.
+                                       if (pos > 0) {
+                                               asyncRecomputeProposals(filterText);
+                                       }
+                                       break;
+
+                               default:
+                                       // If the key is a defined unicode character, and not one of
+                                       // the special cases processed above, update the filter text
+                                       // and filter the proposals.
+                                       if (Character.isDefined(key)) {
+                                               if (filterStyle == FILTER_CUMULATIVE) {
+                                                       filterText = filterText + String.valueOf(key);
+                                               } else if (filterStyle == FILTER_CHARACTER) {
+                                                       filterText = String.valueOf(key);
+                                               }
+                                               // Recompute proposals after processing this event.
+                                               asyncRecomputeProposals(filterText);
+                                       }
+                                       break;
+                               }
+                       }
+               }
+
+               /*
+                * Internal class used to implement the secondary popup.
+                */
+               private class InfoPopupDialog extends PopupDialog {
+
+                       /*
+                        * The text control that displays the text.
+                        */
+                       private Text text;
+
+                       /*
+                        * The String shown in the popup.
+                        */
+                       private String contents = EMPTY;
+
+                       /*
+                        * Construct an info-popup with the specified parent.
+                        */
+                       InfoPopupDialog(Shell parent) {
+                               super(parent, PopupDialog.HOVER_SHELLSTYLE, false, false, false,
+                                               false, false, null, null);
+                       }
+
+                       /*
+                        * Create a text control for showing the info about a proposal.
+                        */
+                       @Override
+                       protected Control createDialogArea(Composite parent) {
+                               text = new Text(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP
+                                               | SWT.NO_FOCUS);
+
+                               // Use the compact margins employed by PopupDialog.
+                               GridData gd = new GridData(GridData.BEGINNING
+                                               | GridData.FILL_BOTH);
+                               gd.horizontalIndent = PopupDialog.POPUP_HORIZONTALSPACING;
+                               gd.verticalIndent = PopupDialog.POPUP_VERTICALSPACING;
+                               text.setLayoutData(gd);
+                               text.setText(contents);
+
+                               // since SWT.NO_FOCUS is only a hint...
+                               text.addFocusListener(new FocusAdapter() {
+                                       @Override
+                                       public void focusGained(FocusEvent event) {
+                                               ContentProposalPopup.this.close();
+                                       }
+                               });
+                               return text;
+                       }
+
+                       /*
+                        * Adjust the bounds so that we appear adjacent to our parent shell
+                        */
+                       @Override
+                       protected void adjustBounds() {
+                               Rectangle parentBounds = getParentShell().getBounds();
+                               Rectangle proposedBounds;
+                               // Try placing the info popup to the right
+                               Rectangle rightProposedBounds = new Rectangle(parentBounds.x
+                                               + parentBounds.width
+                                               + PopupDialog.POPUP_HORIZONTALSPACING, parentBounds.y
+                                               + PopupDialog.POPUP_VERTICALSPACING,
+                                               parentBounds.width, parentBounds.height);
+                               rightProposedBounds = getConstrainedShellBounds(rightProposedBounds);
+                               // If it won't fit on the right, try the left
+                               if (rightProposedBounds.intersects(parentBounds)) {
+                                       Rectangle leftProposedBounds = new Rectangle(parentBounds.x
+                                                       - parentBounds.width - POPUP_HORIZONTALSPACING - 1,
+                                                       parentBounds.y, parentBounds.width,
+                                                       parentBounds.height);
+                                       leftProposedBounds = getConstrainedShellBounds(leftProposedBounds);
+                                       // If it won't fit on the left, choose the proposed bounds
+                                       // that fits the best
+                                       if (leftProposedBounds.intersects(parentBounds)) {
+                                               if (rightProposedBounds.x - parentBounds.x >= parentBounds.x
+                                                               - leftProposedBounds.x) {
+                                                       rightProposedBounds.x = parentBounds.x
+                                                                       + parentBounds.width
+                                                                       + PopupDialog.POPUP_HORIZONTALSPACING;
+                                                       proposedBounds = rightProposedBounds;
+                                               } else {
+                                                       leftProposedBounds.width = parentBounds.x
+                                                                       - POPUP_HORIZONTALSPACING
+                                                                       - leftProposedBounds.x;
+                                                       proposedBounds = leftProposedBounds;
+                                               }
+                                       } else {
+                                               // use the proposed bounds on the left
+                                               proposedBounds = leftProposedBounds;
+                                       }
+                               } else {
+                                       // use the proposed bounds on the right
+                                       proposedBounds = rightProposedBounds;
+                               }
+                               getShell().setBounds(proposedBounds);
+                       }
+
+                       @Override
+                       protected Color getForeground() {
+                               return control.getDisplay().
+                                               getSystemColor(SWT.COLOR_INFO_FOREGROUND);
+                       }
+
+                       @Override
+                       protected Color getBackground() {
+                               return control.getDisplay().
+                                               getSystemColor(SWT.COLOR_INFO_BACKGROUND);
+                       }
+
+                       /*
+                        * Set the text contents of the popup.
+                        */
+                       void setContents(String newContents) {
+                               if (newContents == null) {
+                                       newContents = EMPTY;
+                               }
+                               this.contents = newContents;
+                               if (text != null && !text.isDisposed()) {
+                                       text.setText(contents);
+                               }
+                       }
+
+                       /*
+                        * Return whether the popup has focus.
+                        */
+                       boolean hasFocus() {
+                               if (text == null || text.isDisposed()) {
+                                       return false;
+                               }
+                               return text.getShell().isFocusControl()
+                                               || text.isFocusControl();
+                       }
+               }
+
+               /*
+                * The listener installed on the target control.
+                */
+               private Listener targetControlListener;
+
+               /*
+                * The listener installed in order to close the popup.
+                */
+               private PopupCloserListener popupCloser;
+
+               /*
+                * The table used to show the list of proposals.
+                */
+               private Table proposalTable;
+
+               /*
+                * The proposals to be shown (cached to avoid repeated requests).
+                */
+               private IContentProposal[] proposals;
+
+               /*
+                * Secondary popup used to show detailed information about the selected
+                * proposal..
+                */
+               private InfoPopupDialog infoPopup;
+
+               /*
+                * Flag indicating whether there is a pending secondary popup update.
+                */
+               private boolean pendingDescriptionUpdate = false;
+
+               /*
+                * Filter text - tracked while popup is open, only if we are told to
+                * filter
+                */
+               private String filterText = EMPTY;
+
+               /**
+                * Constructs a new instance of this popup, specifying the control for
+                * which this popup is showing content, and how the proposals should be
+                * obtained and displayed.
+                *
+                * @param infoText
+                *            Text to be shown in a lower info area, or
+                *            <code>null</code> if there is no info area.
+                */
+               ContentProposalPopup(String infoText, IContentProposal[] proposals) {
+                       // IMPORTANT: Use of SWT.ON_TOP is critical here for ensuring
+                       // that the target control retains focus on Mac and Linux. Without
+                       // it, the focus will disappear, keystrokes will not go to the
+                       // popup, and the popup closer will wrongly close the popup.
+                       // On platforms where SWT.ON_TOP overrides SWT.RESIZE, we will live
+                       // with this.
+                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=126138
+                       super(control.getShell(), SWT.RESIZE | SWT.ON_TOP, false, false, false,
+                                       false, false, null, infoText);
+                       this.proposals = proposals;
+               }
+
+               @Override
+               protected Color getForeground() {
+                       return JFaceResources.getColorRegistry().get(
+                                       JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
+               }
+
+               @Override
+               protected Color getBackground() {
+                       return JFaceResources.getColorRegistry().get(
+                                       JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
+               }
+
+               /*
+                * Creates the content area for the proposal popup. This creates a table
+                * and places it inside the composite. The table will contain a list of
+                * all the proposals.
+                *
+                * @param parent The parent composite to contain the dialog area; must
+                * not be <code>null</code>.
+                */
+               @Override
+               protected final Control createDialogArea(final Composite parent) {
+                       // Use virtual where appropriate (see flag definition).
+                       if (USE_VIRTUAL) {
+                               proposalTable = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL
+                                               | SWT.VIRTUAL);
+
+                               Listener listener = event -> handleSetData(event);
+                               proposalTable.addListener(SWT.SetData, listener);
+                       } else {
+                               proposalTable = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+                       }
+
+                       // set the proposals to force population of the table.
+                       setProposals(filterProposals(proposals, filterText));
+
+                       proposalTable.setHeaderVisible(false);
+                       proposalTable.addSelectionListener(new SelectionListener() {
+
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       // If a proposal has been selected, show it in the secondary
+                                       // popup. Otherwise close the popup.
+                                       if (e.item == null) {
+                                               if (infoPopup != null) {
+                                                       infoPopup.close();
+                                               }
+                                       } else {
+                                               showProposalDescription();
+                                       }
+                               }
+
+                               // Default selection was made. Accept the current proposal.
+                               @Override
+                               public void widgetDefaultSelected(SelectionEvent e) {
+                                       acceptCurrentProposal();
+                               }
+                       });
+                       return proposalTable;
+               }
+
+               @Override
+               protected void adjustBounds() {
+                       // Get our control's location in display coordinates.
+                       Point location = control.getDisplay().map(control.getParent(), null, control.getLocation());
+                       int initialX = location.x + POPUP_OFFSET;
+                       int initialY = location.y + control.getSize().y + POPUP_OFFSET;
+                       // If we are inserting content, use the cursor position to
+                       // position the control.
+                       if (getProposalAcceptanceStyle() == PROPOSAL_INSERT) {
+                               Rectangle insertionBounds = controlContentAdapter
+                                               .getInsertionBounds(control);
+                               initialX = initialX + insertionBounds.x;
+                               initialY = location.y + insertionBounds.y
+                                               + insertionBounds.height;
+                       }
+
+                       // If there is no specified size, force it by setting
+                       // up a layout on the table.
+                       if (popupSize == null) {
+                               GridData data = new GridData(GridData.FILL_BOTH);
+                               data.heightHint = proposalTable.getItemHeight()
+                                               * POPUP_CHAR_HEIGHT;
+                               data.widthHint = Math.max(control.getSize().x,
+                                               POPUP_MINIMUM_WIDTH);
+                               proposalTable.setLayoutData(data);
+                               getShell().pack();
+                               popupSize = getShell().getSize();
+                       }
+
+                       // Constrain to the display
+                       Rectangle constrainedBounds = getConstrainedShellBounds(new Rectangle(initialX, initialY, popupSize.x, popupSize.y));
+
+                       // If there has been an adjustment causing the popup to overlap
+                       // with the control, then put the popup above the control.
+                       if (constrainedBounds.y < initialY)
+                               getShell().setBounds(initialX, location.y - popupSize.y, popupSize.x, popupSize.y);
+                       else
+                               getShell().setBounds(initialX, initialY, popupSize.x, popupSize.y);
+
+                       // Now set up a listener to monitor any changes in size.
+                       getShell().addListener(SWT.Resize, e -> {
+                               popupSize = getShell().getSize();
+                               if (infoPopup != null) {
+                                       infoPopup.adjustBounds();
+                               }
+                       });
+               }
+
+               /*
+                * Handle the set data event. Set the item data of the requested item to
+                * the corresponding proposal in the proposal cache.
+                */
+               private void handleSetData(Event event) {
+                       TableItem item = (TableItem) event.item;
+                       int index = proposalTable.indexOf(item);
+
+                       if (0 <= index && index < proposals.length) {
+                               IContentProposal current = proposals[index];
+                               item.setText(getString(current));
+                               item.setImage(getImage(current));
+                               item.setData(current);
+                       } else {
+                               // this should not happen, but does on win32
+                       }
+               }
+
+               /*
+                * Caches the specified proposals and repopulates the table if it has
+                * been created.
+                */
+               private void setProposals(IContentProposal[] newProposals) {
+                       if (newProposals == null || newProposals.length == 0) {
+                               newProposals = getEmptyProposalArray();
+                       }
+                       this.proposals = newProposals;
+
+                       // If there is a table
+                       if (isValid()) {
+                               final int newSize = newProposals.length;
+                               if (USE_VIRTUAL) {
+                                       // Set and clear the virtual table. Data will be
+                                       // provided in the SWT.SetData event handler.
+                                       proposalTable.setItemCount(newSize);
+                                       proposalTable.clearAll();
+                               } else {
+                                       // Populate the table manually
+                                       proposalTable.setRedraw(false);
+                                       proposalTable.setItemCount(newSize);
+                                       TableItem[] items = proposalTable.getItems();
+                                       for (int i = 0; i < items.length; i++) {
+                                               TableItem item = items[i];
+                                               IContentProposal proposal = newProposals[i];
+                                               item.setText(getString(proposal));
+                                               item.setImage(getImage(proposal));
+                                               item.setData(proposal);
+                                       }
+                                       proposalTable.setRedraw(true);
+                               }
+                               // Default to the first selection if there is content.
+                               if (newProposals.length > 0) {
+                                       selectProposal(0);
+                               } else {
+                                       // No selection, close the secondary popup if it was open
+                                       if (infoPopup != null) {
+                                               infoPopup.close();
+                                       }
+
+                               }
+                       }
+               }
+
+               /*
+                * Get the string for the specified proposal. Always return a String of
+                * some kind.
+                */
+               private String getString(IContentProposal proposal) {
+                       if (proposal == null) {
+                               return EMPTY;
+                       }
+                       if (labelProvider == null) {
+                               return proposal.getLabel() == null ? proposal.getContent()
+                                               : proposal.getLabel();
+                       }
+                       return labelProvider.getText(proposal);
+               }
+
+               /*
+                * Get the image for the specified proposal. If there is no image
+                * available, return null.
+                */
+               private Image getImage(IContentProposal proposal) {
+                       if (proposal == null || labelProvider == null) {
+                               return null;
+                       }
+                       return labelProvider.getImage(proposal);
+               }
+
+               /*
+                * Return an empty array. Used so that something always shows in the
+                * proposal popup, even if no proposal provider was specified.
+                */
+               private IContentProposal[] getEmptyProposalArray() {
+                       return new IContentProposal[0];
+               }
+
+               /*
+                * Answer true if the popup is valid, which means the table has been
+                * created and not disposed.
+                */
+               private boolean isValid() {
+                       return proposalTable != null && !proposalTable.isDisposed();
+               }
+
+               /*
+                * Return whether the receiver has focus. Since 3.4, this includes a
+                * check for whether the info popup has focus.
+                */
+               private boolean hasFocus() {
+                       if (!isValid()) {
+                               return false;
+                       }
+                       if (getShell().isFocusControl() || proposalTable.isFocusControl()) {
+                               return true;
+                       }
+                       if (infoPopup != null && infoPopup.hasFocus()) {
+                               return true;
+                       }
+                       return false;
+               }
+
+               /*
+                * Return the current selected proposal.
+                */
+               private IContentProposal getSelectedProposal() {
+                       if (isValid()) {
+                               int i = proposalTable.getSelectionIndex();
+                               if (proposals == null || i < 0 || i >= proposals.length) {
+                                       return null;
+                               }
+                               return proposals[i];
+                       }
+                       return null;
+               }
+
+               /*
+                * Select the proposal at the given index.
+                */
+               private void selectProposal(int index) {
+                       Assert
+                                       .isTrue(index >= 0,
+                                                       "Proposal index should never be negative"); //$NON-NLS-1$
+                       if (!isValid() || proposals == null || index >= proposals.length) {
+                               return;
+                       }
+                       proposalTable.setSelection(index);
+                       proposalTable.showSelection();
+
+                       showProposalDescription();
+               }
+
+               /**
+                * Opens this ContentProposalPopup. This method is extended in order to
+                * add the control listener when the popup is opened and to invoke the
+                * secondary popup if applicable.
+                *
+                * @return the return code
+                *
+                * @see org.eclipse.jface.window.Window#open()
+                */
+               @Override
+               public int open() {
+                       int value = super.open();
+                       if (popupCloser == null) {
+                               popupCloser = new PopupCloserListener();
+                       }
+                       popupCloser.installListeners();
+                       IContentProposal p = getSelectedProposal();
+                       if (p != null) {
+                               showProposalDescription();
+                       }
+                       return value;
+               }
+
+               /**
+                * Closes this popup. This method is extended to remove the control
+                * listener.
+                *
+                * @return <code>true</code> if the window is (or was already) closed,
+                *         and <code>false</code> if it is still open
+                */
+               @Override
+               public boolean close() {
+                       popupCloser.removeListeners();
+                       if (infoPopup != null) {
+                               infoPopup.close();
+                       }
+                       boolean ret = super.close();
+                       notifyPopupClosed();
+                       return ret;
+               }
+
+               /*
+                * Show the currently selected proposal's description in a secondary
+                * popup.
+                */
+               private void showProposalDescription() {
+                       // If we do not already have a pending update, then
+                       // create a thread now that will show the proposal description
+                       if (!pendingDescriptionUpdate) {
+                               // Create a thread that will sleep for the specified delay
+                               // before creating the popup. We do not use Jobs since this
+                               // code must be able to run independently of the Eclipse
+                               // runtime.
+                               Runnable runnable = () -> {
+                                       pendingDescriptionUpdate = true;
+                                       try {
+                                               Thread.sleep(POPUP_DELAY);
+                                       } catch (InterruptedException e) {
+                                       }
+                                       if (!isValid()) {
+                                               return;
+                                       }
+                                       getShell().getDisplay().syncExec(() -> {
+                                               // Query the current selection since we have
+                                               // been delayed
+                                               IContentProposal p = getSelectedProposal();
+                                               if (p != null) {
+                                                       String description = p.getDescription();
+                                                       if (description != null) {
+                                                               if (infoPopup == null) {
+                                                                       infoPopup = new InfoPopupDialog(
+                                                                                       getShell());
+                                                                       infoPopup.open();
+                                                                       infoPopup
+                                                                                       .getShell()
+                                                                                       .addDisposeListener(
+                                                                                                       event -> infoPopup = null);
+                                                               }
+                                                               infoPopup.setContents(p
+                                                                               .getDescription());
+                                                       } else if (infoPopup != null) {
+                                                               infoPopup.close();
+                                                       }
+                                                       pendingDescriptionUpdate = false;
+
+                                               }
+                                       });
+                               };
+                               Thread t = new Thread(runnable);
+                               t.start();
+                       }
+               }
+
+               /*
+                * Accept the current proposal.
+                */
+               private void acceptCurrentProposal() {
+                       // Close before accepting the proposal. This is important
+                       // so that the cursor position can be properly restored at
+                       // acceptance, which does not work without focus on some controls.
+                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108
+                       IContentProposal proposal = getSelectedProposal();
+                       close();
+                       proposalAccepted(proposal);
+               }
+
+               /*
+                * Request the proposals from the proposal provider, and recompute any
+                * caches. Repopulate the popup if it is open.
+                */
+               private void recomputeProposals(String filterText) {
+                       IContentProposal[] allProposals = getProposals();
+                       if (allProposals == null)
+                                allProposals = getEmptyProposalArray();
+                       // If the non-filtered proposal list is empty, we should
+                       // close the popup.
+                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=147377
+                       if (allProposals.length == 0) {
+                               proposals = allProposals;
+                               close();
+                       } else {
+                               // Keep the popup open, but filter by any provided filter text
+                               setProposals(filterProposals(allProposals, filterText));
+                       }
+               }
+
+               /*
+                * In an async block, request the proposals. This is used when clients
+                * are in the middle of processing an event that affects the widget
+                * content. By using an async, we ensure that the widget content is up
+                * to date with the event.
+                */
+               private void asyncRecomputeProposals(final String filterText) {
+                       if (isValid()) {
+                               control.getDisplay().asyncExec(() -> {
+                                       recordCursorPosition();
+                                       recomputeProposals(filterText);
+                               });
+                       } else {
+                               recomputeProposals(filterText);
+                       }
+               }
+
+               /*
+                * Filter the provided list of content proposals according to the filter
+                * text.
+                */
+               private IContentProposal[] filterProposals(
+                               IContentProposal[] proposals, String filterString) {
+                       if (filterString.length() == 0) {
+                               return proposals;
+                       }
+
+                       // Check each string for a match. Use the string displayed to the
+                       // user, not the proposal content.
+                       ArrayList<IContentProposal> list = new ArrayList<>();
+                       for (int i = 0; i < proposals.length; i++) {
+                               String string = getString(proposals[i]);
+                               if (string.length() >= filterString.length()
+                                               && string.substring(0, filterString.length())
+                                                               .equalsIgnoreCase(filterString)) {
+                                       list.add(proposals[i]);
+                               }
+
+                       }
+                       return list.toArray(new IContentProposal[list
+                                       .size()]);
+               }
+
+               Listener getTargetControlListener() {
+                       if (targetControlListener == null) {
+                               targetControlListener = new TargetControlListener();
+                       }
+                       return targetControlListener;
+               }
+       }
+
+       /**
+        * Flag that controls the printing of debug info.
+        */
+       public static final boolean DEBUG = false;
+
+       /**
+        * Indicates that a chosen proposal should be inserted into the field.
+        */
+       public static final int PROPOSAL_INSERT = 1;
+
+       /**
+        * Indicates that a chosen proposal should replace the entire contents of
+        * the field.
+        */
+       public static final int PROPOSAL_REPLACE = 2;
+
+       /**
+        * Indicates that the contents of the control should not be modified when a
+        * proposal is chosen. This is typically used when a client needs more
+        * specialized behavior when a proposal is chosen. In this case, clients
+        * typically register an IContentProposalListener so that they are notified
+        * when a proposal is chosen.
+        */
+       public static final int PROPOSAL_IGNORE = 3;
+
+       /**
+        * Indicates that there should be no filter applied as keys are typed in the
+        * popup.
+        */
+       public static final int FILTER_NONE = 1;
+
+       /**
+        * Indicates that a single character filter applies as keys are typed in the
+        * popup.
+        */
+       public static final int FILTER_CHARACTER = 2;
+
+       /**
+        * Indicates that a cumulative filter applies as keys are typed in the
+        * popup. That is, each character typed will be added to the filter.
+        *
+        * @deprecated As of 3.4, filtering that is sensitive to changes in the
+        *             control content should be performed by the supplied
+        *             {@link IContentProposalProvider}, such as that performed by
+        *             {@link SimpleContentProposalProvider}
+        */
+       @Deprecated
+       public static final int FILTER_CUMULATIVE = 3;
+
+       /*
+        * Set to <code>true</code> to use a Table with SWT.VIRTUAL. This is a
+        * workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=98585#c40
+        * The corresponding SWT bug is
+        * https://bugs.eclipse.org/bugs/show_bug.cgi?id=90321
+        */
+       private static final boolean USE_VIRTUAL = !Util.isMotif();
+
+       /*
+        * The delay before showing a secondary popup.
+        */
+       private static final int POPUP_DELAY = 750;
+
+       /*
+        * The character height hint for the popup. May be overridden by using
+        * setInitialPopupSize.
+        */
+       private static final int POPUP_CHAR_HEIGHT = 10;
+
+       /*
+        * The minimum pixel width for the popup. May be overridden by using
+        * setInitialPopupSize.
+        */
+       private static final int POPUP_MINIMUM_WIDTH = 300;
+
+       /*
+        * The pixel offset of the popup from the bottom corner of the control.
+        */
+       private static final int POPUP_OFFSET = 3;
+
+       /*
+        * Empty string.
+        */
+       private static final String EMPTY = ""; //$NON-NLS-1$
+
+       /*
+        * The object that provides content proposals.
+        */
+       private IContentProposalProvider proposalProvider;
+
+       /*
+        * A label provider used to display proposals in the popup, and to extract
+        * Strings from non-String proposals.
+        */
+       private ILabelProvider labelProvider;
+
+       /*
+        * The control for which content proposals are provided.
+        */
+       private Control control;
+
+       /*
+        * The adapter used to extract the String contents from an arbitrary
+        * control.
+        */
+       private IControlContentAdapter controlContentAdapter;
+
+       /*
+        * The popup used to show proposals.
+        */
+       private ContentProposalPopup popup;
+
+       /*
+        * The keystroke that signifies content proposals should be shown.
+        */
+       private KeyStroke triggerKeyStroke;
+
+       /*
+        * The String containing characters that auto-activate the popup.
+        */
+       private String autoActivateString;
+
+       /*
+        * Integer that indicates how an accepted proposal should affect the
+        * control. One of PROPOSAL_IGNORE, PROPOSAL_INSERT, or PROPOSAL_REPLACE.
+        * Default value is PROPOSAL_INSERT.
+        */
+       private int proposalAcceptanceStyle = PROPOSAL_INSERT;
+
+       /*
+        * A boolean that indicates whether key events received while the proposal
+        * popup is open should also be propagated to the control. Default value is
+        * true.
+        */
+       private boolean propagateKeys = true;
+
+       /*
+        * Integer that indicates the filtering style. One of FILTER_CHARACTER,
+        * FILTER_CUMULATIVE, FILTER_NONE.
+        */
+       private int filterStyle = FILTER_NONE;
+
+       /*
+        * The listener we install on the control.
+        */
+       private Listener controlListener;
+
+       /*
+        * The list of IContentProposalListener listeners.
+        */
+       private ListenerList proposalListeners = new ListenerList();
+
+       /*
+        * The list of IContentProposalListener2 listeners.
+        */
+       private ListenerList proposalListeners2 = new ListenerList();
+
+       /*
+        * Flag that indicates whether the adapter is enabled. In some cases,
+        * adapters may be installed but depend upon outside state.
+        */
+       private boolean isEnabled = true;
+
+       /*
+        * The delay in milliseconds used when autoactivating the popup.
+        */
+       private int autoActivationDelay = 0;
+
+       /*
+        * A boolean indicating whether a keystroke has been received. Used to see
+        * if an autoactivation delay was interrupted by a keystroke.
+        */
+       private boolean receivedKeyDown;
+
+       /*
+        * The desired size in pixels of the proposal popup.
+        */
+       private Point popupSize;
+
+       /*
+        * The remembered position of the insertion position. Not all controls will
+        * restore the insertion position if the proposal popup gets focus, so we
+        * need to remember it.
+        */
+       private int insertionPos = -1;
+
+       /*
+        * The remembered selection range. Not all controls will restore the
+        * selection position if the proposal popup gets focus, so we need to
+        * remember it.
+        */
+       private Point selectionRange = new Point(-1, -1);
+
+       /*
+        * A flag that indicates that we are watching modify events
+        */
+       private boolean watchModify = false;
+
+       /**
+        * Construct a content proposal adapter that can assist the user with
+        * choosing content for the field.
+        *
+        * @param control
+        *            the control for which the adapter is providing content assist.
+        *            May not be <code>null</code>.
+        * @param controlContentAdapter
+        *            the <code>IControlContentAdapter</code> used to obtain and
+        *            update the control's contents as proposals are accepted. May
+        *            not be <code>null</code>.
+        * @param proposalProvider
+        *            the <code>IContentProposalProvider</code> used to obtain
+        *            content proposals for this control, or <code>null</code> if
+        *            no content proposal is available.
+        * @param keyStroke
+        *            the keystroke that will invoke the content proposal popup. If
+        *            this value is <code>null</code>, then proposals will be
+        *            activated automatically when any of the auto activation
+        *            characters are typed.
+        * @param autoActivationCharacters
+        *            An array of characters that trigger auto-activation of content
+        *            proposal. If specified, these characters will trigger
+        *            auto-activation of the proposal popup, regardless of whether
+        *            an explicit invocation keyStroke was specified. If this
+        *            parameter is <code>null</code>, then only a specified
+        *            keyStroke will invoke content proposal. If this parameter is
+        *            <code>null</code> and the keyStroke parameter is
+        *            <code>null</code>, then all alphanumeric characters will
+        *            auto-activate content proposal.
+        */
+       public CdmContentProposalAdapter(Control control,
+                       IControlContentAdapter controlContentAdapter,
+                       IContentProposalProvider proposalProvider, KeyStroke keyStroke,
+                       char[] autoActivationCharacters) {
+               super();
+               // We always assume the control and content adapter are valid.
+               Assert.isNotNull(control);
+               Assert.isNotNull(controlContentAdapter);
+               this.control = control;
+               this.controlContentAdapter = controlContentAdapter;
+
+               // The rest of these may be null
+               this.proposalProvider = proposalProvider;
+               this.triggerKeyStroke = keyStroke;
+               if (autoActivationCharacters != null) {
+                       this.autoActivateString = new String(autoActivationCharacters);
+               }
+               addControlListener(control);
+       }
+
+       /**
+        * Get the control on which the content proposal adapter is installed.
+        *
+        * @return the control on which the proposal adapter is installed.
+        */
+       public Control getControl() {
+               return control;
+       }
+
+       /**
+        * Get the label provider that is used to show proposals.
+        *
+        * @return the {@link ILabelProvider} used to show proposals, or
+        *         <code>null</code> if one has not been installed.
+        */
+       public ILabelProvider getLabelProvider() {
+               return labelProvider;
+       }
+
+       /**
+        * Return a boolean indicating whether the receiver is enabled.
+        *
+        * @return <code>true</code> if the adapter is enabled, and
+        *         <code>false</code> if it is not.
+        */
+       public boolean isEnabled() {
+               return isEnabled;
+       }
+
+       /**
+        * Set the label provider that is used to show proposals. The lifecycle of
+        * the specified label provider is not managed by this adapter. Clients must
+        * dispose the label provider when it is no longer needed.
+        *
+        * @param labelProvider
+        *            the {@link ILabelProvider} used to show proposals.
+        */
+       public void setLabelProvider(ILabelProvider labelProvider) {
+               this.labelProvider = labelProvider;
+       }
+
+       /**
+        * Return the proposal provider that provides content proposals given the
+        * current content of the field. A value of <code>null</code> indicates
+        * that there are no content proposals available for the field.
+        *
+        * @return the {@link IContentProposalProvider} used to show proposals. May
+        *         be <code>null</code>.
+        */
+       public IContentProposalProvider getContentProposalProvider() {
+               return proposalProvider;
+       }
+
+       /**
+        * Set the content proposal provider that is used to show proposals.
+        *
+        * @param proposalProvider
+        *            the {@link IContentProposalProvider} used to show proposals
+        */
+       public void setContentProposalProvider(
+                       IContentProposalProvider proposalProvider) {
+               this.proposalProvider = proposalProvider;
+       }
+
+       /**
+        * Return the array of characters on which the popup is autoactivated.
+        *
+        * @return An array of characters that trigger auto-activation of content
+        *         proposal. If specified, these characters will trigger
+        *         auto-activation of the proposal popup, regardless of whether an
+        *         explicit invocation keyStroke was specified. If this parameter is
+        *         <code>null</code>, then only a specified keyStroke will invoke
+        *         content proposal. If this value is <code>null</code> and the
+        *         keyStroke value is <code>null</code>, then all alphanumeric
+        *         characters will auto-activate content proposal.
+        */
+       public char[] getAutoActivationCharacters() {
+               if (autoActivateString == null) {
+                       return null;
+               }
+               return autoActivateString.toCharArray();
+       }
+
+       /**
+        * Set the array of characters that will trigger autoactivation of the
+        * popup.
+        *
+        * @param autoActivationCharacters
+        *            An array of characters that trigger auto-activation of content
+        *            proposal. If specified, these characters will trigger
+        *            auto-activation of the proposal popup, regardless of whether
+        *            an explicit invocation keyStroke was specified. If this
+        *            parameter is <code>null</code>, then only a specified
+        *            keyStroke will invoke content proposal. If this parameter is
+        *            <code>null</code> and the keyStroke value is
+        *            <code>null</code>, then all alphanumeric characters will
+        *            auto-activate content proposal.
+        *
+        */
+       public void setAutoActivationCharacters(char[] autoActivationCharacters) {
+               if (autoActivationCharacters == null) {
+                       this.autoActivateString = null;
+               } else {
+                       this.autoActivateString = new String(autoActivationCharacters);
+               }
+       }
+
+       /**
+        * Set the delay, in milliseconds, used before any autoactivation is
+        * triggered.
+        *
+        * @return the time in milliseconds that will pass before a popup is
+        *         automatically opened
+        */
+       public int getAutoActivationDelay() {
+               return autoActivationDelay;
+
+       }
+
+       /**
+        * Set the delay, in milliseconds, used before autoactivation is triggered.
+        *
+        * @param delay
+        *            the time in milliseconds that will pass before a popup is
+        *            automatically opened
+        */
+       public void setAutoActivationDelay(int delay) {
+               autoActivationDelay = delay;
+
+       }
+
+       /**
+        * Get the integer style that indicates how an accepted proposal affects the
+        * control's content.
+        *
+        * @return a constant indicating how an accepted proposal should affect the
+        *         control's content. Should be one of <code>PROPOSAL_INSERT</code>,
+        *         <code>PROPOSAL_REPLACE</code>, or <code>PROPOSAL_IGNORE</code>.
+        *         (Default is <code>PROPOSAL_INSERT</code>).
+        */
+       public int getProposalAcceptanceStyle() {
+               return proposalAcceptanceStyle;
+       }
+
+       /**
+        * Set the integer style that indicates how an accepted proposal affects the
+        * control's content.
+        *
+        * @param acceptance
+        *            a constant indicating how an accepted proposal should affect
+        *            the control's content. Should be one of
+        *            <code>PROPOSAL_INSERT</code>, <code>PROPOSAL_REPLACE</code>,
+        *            or <code>PROPOSAL_IGNORE</code>
+        */
+       public void setProposalAcceptanceStyle(int acceptance) {
+               proposalAcceptanceStyle = acceptance;
+       }
+
+       /**
+        * Return the integer style that indicates how keystrokes affect the content
+        * of the proposal popup while it is open.
+        *
+        * @return a constant indicating how keystrokes in the proposal popup affect
+        *         filtering of the proposals shown. <code>FILTER_NONE</code>
+        *         specifies that no filtering will occur in the content proposal
+        *         list as keys are typed. <code>FILTER_CHARACTER</code> specifies
+        *         the content of the popup will be filtered by the most recently
+        *         typed character. <code>FILTER_CUMULATIVE</code> is deprecated
+        *         and no longer recommended. It specifies that the content of the
+        *         popup will be filtered by a string containing all the characters
+        *         typed since the popup has been open. The default is
+        *         <code>FILTER_NONE</code>.
+        */
+       public int getFilterStyle() {
+               return filterStyle;
+       }
+
+       /**
+        * Set the integer style that indicates how keystrokes affect the content of
+        * the proposal popup while it is open. Popup-based filtering is useful for
+        * narrowing and navigating the list of proposals provided once the popup is
+        * open. Filtering of the proposals will occur even when the control content
+        * is not affected by user typing. Note that automatic filtering is not used
+        * to achieve content-sensitive filtering such as auto-completion. Filtering
+        * that is sensitive to changes in the control content should be performed
+        * by the supplied {@link IContentProposalProvider}.
+        *
+        * @param filterStyle
+        *            a constant indicating how keystrokes received in the proposal
+        *            popup affect filtering of the proposals shown.
+        *            <code>FILTER_NONE</code> specifies that no automatic
+        *            filtering of the content proposal list will occur as keys are
+        *            typed in the popup. <code>FILTER_CHARACTER</code> specifies
+        *            that the content of the popup will be filtered by the most
+        *            recently typed character. <code>FILTER_CUMULATIVE</code> is
+        *            deprecated and no longer recommended. It specifies that the
+        *            content of the popup will be filtered by a string containing
+        *            all the characters typed since the popup has been open.
+        */
+       public void setFilterStyle(int filterStyle) {
+               this.filterStyle = filterStyle;
+       }
+
+       /**
+        * Return the size, in pixels, of the content proposal popup.
+        *
+        * @return a Point specifying the last width and height, in pixels, of the
+        *         content proposal popup.
+        */
+       public Point getPopupSize() {
+               return popupSize;
+       }
+
+       /**
+        * Set the size, in pixels, of the content proposal popup. This size will be
+        * used the next time the content proposal popup is opened.
+        *
+        * @param size
+        *            a Point specifying the desired width and height, in pixels, of
+        *            the content proposal popup.
+        */
+       public void setPopupSize(Point size) {
+               popupSize = size;
+       }
+
+       /**
+        * Get the boolean that indicates whether key events (including
+        * auto-activation characters) received by the content proposal popup should
+        * also be propagated to the adapted control when the proposal popup is
+        * open.
+        *
+        * @return a boolean that indicates whether key events (including
+        *         auto-activation characters) should be propagated to the adapted
+        *         control when the proposal popup is open. Default value is
+        *         <code>true</code>.
+        */
+       public boolean getPropagateKeys() {
+               return propagateKeys;
+       }
+
+       /**
+        * Set the boolean that indicates whether key events (including
+        * auto-activation characters) received by the content proposal popup should
+        * also be propagated to the adapted control when the proposal popup is
+        * open.
+        *
+        * @param propagateKeys
+        *            a boolean that indicates whether key events (including
+        *            auto-activation characters) should be propagated to the
+        *            adapted control when the proposal popup is open.
+        */
+       public void setPropagateKeys(boolean propagateKeys) {
+               this.propagateKeys = propagateKeys;
+       }
+
+       /**
+        * Return the content adapter that can get or retrieve the text contents
+        * from the adapter's control. This method is used when a client, such as a
+        * content proposal listener, needs to update the control's contents
+        * manually.
+        *
+        * @return the {@link IControlContentAdapter} which can update the control
+        *         text.
+        */
+       public IControlContentAdapter getControlContentAdapter() {
+               return controlContentAdapter;
+       }
+
+       /**
+        * Set the boolean flag that determines whether the adapter is enabled.
+        *
+        * @param enabled
+        *            <code>true</code> if the adapter is enabled and responding
+        *            to user input, <code>false</code> if it is ignoring user
+        *            input.
+        *
+        */
+       public void setEnabled(boolean enabled) {
+               // If we are disabling it while it's proposing content, close the
+               // content proposal popup.
+               if (isEnabled && !enabled) {
+                       if (popup != null) {
+                               popup.close();
+                       }
+               }
+               isEnabled = enabled;
+       }
+
+       /**
+        * Add the specified listener to the list of content proposal listeners that
+        * are notified when content proposals are chosen.
+        * </p>
+        *
+        * @param listener
+        *            the IContentProposalListener to be added as a listener. Must
+        *            not be <code>null</code>. If an attempt is made to register
+        *            an instance which is already registered with this instance,
+        *            this method has no effect.
+        *
+        * @see org.eclipse.jface.fieldassist.IContentProposalListener
+        */
+       public void addContentProposalListener(IContentProposalListener listener) {
+               proposalListeners.add(listener);
+       }
+
+       /**
+        * Removes the specified listener from the list of content proposal
+        * listeners that are notified when content proposals are chosen.
+        * </p>
+        *
+        * @param listener
+        *            the IContentProposalListener to be removed as a listener. Must
+        *            not be <code>null</code>. If the listener has not already
+        *            been registered, this method has no effect.
+        *
+        * @since 3.3
+        * @see org.eclipse.jface.fieldassist.IContentProposalListener
+        */
+       public void removeContentProposalListener(IContentProposalListener listener) {
+               proposalListeners.remove(listener);
+       }
+
+       /**
+        * Add the specified listener to the list of content proposal listeners that
+        * are notified when a content proposal popup is opened or closed.
+        * </p>
+        *
+        * @param listener
+        *            the IContentProposalListener2 to be added as a listener. Must
+        *            not be <code>null</code>. If an attempt is made to register
+        *            an instance which is already registered with this instance,
+        *            this method has no effect.
+        *
+        * @since 3.3
+        * @see org.eclipse.jface.fieldassist.IContentProposalListener2
+        */
+       public void addContentProposalListener(IContentProposalListener2 listener) {
+               proposalListeners2.add(listener);
+       }
+
+       /**
+        * Remove the specified listener from the list of content proposal listeners
+        * that are notified when a content proposal popup is opened or closed.
+        * </p>
+        *
+        * @param listener
+        *            the IContentProposalListener2 to be removed as a listener.
+        *            Must not be <code>null</code>. If the listener has not
+        *            already been registered, this method has no effect.
+        *
+        * @since 3.3
+        * @see org.eclipse.jface.fieldassist.IContentProposalListener2
+        */
+       public void removeContentProposalListener(IContentProposalListener2 listener) {
+               proposalListeners2.remove(listener);
+       }
+
+       /*
+        * Add our listener to the control. Debug information to be left in until
+        * this support is stable on all platforms.
+        */
+       private void addControlListener(Control control) {
+               if (DEBUG) {
+                       System.out
+                                       .println("ContentProposalListener#installControlListener()"); //$NON-NLS-1$
+               }
+
+               if (controlListener != null) {
+                       return;
+               }
+               controlListener = new Listener() {
+                       @Override
+                       public void handleEvent(Event e) {
+                               if (!isEnabled) {
+                                       return;
+                               }
+
+                               switch (e.type) {
+                               case SWT.Traverse:
+                               case SWT.KeyDown:
+                                       if (DEBUG) {
+                                               StringBuffer sb;
+                                               if (e.type == SWT.Traverse) {
+                                                       sb = new StringBuffer("Traverse"); //$NON-NLS-1$
+                                               } else {
+                                                       sb = new StringBuffer("KeyDown"); //$NON-NLS-1$
+                                               }
+                                               sb.append(" received by adapter"); //$NON-NLS-1$
+                                               dump(sb.toString(), e);
+                                       }
+                                       // If the popup is open, it gets first shot at the
+                                       // keystroke and should set the doit flags appropriately.
+                                       if (popup != null) {
+                                               popup.getTargetControlListener().handleEvent(e);
+                                               if (DEBUG) {
+                                                       StringBuffer sb;
+                                                       if (e.type == SWT.Traverse) {
+                                                               sb = new StringBuffer("Traverse"); //$NON-NLS-1$
+                                                       } else {
+                                                               sb = new StringBuffer("KeyDown"); //$NON-NLS-1$
+                                                       }
+                                                       sb.append(" after being handled by popup"); //$NON-NLS-1$
+                                                       dump(sb.toString(), e);
+                                               }
+                                               // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=192633
+                                               // If the popup is open and this is a valid character, we
+                                               // want to watch for the modified text.
+                                               if (propagateKeys && e.character != 0)
+                                                       watchModify = true;
+
+                                               return;
+                                       }
+
+                                       // We were only listening to traverse events for the popup
+                                       if (e.type == SWT.Traverse) {
+                                               return;
+                                       }
+
+                                       // The popup is not open. We are looking at keydown events
+                                       // for a trigger to open the popup.
+                                       if (triggerKeyStroke != null) {
+                                               // Either there are no modifiers for the trigger and we
+                                               // check the character field...
+                                               if ((triggerKeyStroke.getModifierKeys() == KeyStroke.NO_KEY && triggerKeyStroke
+                                                               .getNaturalKey() == e.character)
+                                                               ||
+                                                               // ...or there are modifiers, in which case the
+                                                               // keycode and state must match
+                                                               (triggerKeyStroke.getNaturalKey() == e.keyCode && ((triggerKeyStroke
+                                                                               .getModifierKeys() & e.stateMask) == triggerKeyStroke
+                                                                               .getModifierKeys()))) {
+                                                       // We never propagate the keystroke for an explicit
+                                                       // keystroke invocation of the popup
+                                                       e.doit = false;
+                                                       openProposalPopup(false);
+                                                       return;
+                                               }
+                                       }
+                                       /*
+                                        * The triggering keystroke was not invoked. If a character
+                                        * was typed, compare it to the autoactivation characters.
+                                        */
+                                       if (e.character != 0) {
+                                               if (autoActivateString != null) {
+                                                       if (autoActivateString.indexOf(e.character) >= 0) {
+                                                               autoActivate();
+                                                       } else {
+                                                               // No autoactivation occurred, so record the key
+                                                               // down as a means to interrupt any
+                                                               // autoactivation that is pending due to
+                                                               // autoactivation delay.
+                                                               receivedKeyDown = true;
+                                                               // watch the modify so we can close the popup in
+                                                               // cases where there is no longer a trigger
+                                                               // character in the content
+                                                               watchModify = true;
+                                                       }
+                                               } else {
+                                                       // The autoactivate string is null. If the trigger
+                                                       // is also null, we want to act on any modification
+                                                       // to the content. Set a flag so we'll catch this
+                                                       // in the modify event.
+                                                       if (triggerKeyStroke == null) {
+                                                               watchModify = true;
+                                                       }
+                                               }
+                                       } else {
+                                               // A non-character key has been pressed. Interrupt any
+                                               // autoactivation that is pending due to autoactivation delay.
+                                               receivedKeyDown = true;
+                                       }
+                                       break;
+
+
+                                       // There are times when we want to monitor content changes
+                                       // rather than individual keystrokes to determine whether
+                                       // the popup should be closed or opened based on the entire
+                                       // content of the control.
+                                       // The watchModify flag ensures that we don't autoactivate if
+                                       // the content change was caused by something other than typing.
+                                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=183650
+                                       case SWT.Modify:
+                                               if (allowsAutoActivate() && watchModify) {
+                                                       if (DEBUG) {
+                                                               dump("Modify event triggers popup open or close", e); //$NON-NLS-1$
+                                                       }
+                                                       watchModify = false;
+                                                       // We are in autoactivation mode, either for specific
+                                                       // characters or for all characters. In either case,
+                                                       // we should close the proposal popup when there is no
+                                                       // content in the control.
+                                                       if (isControlContentEmpty()) {
+                                                               // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=192633
+                                                               closeProposalPopup();
+                                                       } else {
+                                                               // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=147377
+                                                               // Given that we will close the popup when there are
+                                                               // no valid proposals, we must consider reopening it on any
+                                                               // content change when there are no particular autoActivation
+                                                               // characters
+                                                               if (autoActivateString == null) {
+                                                                       autoActivate();
+                                                               } else {
+                                                                       // Autoactivation characters are defined, but this
+                                                                       // modify event does not involve one of them.  See
+                                                                       // if any of the autoactivation characters are left
+                                                                       // in the content and close the popup if none remain.
+                                                                       if (!shouldPopupRemainOpen())
+                                                                               closeProposalPopup();
+                                                               }
+                                                       }
+                                               }
+                                               break;
+                               default:
+                                       break;
+                               }
+                       }
+
+                       /**
+                        * Dump the given events to "standard" output.
+                        *
+                        * @param who
+                        *            who is dumping the event
+                        * @param e
+                        *            the event
+                        */
+                       private void dump(String who, Event e) {
+                               StringBuffer sb = new StringBuffer(
+                                               "--- [ContentProposalAdapter]\n"); //$NON-NLS-1$
+                               sb.append(who);
+                               sb.append(" - e: keyCode=" + e.keyCode + hex(e.keyCode)); //$NON-NLS-1$
+                               sb.append("; character=" + e.character + hex(e.character)); //$NON-NLS-1$
+                               sb.append("; stateMask=" + e.stateMask + hex(e.stateMask)); //$NON-NLS-1$
+                               sb.append("; doit=" + e.doit); //$NON-NLS-1$
+                               sb.append("; detail=" + e.detail + hex(e.detail)); //$NON-NLS-1$
+                               sb.append("; widget=" + e.widget); //$NON-NLS-1$
+                               System.out.println(sb);
+                       }
+
+                       private String hex(int i) {
+                               return "[0x" + Integer.toHexString(i) + ']'; //$NON-NLS-1$
+                       }
+               };
+               control.addListener(SWT.KeyDown, controlListener);
+               control.addListener(SWT.Traverse, controlListener);
+               control.addListener(SWT.Modify, controlListener);
+
+               if (DEBUG) {
+                       System.out
+                                       .println("ContentProposalAdapter#installControlListener() - installed"); //$NON-NLS-1$
+               }
+       }
+
+       /**
+        * Open the proposal popup and display the proposals provided by the
+        * proposal provider. If there are no proposals to be shown, do not show the
+        * popup. This method returns immediately. That is, it does not wait for the
+        * popup to open or a proposal to be selected.
+        *
+        * @param autoActivated
+        *            a boolean indicating whether the popup was autoactivated. If
+        *            false, a beep will sound when no proposals can be shown.
+        */
+       private void openProposalPopup(boolean autoActivated) {
+               if (isValid()) {
+                       if (popup == null) {
+                               // Check whether there are any proposals to be shown.
+                               recordCursorPosition(); // must be done before getting proposals
+                               IContentProposal[] proposals = getProposals();
+                               if (proposals == null)
+                                       return;
+                               if (proposals.length > 0) {
+                                       if (DEBUG) {
+                                               System.out.println("POPUP OPENED BY PRECEDING EVENT"); //$NON-NLS-1$
+                                       }
+                                       recordCursorPosition();
+                                       popup = new ContentProposalPopup(null, proposals);
+                                       popup.open();
+                                       popup.getShell().addDisposeListener(event -> popup = null);
+                                       internalPopupOpened();
+                                       notifyPopupOpened();
+                               } else if (!autoActivated) {
+                                       getControl().getDisplay().beep();
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Open the proposal popup and display the proposals provided by the
+        * proposal provider. This method returns immediately. That is, it does not
+        * wait for a proposal to be selected. This method is used by subclasses to
+        * explicitly invoke the opening of the popup. If there are no proposals to
+        * show, the popup will not open and a beep will be sounded.
+        */
+       protected void openProposalPopup() {
+               openProposalPopup(false);
+       }
+
+       /**
+        * Close the proposal popup without accepting a proposal. This method
+        * returns immediately, and has no effect if the proposal popup was not
+        * open. This method is used by subclasses to explicitly close the popup
+        * based on additional logic.
+        *
+        * @since 3.3
+        */
+       protected void closeProposalPopup() {
+               if (popup != null) {
+                       popup.close();
+               }
+       }
+
+       /*
+        * A content proposal has been accepted. Update the control contents
+        * accordingly and notify any listeners.
+        *
+        * @param proposal the accepted proposal
+        */
+       private void proposalAccepted(IContentProposal proposal) {
+               switch (proposalAcceptanceStyle) {
+               case (PROPOSAL_REPLACE):
+                       setControlContent(proposal.getContent(), proposal
+                                       .getCursorPosition());
+                       break;
+               case (PROPOSAL_INSERT):
+                       insertControlContent(proposal.getContent(), proposal
+                                       .getCursorPosition());
+                       break;
+               default:
+                       // do nothing. Typically a listener is installed to handle this in
+                       // a custom way.
+                       break;
+               }
+
+               // In all cases, notify listeners of an accepted proposal.
+               notifyProposalAccepted(proposal);
+       }
+
+       /*
+        * Set the text content of the control to the specified text, setting the
+        * cursorPosition at the desired location within the new contents.
+        */
+       private void setControlContent(String text, int cursorPosition) {
+               if (isValid()) {
+                       // should already be false, but just in case.
+                       watchModify = false;
+                       controlContentAdapter.setControlContents(control, text,
+                                       cursorPosition);
+               }
+       }
+
+       /*
+        * Insert the specified text into the control content, setting the
+        * cursorPosition at the desired location within the new contents.
+        */
+       private void insertControlContent(String text, int cursorPosition) {
+               if (isValid()) {
+                       // should already be false, but just in case.
+                       watchModify = false;
+                       // Not all controls preserve their selection index when they lose
+                       // focus, so we must set it explicitly here to what it was before
+                       // the popup opened.
+                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108
+                       // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063
+                       if (controlContentAdapter instanceof IControlContentAdapter2
+                                       && selectionRange.x != -1) {
+                               ((IControlContentAdapter2) controlContentAdapter).setSelection(
+                                               control, selectionRange);
+                       } else if (insertionPos != -1) {
+                               controlContentAdapter.setCursorPosition(control, insertionPos);
+                       }
+                       controlContentAdapter.insertControlContents(control, text,
+                                       cursorPosition);
+               }
+       }
+
+       /*
+        * Check that the control and content adapter are valid.
+        */
+       private boolean isValid() {
+               return control != null && !control.isDisposed()
+                               && controlContentAdapter != null;
+       }
+
+       /*
+        * Record the control's cursor position.
+        */
+       private void recordCursorPosition() {
+               if (isValid()) {
+                       IControlContentAdapter adapter = getControlContentAdapter();
+                       insertionPos = adapter.getCursorPosition(control);
+                       // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063
+                       if (adapter instanceof IControlContentAdapter2) {
+                               selectionRange = ((IControlContentAdapter2) adapter)
+                                               .getSelection(control);
+                       }
+
+               }
+       }
+
+       /*
+        * Get the proposals from the proposal provider. Gets all of the proposals
+        * without doing any filtering.
+        */
+       private IContentProposal[] getProposals() {
+               if (proposalProvider == null || !isValid()) {
+                       return null;
+               }
+               if (DEBUG) {
+                       System.out.println(">>> obtaining proposals from provider"); //$NON-NLS-1$
+               }
+               int position = insertionPos;
+               if (position == -1) {
+                       position = getControlContentAdapter().getCursorPosition(
+                                       getControl());
+               }
+               String contents = getControlContentAdapter().getControlContents(
+                               getControl());
+               IContentProposal[] proposals = proposalProvider.getProposals(contents,
+                               position);
+               return proposals;
+       }
+
+       /**
+        * Autoactivation has been triggered. Open the popup using any specified
+        * delay.
+        */
+       private void autoActivate() {
+               if (autoActivationDelay > 0) {
+                       Runnable runnable = () -> {
+                               receivedKeyDown = false;
+                               try {
+                                       Thread.sleep(autoActivationDelay);
+                               } catch (InterruptedException e) {
+                               }
+                               if (!isValid() || receivedKeyDown) {
+                                       return;
+                               }
+                               getControl().getDisplay().syncExec(() -> openProposalPopup(true));
+                       };
+                       Thread t = new Thread(runnable);
+                       t.start();
+               } else {
+                       // Since we do not sleep, we must open the popup
+                       // in an async exec. This is necessary because
+                       // this method may be called in the middle of handling
+                       // some event that will cause the cursor position or
+                       // other important info to change as a result of this
+                       // event occurring.
+                       getControl().getDisplay().asyncExec(() -> {
+                               if (isValid()) {
+                                       openProposalPopup(true);
+                               }
+                       });
+               }
+       }
+       
+       public void activate() {
+           getControl().getDisplay().asyncExec(() -> {
+            if (isValid()) {
+                openProposalPopup(true);
+            }
+        });
+       }
+
+       /*
+        * A proposal has been accepted. Notify interested listeners.
+        */
+       private void notifyProposalAccepted(IContentProposal proposal) {
+               if (DEBUG) {
+                       System.out.println("Notify listeners - proposal accepted."); //$NON-NLS-1$
+               }
+               final Object[] listenerArray = proposalListeners.getListeners();
+               for (int i = 0; i < listenerArray.length; i++) {
+                       ((IContentProposalListener) listenerArray[i])
+                                       .proposalAccepted(proposal);
+               }
+       }
+
+       /*
+        * The proposal popup has opened. Notify interested listeners.
+        */
+       private void notifyPopupOpened() {
+               if (DEBUG) {
+                       System.out.println("Notify listeners - popup opened."); //$NON-NLS-1$
+               }
+               final Object[] listenerArray = proposalListeners2.getListeners();
+//             for (int i = 0; i < listenerArray.length; i++) {
+//                     ((IContentProposalListener2) listenerArray[i])
+//                                     .proposalPopupOpened(this);
+//             }
+       }
+
+       /*
+        * The proposal popup has closed. Notify interested listeners.
+        */
+       private void notifyPopupClosed() {
+               if (DEBUG) {
+                       System.out.println("Notify listeners - popup closed."); //$NON-NLS-1$
+               }
+               final Object[] listenerArray = proposalListeners2.getListeners();
+//             for (int i = 0; i < listenerArray.length; i++) {
+//                     ((IContentProposalListener2) listenerArray[i])
+//                                     .proposalPopupClosed(this);
+//             }
+       }
+
+       /**
+        * Returns whether the content proposal popup has the focus. This includes
+        * both the primary popup and any secondary info popup that may have focus.
+        *
+        * @return <code>true</code> if the proposal popup or its secondary info
+        *         popup has the focus
+        * @since 3.4
+        */
+       public boolean hasProposalPopupFocus() {
+               return popup != null && popup.hasFocus();
+       }
+
+       /*
+        * Return whether the control content is empty
+        */
+       private boolean isControlContentEmpty() {
+               return getControlContentAdapter().getControlContents(getControl())
+                               .length() == 0;
+       }
+
+       /*
+        * The popup has just opened, but listeners have not yet
+        * been notified.  Perform any cleanup that is needed.
+        */
+       private void internalPopupOpened() {
+               // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=243612
+               if (control instanceof Combo) {
+                       ((Combo)control).setListVisible(false);
+               }
+       }
+
+       /*
+        * Return whether a proposal popup should remain open.
+        * If it was autoactivated by specific characters, and
+        * none of those characters remain, then it should not remain
+        * open.  This method should not be used to determine
+        * whether autoactivation has occurred or should occur, only whether
+        * the circumstances would dictate that a popup remain open.
+        */
+       private boolean shouldPopupRemainOpen() {
+               // If we always autoactivate or never autoactivate, it should remain open
+               if (autoActivateString == null || autoActivateString.length() == 0)
+                       return true;
+               String content = getControlContentAdapter().getControlContents(getControl());
+               for (int i=0; i<autoActivateString.length(); i++) {
+                       if (content.indexOf(autoActivateString.charAt(i)) >= 0)
+                               return true;
+               }
+               return false;
+       }
+
+       /*
+        * Return whether this adapter is configured for autoactivation, by
+        * specific characters or by any characters.
+        */
+       private boolean allowsAutoActivate() {
+               return (autoActivateString != null && autoActivateString.length() > 0) // there are specific autoactivation chars supplied
+                 || (autoActivateString == null && triggerKeyStroke == null);    // we autoactivate on everything
+       }
+
+       /**
+        * Sets focus to the proposal popup. If the proposal popup is not opened,
+        * this method is ignored. If the secondary popup has focus, focus is
+        * returned to the main proposal popup.
+        *
+        * @since 3.6
+        */
+       public void setProposalPopupFocus() {
+               if (isValid() && popup != null)
+                       popup.getShell().setFocus();
+       }
+
+       /**
+        * Answers a boolean indicating whether the main proposal popup is open.
+        *
+        * @return <code>true</code> if the proposal popup is open, and
+        *         <code>false</code> if it is not.
+        *
+        * @since 3.6
+        */
+       public boolean isProposalPopupOpen() {
+               if (isValid() && popup != null)
+                       return true;
+               return false;
+       }
+
+}
index ac15efbd6897b5ad842621a9752b9940b07dfde0..d6ad3c3aa0be30cfa9c8bc358300b23bd9870fb6 100644 (file)
@@ -11,20 +11,16 @@ package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 
 import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
 import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
-import org.eclipse.nebula.widgets.nattable.config.EditableRule;
 import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
 import org.eclipse.nebula.widgets.nattable.config.IEditableRule;
-import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
 import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
 import org.eclipse.nebula.widgets.nattable.edit.gui.ICellEditDialog;
 import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
 import org.eclipse.swt.graphics.Point;
 
-import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical.CategoricalComboBoxDataProvider;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical.CategoricalDataCellEditor;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical.CategoricalDataDisplayConverter;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative.QuantitativeDataDialogEditor;
@@ -93,7 +89,7 @@ final class CellEditorDataConversionConfiguration extends AbstractRegistryConfig
                 );
         //register categorical editor
         configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR,
-                new CategoricalDataCellEditor(matrix, new CategoricalComboBoxDataProvider(matrix)),
+                new CategoricalDataCellEditor(matrix),
                 DisplayMode.EDIT,
                 CharacterMatrixConfigLabelAccumulator.CATEGORICAL_EDITABLE
                 );
@@ -136,6 +132,18 @@ final class CellEditorDataConversionConfiguration extends AbstractRegistryConfig
                 new QuantitativeDataDialogEditor(matrix),
                 DisplayMode.EDIT,
                 CharacterMatrixConfigLabelAccumulator.QUANTITATIVE_EDITABLE);
+        configRegistry.registerConfigAttribute(
+                EditConfigAttributes.OPEN_IN_DIALOG,
+                Boolean.TRUE,
+                DisplayMode.EDIT,
+                CharacterMatrixConfigLabelAccumulator.CATEGORICAL_EDITABLE);
+        //register categorical editor
+        configRegistry.registerConfigAttribute(
+                EditConfigAttributes.CELL_EDITOR,
+                new CategoricalDataCellEditor(matrix),
+                DisplayMode.EDIT,
+                CharacterMatrixConfigLabelAccumulator.CATEGORICAL_EDITABLE);
+        
         // configure custom dialog settings
         Map<String, Object> editDialogSettings = new HashMap<>();
         editDialogSettings.put(ICellEditDialog.DIALOG_SHELL_TITLE, "Quantitative Data");
index bfef7ad1d4972a484601ae80de102d414af4de7d..cd13f2807f43f8befd1cf0dde0dfc3bf34ad1beb 100644 (file)
@@ -21,8 +21,8 @@ import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
 import org.eclipse.nebula.widgets.nattable.selection.event.CellSelectionEvent;
 import org.eclipse.nebula.widgets.nattable.selection.event.RowSelectionEvent;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 
 /**
  * @author pplitzner
index 6ff11c02e5c80c30069fc9fbd55940044711add2..c1d13754786d32e2d9a1fed3cbc732369fe26967 100644 (file)
@@ -113,8 +113,10 @@ import eu.etaxonomy.cdm.api.service.dto.FieldUnitDTO;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
+import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
 import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
 import eu.etaxonomy.cdm.model.description.SpecimenDescription;
@@ -123,6 +125,7 @@ import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
@@ -132,12 +135,14 @@ import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 
 /**
  * Character matrix editor for editing specimen/taxon descriptions in a table
+ * 
  * @author pplitzner
  * @since Nov 26, 2017
  */
@@ -176,6 +181,8 @@ public class CharacterMatrix extends Composite {
     private Map<UUID, Integer> featureToIndexMap = new HashMap<>();
 
     private Map<UUID, List<TermDto>> categoricalFeatureToStateMap = new HashMap<>();
+    
+    private Map<UUID, List<TermDto>> categoricalFeatureToModifierMap = new HashMap<>();
 
     private LinkedMap<String, String> propertyToLabelMap = new LinkedMap<>();
 
@@ -225,11 +232,11 @@ public class CharacterMatrix extends Composite {
         natTable = new NatTable(this, false);
     }
 
-    private void createToolBar(){
+    private void createToolBar() {
         toolbar = new CharacterMatrixToolbar(this, SWT.NONE);
     }
 
-    private void applyStyles(){
+    private void applyStyles() {
         ModernNatTableThemeConfiguration configuration = new ModernNatTableThemeConfiguration();
         // NOTE: Getting the colors and fonts from the GUIHelper ensures that
         // they are disposed properly (required by SWT)
@@ -238,7 +245,8 @@ public class CharacterMatrix extends Composite {
         natTable.addConfiguration(configuration);
     }
 
-    void toggleTreeFlat(boolean isTree, Button btnToggleFlat, Button btnToggleTree, Button btnCollapseAll, Button btnExpandAll, Button btnFreezeSuppInfo) {
+    void toggleTreeFlat(boolean isTree, Button btnToggleFlat, Button btnToggleTree, Button btnCollapseAll,
+            Button btnExpandAll, Button btnFreezeSuppInfo) {
         isTreeView = isTree;
         createTable(isTree, freezeLayer.isFrozen(), true);
         btnToggleFlat.setEnabled(isTree);
@@ -251,7 +259,8 @@ public class CharacterMatrix extends Composite {
         return isTreeView;
     }
 
-    public void createTable(boolean treeView, boolean freezeSupplementalColumns, boolean isInitialExpandToDeepestTaxonLevel){
+    public void createTable(boolean treeView, boolean freezeSupplementalColumns,
+            boolean isInitialExpandToDeepestTaxonLevel) {
         /**
          * layers
          */
@@ -268,68 +277,71 @@ public class CharacterMatrix extends Composite {
          */
         registerHandlersAndListeners();
 
-        //grab all space
+        // grab all space
         GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
 
-        //update label to current dataset
+        // update label to current dataset
         toolbar.getWsLabel().setText(getDescriptiveDataSet().getTitleCache());
         toolbar.getWsLabel().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
         toolbar.getWsLabel().getParent().layout();
 
-        //initial freeze of supplemental columns
+        // initial freeze of supplemental columns
         freezeSupplementalColumns(freezeSupplementalColumns);
 
-
-        //add tooltip to table
-//        new CategoricalChartTooltip(this);
-//        new QuantitativeChartTooltip(this);
-
+        // add tooltip to table
+        // new CategoricalChartTooltip(this);
+        // new QuantitativeChartTooltip(this);
 
         this.layout();
         natTable.doCommand(new ClientAreaResizeCommand(natTable));
 
         // expand all taxa
-        if(isInitialExpandToDeepestTaxonLevel){
+        if (isInitialExpandToDeepestTaxonLevel) {
             Integer deepestTaxonLevel = treeFormat.getDeepestTaxonLevel();
-            if(deepestTaxonLevel!=null){
-                natTable.doCommand(new TreeExpandToLevelCommand(deepestTaxonLevel-2));
+            if (deepestTaxonLevel != null) {
+                natTable.doCommand(new TreeExpandToLevelCommand(deepestTaxonLevel - 2));
             }
         }
         new NatTableContentTooltip(natTable, GridRegion.BODY) {
-               protected String getText(Event event) {
-                       int col = this.natTable.getColumnPositionByX(event.x);
-               int row = this.natTable.getRowPositionByY(event.y);
-
-               ILayerCell cell = this.natTable.getCellByPosition(col, row);
-               if (cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_EDITABLE)){
-                       Object o = bodyDataProvider.getRowObject(row);
-                       String object = "";
-                       if (o instanceof TaxonNodeDto || o instanceof TaxonRowWrapperDTO){
-                               object = "taxon";
-                       }else {
-                               object = "specimen";
-                       }
-                               
-                       return "Multiple data exist. Editing only possible in factual data view of " + object;
-               }
-               if (cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_APPLICABLE)){
-                       return "This character is not applicable because of the state of a parent feature." ;
-               }
-                       return null;
-               }
-       };
-    
+            @Override
+            protected String getText(Event event) {
+                int col = this.natTable.getColumnPositionByX(event.x);
+                int row = this.natTable.getRowPositionByY(event.y);
+
+                ILayerCell cell = this.natTable.getCellByPosition(col, row);
+                int i = cell.getRowIndex();
+                if (!cell.getConfigLabels().getLabels().contains("TAXON_AGGREGATED_DESCRIPTION") && cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_EDITABLE)) {
+                    Object o = bodyDataProvider.getRowObject(cell.getRowIndex());
+                    String object = "";
+                    if (o instanceof TaxonNodeDto || o instanceof TaxonRowWrapperDTO) {
+                        object = "taxon";
+                    } else {
+                        object = "specimen";
+                    }
+
+                    return "Multiple data exist. Editing only possible in factual data view of " + object;
+                }
+                if (cell.getConfigLabels().getLabels().contains("TAXON_AGGREGATED_DESCRIPTION") && cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_EDITABLE)) {
+                    
+                    return "Aggregated data are not editable.";
+                }
+                if (cell.getConfigLabels().getLabels().contains(CharacterMatrixConfigLabelAccumulator.NOT_APPLICABLE)) {
+                    return "This character is not applicable because of the state of a parent feature.";
+                }
+                return null;
+            }
+        };
 
         // clean up table state
         getNatTableState().remove(NatTable.INITIAL_PAINT_COMPLETE_FLAG);
         getNatTableState().remove(PersistenceDialog.ACTIVE_VIEW_CONFIGURATION_KEY);
     }
 
-    private List<FeatureDto> initFeatureList(TermNodeDto node){
+    private List<FeatureDto> initFeatureList(TermNodeDto node) {
         List<FeatureDto> features = new ArrayList<>();
         List<TermNodeDto> childNodes = node.getChildren();
         for (TermNodeDto childNode : childNodes) {
-            if (childNode != null){
+            if (childNode != null) {
                 features.add((FeatureDto) childNode.getTerm());
                 features.addAll(initFeatureList(childNode));
             }
@@ -337,22 +349,23 @@ public class CharacterMatrix extends Composite {
         return features;
     }
 
-    public void initDescriptiveDataSet(){
-        //get features/columns stored in descriptive dataset
-        TermTreeDto tree = getDescriptiveDataSet().getDescriptiveSystem();
-        features = initFeatureList(tree.getRoot());
+    public void initDescriptiveDataSet() {
+        // get features/columns stored in descriptive dataset
+        TermCollectionDto tree = getDescriptiveDataSet().getDescriptiveSystem();
+        features = initFeatureList(((TermTreeDto) tree).getRoot());
 
-        Set<FeatureDto> duplicateFeatures = features.stream().filter(i -> Collections.frequency(features, i) >1)
-        .collect(Collectors.toSet());
+        Set<FeatureDto> duplicateFeatures = features.stream().filter(i -> Collections.frequency(features, i) > 1)
+                .collect(Collectors.toSet());
 
         if (!duplicateFeatures.isEmpty()) {
-            throw new IllegalArgumentException("Duplicate features found: "
-                    + duplicateFeatures.stream().map(feature -> feature.getRepresentation_L10n()).collect(Collectors.joining(",")));
+            throw new IllegalArgumentException("Duplicate features found: " + duplicateFeatures.stream()
+                    .map(feature -> feature.getRepresentation_L10n()).collect(Collectors.joining(",")));
         }
 
-        //init state data for categorical features
-//        features.forEach(feature->fetchSupportedStates(feature));
+        // init state data for categorical features
+        // features.forEach(feature->fetchSupportedStates(feature));
         fetchSupportedStates(features);
+        fetchSupportedModifiers(features);
 
         descriptions = new BasicEventList<>();
 
@@ -360,12 +373,19 @@ public class CharacterMatrix extends Composite {
 
     private void fetchSupportedStates(List<FeatureDto> features) {
         Set<UUID> featureUuids = new HashSet<>();
-        features.forEach(i->featureUuids.add(i.getUuid()));
-        categoricalFeatureToStateMap = CdmStore.getService(IDescriptiveDataSetService.class).getSupportedStatesForFeature(featureUuids);
+        features.forEach(i -> featureUuids.add(i.getUuid()));
+        categoricalFeatureToStateMap = CdmStore.getService(IDescriptiveDataSetService.class)
+                .getSupportedStatesForFeature(featureUuids);
 
     }
+    
+    private void fetchSupportedModifiers(List<FeatureDto> features) {
+        Set<UUID> featureUuids = new HashSet<>();
+        features.forEach(i -> featureUuids.add(i.getUuid()));
+        categoricalFeatureToModifierMap = CdmStore.getService(IDescriptiveDataSetService.class)
+                .getRecommendedModifiersForFeature(featureUuids);
 
-
+    }
 
     private void createLayers(boolean treeView) {
 
@@ -375,88 +395,81 @@ public class CharacterMatrix extends Composite {
         @SuppressWarnings("unchecked")
         TreeList<Object> treeList = new TreeList<Object>(sortedList, treeFormat, TreeList.NODES_START_COLLAPSED);
         // wrap the SortedList with the TreeList
-//        treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
+        // treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
 
         /**
          * data provider
          */
         SpecimenColumnPropertyAccessor columnPropertyAccessor = new SpecimenColumnPropertyAccessor(this);
-        bodyDataProvider = treeView?new ListDataProvider<>(treeList, columnPropertyAccessor):new ListDataProvider<>(sortedList, columnPropertyAccessor);
+//        bodyDataProvider = treeView ? new CharacterMatrixListDataProvider<>(treeList, columnPropertyAccessor)
+//                : new CharacterMatrixListDataProvider<>(sortedList, columnPropertyAccessor);
+        bodyDataProvider = treeView ? new ListDataProvider<>(treeList, columnPropertyAccessor)
+                : new ListDataProvider<>(sortedList, columnPropertyAccessor);
 
         DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
         bodyDataLayer.registerCommandHandler(new CopyPasteUpdateDataCommandHandler(bodyDataLayer));
 
-
         /**
          * BODY layer
          *
          *
-
-        ViewportLayer
-
-             ^
-        TreeLayer (default visible)
-
-             ^
-        CompositeFreezeLayer
-         - viewportLayer
-         - selectionLayer
-         - freezeLayer
-
-             ^
-        FreezeLayer
-
-             ^
-        SelectionLayer
-
-             ^
-        ColumnHideShowLayer
-
-             ^
-        DataLayer
-
+         * 
+         * ViewportLayer
+         * 
+         * ^ TreeLayer (default visible)
+         * 
+         * ^ CompositeFreezeLayer - viewportLayer - selectionLayer - freezeLayer
+         * 
+         * ^ FreezeLayer
+         * 
+         * ^ SelectionLayer
+         * 
+         * ^ ColumnHideShowLayer
+         * 
+         * ^ DataLayer
          *
-
+         * 
+         * 
          */
 
         configRegistry = new ConfigRegistry();
-        //register labels
+        // register labels
         CharacterMatrixConfigLabelAccumulator labelAccumulator = new CharacterMatrixConfigLabelAccumulator(this);
         bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
 
-
         propertyToLabelMap.put(TAXON_COLUMN, Messages.CharacterMatrix_TAXON);
         propertyToLabelMap.put(COLLECTOR_COLUMN, Messages.CharacterMatrix_COLLECTOR_NO);
         propertyToLabelMap.put(IDENTIFIER_COLUMN, Messages.CharacterMatrix_IDENTIFIER);
         propertyToLabelMap.put(COUNTRY_COLUMN, Messages.CharacterMatrix_COUNTRY);
-        for(int i=0;i<features.size();i++){
+        for (int i = 0; i < features.size(); i++) {
             FeatureDto feature = features.get(i);
             initLabels(i, feature);
         }
 
         // layer for event handling of GlazedLists and PropertyChanges
-        GlazedListsEventLayer<Object> eventLayer = new GlazedListsEventLayer<>(bodyDataLayer, (EventList<Object>)bodyDataProvider.getList());
+        GlazedListsEventLayer<Object> eventLayer = new GlazedListsEventLayer<>(bodyDataLayer,
+                (EventList<Object>) bodyDataProvider.getList());
 
         GlazedListTreeData<?> treeData = new GlazedListTreeData<>(treeList);
         ITreeRowModel<?> treeRowModel = new GlazedListTreeRowModel<>(treeData);
 
         // assemble the column groups
         LinkedList<ColumnGroupWrapper> columnGroups = new LinkedList<>();
-        List<TermNodeDto> rootChildren = getDescriptiveDataSet().getDescriptiveSystem().getRoot().getChildren();
+        List<TermNodeDto> rootChildren = ((TermTreeDto) getDescriptiveDataSet().getDescriptiveSystem()).getRoot()
+                .getChildren();
         buildHeader(rootChildren, columnGroups);
 
         bodyLayer = new MatrixBodyLayerStack(eventLayer, columnGroups);
         selectionLayer = bodyLayer.getSelectionLayer();
         freezeLayer = new FreezeLayer(selectionLayer);
-        final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
-                freezeLayer, bodyLayer.getViewportLayer(), selectionLayer);
+        final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer,
+                bodyLayer.getViewportLayer(), selectionLayer);
         TreeLayer treeLayer = null;
-        if (treeView){
+        if (treeView) {
             treeLayer = new TreeLayer(compositeFreezeLayer, treeRowModel);
         }
 
-        topMostLayer = treeView?treeLayer:compositeFreezeLayer;
-
+        topMostLayer = treeView ? treeLayer : compositeFreezeLayer;
 
         /**
          * column header layer
@@ -464,34 +477,36 @@ public class CharacterMatrix extends Composite {
         IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
                 propertyToLabelMap.values().toArray(new String[] {}), propertyToLabelMap);
         DataLayer columnHeaderDataLayer = new DataLayer(columnHeaderDataProvider);
-        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, topMostLayer, selectionLayer);
+        ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, topMostLayer,
+                selectionLayer);
 
         ILayer topHeaderLayer = columnHeaderLayer;
 
-        if(!columnGroups.isEmpty()){
+        if (!columnGroups.isEmpty()) {
             // first group level
             ColumnGroupWrapper groupLevel1 = columnGroups.get(0);
             ColumnGroupHeaderLayer groupLayerLevel1 = null;
             ColumnGroupGroupHeaderLayer groupLayerLevel2 = null;
             groupLayerLevel1 = new ColumnGroupHeaderLayer(columnHeaderLayer, selectionLayer, groupLevel1.getModel());
-            for (Entry<TermNodeDto, TreeSet<Integer>> entry: groupLevel1.getColumnGroupToIndexMap().entrySet()) {
+            for (Entry<TermNodeDto, TreeSet<Integer>> entry : groupLevel1.getColumnGroupToIndexMap().entrySet()) {
                 TermNodeDto group = entry.getKey();
                 TreeSet<Integer> indexList = entry.getValue();
                 int[] intArray = indexList.stream().mapToInt(Integer::intValue).toArray();
-                groupLayerLevel1.addColumnsIndexesToGroup(group.getTerm().getTitleCache(), intArray);
+                groupLayerLevel1.addColumnsIndexesToGroup(group.getTerm().getRepresentation_L10n(), intArray);
                 groupLayerLevel1.setGroupUnbreakable(indexList.iterator().next());
             }
             topHeaderLayer = groupLayerLevel1;
 
             // second group level
-            if(columnGroups.size()>1){
+            if (columnGroups.size() > 1) {
                 ColumnGroupWrapper groupLevel2 = columnGroups.get(1);
-                groupLayerLevel2 = new ColumnGroupGroupHeaderLayer(groupLayerLevel1, selectionLayer, groupLevel2.getModel());
-                for (Entry<TermNodeDto, TreeSet<Integer>> entry: groupLevel2.getColumnGroupToIndexMap().entrySet()) {
+                groupLayerLevel2 = new ColumnGroupGroupHeaderLayer(groupLayerLevel1, selectionLayer,
+                        groupLevel2.getModel());
+                for (Entry<TermNodeDto, TreeSet<Integer>> entry : groupLevel2.getColumnGroupToIndexMap().entrySet()) {
                     TermNodeDto group = entry.getKey();
                     TreeSet<Integer> indexList = entry.getValue();
                     int[] intArray = indexList.stream().mapToInt(Integer::intValue).toArray();
-                    groupLayerLevel2.addColumnsIndexesToGroup(group.getTerm().getTitleCache(), intArray);
+                    groupLayerLevel2.addColumnsIndexesToGroup(group.getTerm().getRepresentation_L10n(), intArray);
                     groupLayerLevel2.setGroupUnbreakable(indexList.iterator().next());
                 }
                 topHeaderLayer = groupLayerLevel2;
@@ -501,21 +516,15 @@ public class CharacterMatrix extends Composite {
         // add the SortHeaderLayer to the column header layer stack
         // as we use GlazedLists, we use the GlazedListsSortModel which
         // delegates the sorting to the SortedList
-        final SortHeaderLayer<DescriptionBase<?>> sortHeaderLayer = new SortHeaderLayer<>(
-                topHeaderLayer,
-                new GlazedListsSortModel<>(
-                        sortedList,
-                        columnPropertyAccessor,
-                        configRegistry,
-                        columnHeaderDataLayer));
+        final SortHeaderLayer<DescriptionBase<?>> sortHeaderLayer = new SortHeaderLayer<>(topHeaderLayer,
+                new GlazedListsSortModel<>(sortedList, columnPropertyAccessor, configRegistry, columnHeaderDataLayer));
 
         /**
          * row header layer
          */
         IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
         DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
-        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
-                topMostLayer, selectionLayer);
+        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, topMostLayer, selectionLayer);
 
         /**
          * corner layer
@@ -531,37 +540,37 @@ public class CharacterMatrix extends Composite {
         natTable.setLayer(gridLayer);
     }
 
-    private TreeSet<Integer> recurseChildIndexes(TermNodeDto node){
+    private TreeSet<Integer> recurseChildIndexes(TermNodeDto node) {
         TreeSet<Integer> childIndexes = new TreeSet<>();
-        if(node.getChildren().size() >0){
+        if (node.getChildren().size() > 0) {
             List<TermNodeDto> childNodes = node.getChildren();
-            for (TermNodeDto childNode: childNodes) {
-                if (childNode != null){
+            for (TermNodeDto childNode : childNodes) {
+                if (childNode != null) {
                     childIndexes.addAll(recurseChildIndexes(childNode));
                 }
             }
         }
-        childIndexes.add(features.indexOf(node.getTerm())+LEADING_COLUMN_COUNT);
+        childIndexes.add(features.indexOf(node.getTerm()) + LEADING_COLUMN_COUNT);
         return childIndexes;
     }
 
-    private void buildHeader(List<TermNodeDto> nodes, LinkedList<ColumnGroupWrapper> columnGroups){
+    private void buildHeader(List<TermNodeDto> nodes, LinkedList<ColumnGroupWrapper> columnGroups) {
         Map<TermNodeDto, TreeSet<Integer>> columnGroupToIndexMap = new HashMap<>();
         List<TermNodeDto> childNodes = new ArrayList<>();
         for (TermNodeDto node : nodes) {
-            if (node != null){
+            if (node != null) {
                 TreeSet<Integer> childIndexes = recurseChildIndexes(node);
-                if(childIndexes.size()>1){
+                if (childIndexes.size() > 1) {
                     // filter out groups that only have one member
                     columnGroupToIndexMap.put(node, childIndexes);
                 }
                 childNodes.addAll(node.getChildren());
             }
         }
-        if(!columnGroupToIndexMap.isEmpty()){
+        if (!columnGroupToIndexMap.isEmpty()) {
             columnGroups.addFirst(new ColumnGroupWrapper(new ColumnGroupModel(), columnGroupToIndexMap));
         }
-        if(!childNodes.isEmpty()){
+        if (!childNodes.isEmpty()) {
             buildHeader(childNodes, columnGroups);
         }
     }
@@ -569,29 +578,27 @@ public class CharacterMatrix extends Composite {
     private void registerHandlersAndListeners() {
         natTable.registerCommandHandler(new ExportCommandHandler(natTable));
 
-        //selection listener
+        // selection listener
         E4SelectionListener<Object> selectionListener = new CellSelectionListener(part.getSelectionService(),
                 bodyLayer.getSelectionLayer(), bodyDataProvider, part);
         bodyLayer.getSelectionLayer().addLayerListener(selectionListener);
         selectionListener.setFullySelectedRowsOnly(false);
 
-        //register handler for view configuration menu
+        // register handler for view configuration menu
         natTable.registerCommandHandler(toolbar.getDisplayPersistenceDialogCommandHandler());
 
-        //register handlers for copy&paste
-        natTable.registerCommandHandler(
-                new InternalPasteDataCommandHandler(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard()));
+        // register handlers for copy&paste
+        natTable.registerCommandHandler(new InternalPasteDataCommandHandler(bodyLayer.getSelectionLayer(),
+                natTable.getInternalCellClipboard()));
         natTable.registerCommandHandler(
                 new InternalCopyDataCommandHandler(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard()));
     }
 
-    private void configureNatTable(boolean treeView,
-            ConfigRegistry configRegistry,
-            AbstractLayer topMostLayer) {
+    private void configureNatTable(boolean treeView, ConfigRegistry configRegistry, AbstractLayer topMostLayer) {
         /**
          * CONFIGURATION
          */
-      //+++CONTEXT MENU+++
+        // +++CONTEXT MENU+++
         menuService.registerContextMenu(natTable, "eu.etaxonomy.taxeditor.editor.popupmenu.charactermatrix"); //$NON-NLS-1$
         // get the menu registered by EMenuService
         final Menu e4Menu = natTable.getMenu();
@@ -600,15 +607,16 @@ public class CharacterMatrix extends Composite {
 
         applyStyles();
 
-        //add default configuration because autoconfigure is set to false in constructor
+        // add default configuration because autoconfigure is set to false in
+        // constructor
         natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
 
         // this is for DEBUG ONLY
-//                natTable.addConfiguration(new DebugMenuConfiguration(natTable));
+        // natTable.addConfiguration(new DebugMenuConfiguration(natTable));
 
         // override the default sort configuration and change the mouse bindings
         // to sort on a single click
-        if(!treeView){
+        if (!treeView) {
             natTable.addConfiguration(new SingleClickSortConfiguration());
         }
 
@@ -616,95 +624,91 @@ public class CharacterMatrix extends Composite {
 
         // add the header menu configuration for adding the column header menu
         // with hide/show actions
-//        natTable.addConfiguration(new CharacterMatrixHeaderMenuConfiguration(natTable));
+        // natTable.addConfiguration(new
+        // CharacterMatrixHeaderMenuConfiguration(natTable));
 
-        // add custom configuration for data conversion and add column labels to viewport layer
+        // add custom configuration for data conversion and add column labels to
+        // viewport layer
         topMostLayer.addConfiguration(new CellEditorDataConversionConfiguration(this));
 
-        //copy&paste configuration
-        natTable.addConfiguration(new CopyPasteEditBindings(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard()));
-
+        // copy&paste configuration
+        natTable.addConfiguration(
+                new CopyPasteEditBindings(bodyLayer.getSelectionLayer(), natTable.getInternalCellClipboard()));
 
         // remove the menu reference from NatTable instance
         natTable.setMenu(null);
 
-
-//        natTable.addConfiguration(new CharacterMatrixHeaderMenuConfiguration(natTable));
-
+        // natTable.addConfiguration(new
+        // CharacterMatrixHeaderMenuConfiguration(natTable));
 
         natTable.configure();
 
-
-        natTable.addConfiguration(
-                    new AbstractUiBindingConfiguration() {
-                @Override
-                public void configureUiBindings(
-                        UiBindingRegistry uiBindingRegistry) {
-                    // add e4 menu to NatTable
-                    uiBindingRegistry.unregisterMouseDownBinding(mouseEventMatcher);
-                    if (isFirstCall){
-                           new PopupMenuBuilder(natTable, e4Menu)
-                           .withHideColumnMenuItem()
-                           .withShowAllColumnsMenuItem()
-                           .build();
-                           isFirstCall = false;
-                    }else{
-                       new PopupMenuBuilder(natTable, e4Menu)
-                           .build();
-                    }
-                    // register the UI binding for header, corner and body region
-                    mouseEventMatcher = new MouseEventMatcher(
-                            SWT.NONE,
-                            null,
-                            MouseEventMatcher.RIGHT_BUTTON);
-                    uiBindingRegistry.registerMouseDownBinding(mouseEventMatcher,
-                            new PopupMenuAction(e4Menu));
+        natTable.addConfiguration(new AbstractUiBindingConfiguration() {
+            @Override
+            public void configureUiBindings(UiBindingRegistry uiBindingRegistry) {
+                // add e4 menu to NatTable
+                uiBindingRegistry.unregisterMouseDownBinding(mouseEventMatcher);
+                if (isFirstCall) {
+                    new PopupMenuBuilder(natTable, e4Menu).withHideColumnMenuItem().withShowAllColumnsMenuItem()
+                            .build();
+                    isFirstCall = false;
+                } else {
+                    new PopupMenuBuilder(natTable, e4Menu).build();
                 }
-            });
+                // register the UI binding for header, corner and body region
+                mouseEventMatcher = new MouseEventMatcher(SWT.NONE, null, MouseEventMatcher.RIGHT_BUTTON);
+                uiBindingRegistry.registerMouseDownBinding(mouseEventMatcher, new PopupMenuAction(e4Menu));
+            }
+        });
 
     }
 
-    void freezeSupplementalColumns(boolean freeze){
-        int rightMostFreezeColumIndex = LEADING_COLUMN_COUNT-1;
+    void freezeSupplementalColumns(boolean freeze) {
+        int rightMostFreezeColumIndex = LEADING_COLUMN_COUNT - 1;
         Collection<Integer> hiddenColumnIndexes = bodyLayer.getColumnHideShowLayer().getHiddenColumnIndexes();
         for (Integer integer : hiddenColumnIndexes) {
-            if(integer<LEADING_COLUMN_COUNT){
+            if (integer < LEADING_COLUMN_COUNT) {
                 rightMostFreezeColumIndex--;
             }
         }
-        if(freeze){
+        if (freeze) {
             FreezeHelper.freeze(freezeLayer, bodyLayer.getViewportLayer(),
                     new PositionCoordinate(bodyLayer.getViewportLayer(), 0, 0),
                     new PositionCoordinate(bodyLayer.getViewportLayer(), rightMostFreezeColumIndex, -1));
-        }
-        else{
+        } else {
             FreezeHelper.unfreeze(freezeLayer, bodyLayer.getViewportLayer());
         }
     }
 
     private void initLabels(int index, FeatureDto feature) {
-        indexToFeatureMap.put(index+LEADING_COLUMN_COUNT, feature);
-        featureToIndexMap.put(feature.getUuid(), index+LEADING_COLUMN_COUNT);
-        String label = feature.getTitleCache();
+        indexToFeatureMap.put(index + LEADING_COLUMN_COUNT, feature);
+        featureToIndexMap.put(feature.getUuid(), index + LEADING_COLUMN_COUNT);
+        List<Language> languages = new ArrayList<>();
+        languages.add(PreferencesUtil.getGlobalLanguage());
+        feature.localize(new TermRepresentation_L10n(), languages);
+        String label = feature.getRepresentation_L10n();
         String property = feature.getUuid().toString();
-        //show unit for quantitative data
-        if(feature.isSupportsQuantitativeData()){
+        // show unit for quantitative data
+        if (feature.isSupportsQuantitativeData()) {
             Set<TermDto> recommendedMeasurementUnits = feature.getRecommendedMeasurementUnits();
-//            if(recommendedMeasurementUnits.size()>1){
-//                MessagingUtils.warningDialog(Messages.CharacterMatrix_INIT_PROBLEM, CharacterMatrix.class,
-//                        String.format(Messages.CharacterMatrix_INIT_PROBLEM_MESSAGE, feature.getLabel()));
-//            }
-            if(recommendedMeasurementUnits.size()==1){
+            // if(recommendedMeasurementUnits.size()>1){
+            // MessagingUtils.warningDialog(Messages.CharacterMatrix_INIT_PROBLEM,
+            // CharacterMatrix.class,
+            // String.format(Messages.CharacterMatrix_INIT_PROBLEM_MESSAGE,
+            // feature.getLabel()));
+            // }
+            if (recommendedMeasurementUnits.size() == 1) {
                 TermDto unit = recommendedMeasurementUnits.iterator().next();
-                label += " ["+unit.getIdInVocabulary()+"]"; //$NON-NLS-1$ //$NON-NLS-2$
+                label += " [" + unit.getIdInVocabulary() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         propertyToLabelMap.put(property, label);
     }
 
     public void loadDescriptions(boolean isInitialExpandToDeepestTaxonLevel, boolean initialLoading) {
-       
-        UUID monitorUuid =  CdmApplicationState.getLongRunningTasksService().monitGetRowWrapper(this.getDescriptiveDataSet().getUuid());
+
+        UUID monitorUuid = CdmApplicationState.getLongRunningTasksService()
+                .monitGetRowWrapper(this.getDescriptiveDataSet().getUuid(), PreferencesUtil.getGlobalLanguage());
 
         final Collection<RowWrapperDTO<?>> wrappers = new ArrayList<>();
         String jobLabel = Messages.CharacterMatrix_LOAD_CHARACTER_DATA;
@@ -713,50 +717,44 @@ public class CharacterMatrix extends Composite {
             subMonitor.beginTask(jobLabel, IProgressMonitor.UNKNOWN);
             IRemotingProgressMonitor remotingMonitor;
             try {
-                 remotingMonitor = CdmStore.getProgressMonitorClientManager()
-                .pollMonitor(jobLabel,
-                        monitorUuid,
-                        50,
-                        null,
-                        (List<IFeedbackGenerator>)null,
-                        subMonitor);
+                remotingMonitor = CdmStore.getProgressMonitorClientManager().pollMonitor(jobLabel, monitorUuid, 50,
+                        null, (List<IFeedbackGenerator>) null, subMonitor);
             } catch (InterruptedException e) {
                 MessagingUtils.informationDialog(Messages.CharacterMatrix_LOADING_FAILED_TITLE,
                         Messages.CharacterMatrix_LOADING_FAILED_MESSAGE);
                 return;
             }
             Object result = remotingMonitor.getResult();
-            if(result instanceof Collection){
+            if (result instanceof Collection) {
                 wrappers.addAll((Collection<RowWrapperDTO<?>>) result);
             }
-            if(result instanceof Exception){
-                MessagingUtils.errorDialog("Exception during description loading", this.getClass(), "An exception occured during loading", TaxeditorEditorPlugin.PLUGIN_ID, (Throwable) result, true);
-            }
-            else if(wrappers.isEmpty()){
+            if (result instanceof Exception) {
+                MessagingUtils.errorDialog("Exception during description loading", this.getClass(),
+                        "An exception occured during loading", TaxeditorEditorPlugin.PLUGIN_ID, (Throwable) result,
+                        true);
+            } else if (wrappers.isEmpty()) {
                 MessagingUtils.informationDialog(Messages.CharacterMatrix_NO_DESCRIPTION_TITLE,
                         Messages.CharacterMatrix_NO_DESCRIPTION_MESSAGE);
             }
             monitor.done();
         });
-        job.addJobChangeListener(new JobChangeAdapter(){
+        job.addJobChangeListener(new JobChangeAdapter() {
             @Override
             public void done(IJobChangeEvent event) {
-                sync.syncExec(()->{
-                    List<RowWrapperDTO> rowsWithoutTaxonNode = wrappers.stream().filter(row->row.getTaxonNode()==null).collect(Collectors.toList());
-                    if(!rowsWithoutTaxonNode.isEmpty()){
-                        String collect = rowsWithoutTaxonNode.stream().
-                        map(row->row.getDescription().toString())
-                        .collect(Collectors.joining("\n\n - ")); //$NON-NLS-1$
-                        MessagingUtils.warningDialog(
-                                Messages.CharacterMatrix_NO_NODE_FOUND_TITLE,
-                                this.getClass(),
-                                String.format(Messages.CharacterMatrix_NO_NODE_FOUND_MESSAGE, collect)
-                                );
+                sync.syncExec(() -> {
+                    List<RowWrapperDTO> rowsWithoutTaxonNode = wrappers.stream()
+                            .filter(row -> row.getTaxonNode() == null).collect(Collectors.toList());
+                    if (!rowsWithoutTaxonNode.isEmpty()) {
+                        String collect = rowsWithoutTaxonNode.stream().map(row -> row.getDescription().toString())
+                                .collect(Collectors.joining("\n\n - ")); //$NON-NLS-1$
+                        MessagingUtils.warningDialog(Messages.CharacterMatrix_NO_NODE_FOUND_TITLE, this.getClass(),
+                                String.format(Messages.CharacterMatrix_NO_NODE_FOUND_MESSAGE, collect));
                     }
                     descriptions.clear();
-//                    part.setDescriptiveDataSet(CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(part.getDescriptiveDataSet().getUuid()));
-                    wrappers.stream().filter(row->row.getTaxonNode()!=null).forEach(wrapper->CharacterMatrix.this.descriptions.add(wrapper));
-                    if(initialLoading){
+                    // part.setDescriptiveDataSet(CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(part.getDescriptiveDataSet().getUuid()));
+                    wrappers.stream().filter(row -> row.getTaxonNode() != null)
+                            .forEach(wrapper -> CharacterMatrix.this.descriptions.add(wrapper));
+                    if (initialLoading) {
                         loadingDone(isInitialExpandToDeepestTaxonLevel);
                     }
                 });
@@ -765,11 +763,11 @@ public class CharacterMatrix extends Composite {
         job.schedule();
     }
 
-    public IStructuredSelection getSelection(){
+    public IStructuredSelection getSelection() {
         Set<Range> selectedRowPositions = bodyLayer.getSelectionLayer().getSelectedRowPositions();
         List<Object> selectedObjects = new ArrayList<>();
         for (Range range : selectedRowPositions) {
-            for(int i=range.start;i<range.end;i++){
+            for (int i = range.start; i < range.end; i++) {
                 selectedObjects.add(bodyDataProvider.getRowObject(i));
             }
         }
@@ -782,9 +780,13 @@ public class CharacterMatrix extends Composite {
 
     }
 
-    public List<TermDto> getSupportedStatesForCategoricalFeature(UUID featureUuid){
+    public List<TermDto> getSupportedStatesForCategoricalFeature(UUID featureUuid) {
         return categoricalFeatureToStateMap.get(featureUuid);
     }
+    
+    public List<TermDto> getRecommendModifiersForCategoricalFeature(UUID featureUuid) {
+        return categoricalFeatureToModifierMap.get(featureUuid);
+    }
 
     public Set<DescriptionBase<?>> getDescriptionsToSave() {
         return descriptionsToSave;
@@ -799,14 +801,14 @@ public class CharacterMatrix extends Composite {
     }
 
     public Map<UUID, Integer> getFeatureToIndexMap() {
-               return featureToIndexMap;
-       }
+        return featureToIndexMap;
+    }
 
-       public void setFeatureToIndexMap(Map<UUID, Integer> featureToIndexMap) {
-               this.featureToIndexMap = featureToIndexMap;
-       }
+    public void setFeatureToIndexMap(Map<UUID, Integer> featureToIndexMap) {
+        this.featureToIndexMap = featureToIndexMap;
+    }
 
-       public LinkedMap<String, String> getPropertyToLabelMap() {
+    public LinkedMap<String, String> getPropertyToLabelMap() {
         return propertyToLabelMap;
     }
 
@@ -818,19 +820,19 @@ public class CharacterMatrix extends Composite {
         return descriptionUuidsToDelete;
     }
 
-    public void addDescriptionToDelete(UUID descriptionToDelete, RemoveDescriptionsFromDescriptiveDataSetConfigurator config) {
-        if (descriptionUuidsToDelete == null){
+    public void addDescriptionToDelete(UUID descriptionToDelete,
+            RemoveDescriptionsFromDescriptiveDataSetConfigurator config) {
+        if (descriptionUuidsToDelete == null) {
             descriptionUuidsToDelete = new HashMap<>();
         }
-        if (descriptionUuidsToDelete.get(config) != null){
+        if (descriptionUuidsToDelete.get(config) != null) {
             descriptionUuidsToDelete.get(config).add(descriptionToDelete);
-        }else{
+        } else {
             List<UUID> uuidList = new ArrayList<>();
             uuidList.add(descriptionToDelete);
             this.descriptionUuidsToDelete.put(config, uuidList);
         }
 
-
     }
 
     public List<SpecimenRowWrapperDTO> getSpecimenToAdd() {
@@ -838,15 +840,16 @@ public class CharacterMatrix extends Composite {
     }
 
     public void addSpecimenToAdd(Collection<SpecimenRowWrapperDTO> specimenToAdd) {
-        if (this.specimenToAdd == null){
+        if (this.specimenToAdd == null) {
             this.specimenToAdd = new ArrayList<>();
         }
 
         this.specimenToAdd.addAll(specimenToAdd);
         this.specimenCache.removeAll(specimenToAdd);
     }
+
     public void addSpecimenToAdd(SpecimenRowWrapperDTO specimenToAdd) {
-        if (this.specimenToAdd == null){
+        if (this.specimenToAdd == null) {
             this.specimenToAdd = new ArrayList<>();
         }
 
@@ -875,42 +878,54 @@ public class CharacterMatrix extends Composite {
     }
 
     public Collection<SpecimenNodeWrapper> getSpecimenCache() {
-             return specimenCache;
+        return specimenCache;
     }
 
     public void setSpecimenCache(Collection<SpecimenNodeWrapper> specimenCache) {
-        this.specimenCache = specimenCache.stream()
-                .filter(wrapper ->
-        //map descriptions on a list of uuids of the described specimen
-        !this.descriptions.stream()
-        .filter(rowWrapper->rowWrapper instanceof SpecimenRowWrapperDTO)
-        .map(specimenRowWrapper->((SpecimenRowWrapperDTO) specimenRowWrapper).getSpecimenDto().getUuid())
-        .collect(Collectors.toList())
-        //and check if the specimen to add is already contained
-        .contains(wrapper.getUuidAndTitleCache().getUuid())
-        )
-        .collect(Collectors.toList());
+        this.specimenCache = specimenCache.stream().filter(wrapper ->
+        // map descriptions on a list of uuids of the described specimen
+        !this.descriptions.stream().filter(rowWrapper -> rowWrapper instanceof SpecimenRowWrapperDTO)
+                .map(specimenRowWrapper -> ((SpecimenRowWrapperDTO) specimenRowWrapper).getSpecimenDto().getUuid())
+                .collect(Collectors.toList())
+                // and check if the specimen to add is already contained
+                .contains(wrapper.getUuidAndTitleCache().getUuid())).collect(Collectors.toList());
     }
 
-//    public void addRowToSave(RowWrapperDTO<?> row){
-//        rowsToMerge.put(row.getDescription().getDescription().getUuid(), row);
-//    }
-//
-//    public HashMap<UUID,RowWrapperDTO<?>> getRowsToSave() {
-//        return rowsToMerge;
-//    }
+    // public void addRowToSave(RowWrapperDTO<?> row){
+    // rowsToMerge.put(row.getDescription().getDescription().getUuid(), row);
+    // }
+    //
+    // public HashMap<UUID,RowWrapperDTO<?>> getRowsToSave() {
+    // return rowsToMerge;
+    // }
 
     public HashMap<UUID, RowWrapperDTO<?>> getRowsToMerge() {
         return rowsToMerge;
     }
 
     public void putRowToMerge(RowWrapperDTO<?> rowToMerge) {
-        if (this.rowsToMerge == null){
+        if (this.rowsToMerge == null) {
             this.rowsToMerge = new HashMap<>();
         }
         this.rowsToMerge.put(rowToMerge.getDescription().getDescriptionUuid(), rowToMerge);
     }
 
+//    /**
+//     * @return the actualSelection
+//     */
+//    @Override
+//    public DescriptionElementDto getActualSelection() {
+//        return actualSelection;
+//    }
+//
+//    /**
+//     * @param actualSelection
+//     *            the actualSelection to set
+//     */
+//    public void setActualSelection(DescriptionElementDto actualSelection) {
+//        this.actualSelection = actualSelection;
+//    }
+
     public Properties getNatTableState() {
         return toolbar.getNatTableState();
     }
@@ -935,122 +950,130 @@ public class CharacterMatrix extends Composite {
         return featureToHistogramMap;
     }
 
-
-
-    public ICdmEntitySession getCdmEntitySession(){
+    public ICdmEntitySession getCdmEntitySession() {
         return part.getCdmEntitySession();
     }
 
     @Inject
     @Optional
-    private void updateSpecimenList(@UIEventTopic(WorkbenchEventConstants.REFRESH_DESCRIPTIVE_DATASET)UUID uuid){
-        if(uuid!= null && uuid.equals(part.getDescriptiveDataSet().getUuid())){
-           this.specimenCache = null;
+    private void updateSpecimenList(@UIEventTopic(WorkbenchEventConstants.REFRESH_DESCRIPTIVE_DATASET) UUID uuid) {
+        if (uuid != null && uuid.equals(part.getDescriptiveDataSet().getUuid())) {
+            this.specimenCache = null;
 
         }
     }
-    
+
     @Inject
     @Optional
-    private void updateMatrix(@UIEventTopic(WorkbenchEventConstants.REFRESH_MATRIX)UUID uuid){
-        if(uuid!= null && uuid.equals(part.getDescriptiveDataSet().getUuid())){
-           this.specimenCache = null;
+    private void updateMatrix(@UIEventTopic(WorkbenchEventConstants.REFRESH_MATRIX) UUID uuid) {
+        if (uuid != null && uuid.equals(part.getDescriptiveDataSet().getUuid())) {
+            this.specimenCache = null;
 
         }
     }
 
-    public void addRowsToMatrix(Collection<SpecimenNodeWrapper> wrappers){
+    public void addRowsToMatrix(Collection<SpecimenNodeWrapper> wrappers) {
 
         List<UUID> specimenUuids = new ArrayList<>();
         wrappers.forEach(wrapper -> specimenUuids.add(wrapper.getUuidAndTitleCache().getUuid()));
-//        List<SpecimenOrObservationBase> specimens = CdmStore.getService(IOccurrenceService.class).load(specimenUuids, null);
+        // List<SpecimenOrObservationBase> specimens =
+        // CdmStore.getService(IOccurrenceService.class).load(specimenUuids,
+        // null);
         Map<UUID, UuidAndTitleCache<FieldUnit>> specimenMap = new HashMap<>();
 
-        for (UUID specimenUuid: specimenUuids ){
-            try{
-                FieldUnitDTO fieldUnitDto = CdmStore.getService(IOccurrenceService.class).loadFieldUnitDTO(specimenUuid);
-                if (fieldUnitDto != null){
-                    UuidAndTitleCache<FieldUnit> fieldUnit = new UuidAndTitleCache<>(FieldUnit.class, fieldUnitDto.getUuid(), null, fieldUnitDto.getLabel());
+        for (UUID specimenUuid : specimenUuids) {
+            try {
+                FieldUnitDTO fieldUnitDto = CdmStore.getService(IOccurrenceService.class)
+                        .loadFieldUnitDTO(specimenUuid);
+                if (fieldUnitDto != null) {
+                    UuidAndTitleCache<FieldUnit> fieldUnit = new UuidAndTitleCache<>(FieldUnit.class,
+                            fieldUnitDto.getUuid(), null, fieldUnitDto.getLabel());
                     specimenMap.put(specimenUuid, fieldUnit);
                 }
-            }catch(Exception e){
+            } catch (Exception e) {
                 e.printStackTrace();
             }
 
         }
-        for (SpecimenNodeWrapper wrapper: wrappers){
-            SpecimenRowWrapperDTO rowWrapper = CdmStore.getService(IDescriptiveDataSetService.class).createSpecimenRowWrapper(wrapper.getUuidAndTitleCache().getUuid(), wrapper.getTaxonNode().getUuid(), getDescriptiveDataSet().getUuid());
+        for (SpecimenNodeWrapper wrapper : wrappers) {
+            SpecimenRowWrapperDTO rowWrapper = CdmStore.getService(IDescriptiveDataSetService.class)
+                    .createSpecimenRowWrapper(wrapper.getUuidAndTitleCache().getUuid(),
+                            wrapper.getTaxonNode().getUuid(), getDescriptiveDataSet().getUuid(), PreferencesUtil.getGlobalLanguage());
             addSpecimenToAdd(rowWrapper);
-//            SpecimenRowWrapperDTO rowWrapper = new SpecimenRowWrapperDTO(wrapper.getUuidAndTitleCache(), wrapper.getType(), wrapper.getTaxonNode(), specimenMap.get(wrapper.getUuidAndTitleCache().getUuid()), null, null);
+            // SpecimenRowWrapperDTO rowWrapper = new
+            // SpecimenRowWrapperDTO(wrapper.getUuidAndTitleCache(),
+            // wrapper.getType(), wrapper.getTaxonNode(),
+            // specimenMap.get(wrapper.getUuidAndTitleCache().getUuid()), null,
+            // null);
             descriptions.add(rowWrapper);
         }
 
-
         setDirty();
     }
 
-    public HashMap<UUID, DescriptionBase<?>> addSpecimensToDescriptiveDataSet(){
-        if (specimenToAdd == null || specimenToAdd.isEmpty()){
+    public HashMap<UUID, DescriptionBase<?>> addSpecimensToDescriptiveDataSet() {
+        if (specimenToAdd == null || specimenToAdd.isEmpty()) {
             return new HashMap<>();
         }
-        UpdateResult result = CdmStore.getService(IDescriptiveDataSetService.class).addRowWrapperToDataset(specimenToAdd, getDescriptiveDataSet().getUuid(), true);
-        if(!result.getExceptions().isEmpty()){
+        UpdateResult result = CdmStore.getService(IDescriptiveDataSetService.class)
+                .addRowWrapperToDataset(specimenToAdd, getDescriptiveDataSet().getUuid(), true);
+        if (!result.getExceptions().isEmpty()) {
             MessagingUtils.warningDialog(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_TITLE, this,
-                    String.format(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE, result.getExceptions()
-                            .stream().map(ex->ex.toString())
-                            .collect(Collectors.joining("\n"))));
+                    String.format(Messages.CharacterMatrixBottomToolbar_ERROR_ROW_CREATION_MESSAGE, result
+                            .getExceptions().stream().map(ex -> ex.toString()).collect(Collectors.joining("\n"))));
         }
         DescriptiveDataSet dataSet = (DescriptiveDataSet) result.getCdmEntity();
         HashMap<UUID, DescriptionBase<?>> resultMap = new HashMap<>();
-        for (CdmBase updated: result.getUpdatedObjects()){
-            if (updated instanceof SpecimenDescription){
-                resultMap.put(updated.getUuid(), (DescriptionBase<?>)updated);
+        for (CdmBase updated : result.getUpdatedObjects()) {
+            if (updated instanceof SpecimenDescription) {
+                resultMap.put(updated.getUuid(), (DescriptionBase<?>) updated);
             }
 
-
         }
         dataSet = this.getCdmEntitySession().load(dataSet, true);
         // update local dataset
         DescriptiveDataSetBaseDto dto = DescriptiveDataSetBaseDto.fromDescriptiveDataSet(dataSet);
         this.setDescriptiveDataSet(dto);
 
-        //these descriptions are already updated
-        for (SpecimenRowWrapperDTO row: specimenToAdd){
+        // these descriptions are already updated
+        for (SpecimenRowWrapperDTO row : specimenToAdd) {
             this.rowsToMerge.remove(row.getDescription().getDescriptionUuid());
         }
         specimenToAdd.clear();
         return resultMap;
 
     }
-    public void setSelectedObject(Object selectedObject){
 
-        int rowIndex = ((IRowDataProvider<Object>)bodyDataProvider).indexOfRowObject(selectedObject);
-       int rowPosition = selectionLayer.getRowPositionByIndex(rowIndex);
-       natTable.doCommand( new SelectRowsCommand(natTable, 1, rowPosition, false, false));
+    public void setSelectedObject(Object selectedObject) {
+
+        int rowIndex = ((IRowDataProvider<Object>) bodyDataProvider).indexOfRowObject(selectedObject);
+        int rowPosition = selectionLayer.getRowPositionByIndex(rowIndex);
+        natTable.doCommand(new SelectRowsCommand(natTable, 1, rowPosition, false, false));
     }
 
-    public TreeList<Object> updateDescriptions(boolean treeView){
-       SortedList<Object> sortedList = new SortedList<>(descriptions, new MatrixRowComparator());
+    public TreeList<Object> updateDescriptions(boolean treeView) {
+        SortedList<Object> sortedList = new SortedList<>(descriptions, new MatrixRowComparator());
         // wrap the SortedList with the TreeList
         treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
         TreeList<Object> treeList = new TreeList<Object>(sortedList, treeFormat, TreeList.NODES_START_COLLAPSED);
         // wrap the SortedList with the TreeList
-//        treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
+        // treeFormat = new DescriptionTreeFormat(getDescriptiveDataSet());
 
         /**
          * data provider
          */
         SpecimenColumnPropertyAccessor columnPropertyAccessor = new SpecimenColumnPropertyAccessor(this);
-        bodyDataProvider = treeView?new ListDataProvider<>(treeList, columnPropertyAccessor):new ListDataProvider<>(sortedList, columnPropertyAccessor);
+        bodyDataProvider = treeView ? new ListDataProvider<>(treeList, columnPropertyAccessor)
+                : new ListDataProvider<>(sortedList, columnPropertyAccessor);
         return treeList;
 
     }
 
     @Override
-    public void dispose () {
+    public void dispose() {
         super.dispose();
-        if (descriptions != null){
-               descriptions.dispose();
+        if (descriptions != null) {
+            descriptions.dispose();
         }
         descriptions = null;
         this.natTable.dispose();
index 5c12399e57fecac772dae073b29d695844b603dc..d898f0eb606511a42fc080443bdcabab55a646b2 100644 (file)
@@ -8,23 +8,22 @@
 */
 package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
 
-import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.Set;
 
 import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
 import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator;
 
-import eu.etaxonomy.cdm.api.service.dto.CategoricalDataDto;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
-import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
-import eu.etaxonomy.cdm.api.service.dto.StateDataDto;
 import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
+import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
+import eu.etaxonomy.cdm.persistence.dto.StateDataDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
@@ -40,8 +39,8 @@ public class CharacterMatrixConfigLabelAccumulator implements IConfigLabelAccumu
     public static final String DEFAULT_OVERRIDDEN = "DEFAULT_OVERRIDDEN";
     public static final String QUANTITATIVE = "QUANTITATIVE";
     public static final String CATEGORICAL = "CATEGORICAL";
-    public static final String CATEGORICAL_EDITABLE = CATEGORICAL+"_EDITABLE";
-    public static final String QUANTITATIVE_EDITABLE = QUANTITATIVE+"_EDITABLE";
+    public static final String CATEGORICAL_EDITABLE = CATEGORICAL + "_EDITABLE";
+    public static final String QUANTITATIVE_EDITABLE = QUANTITATIVE + "_EDITABLE";
     public static final String NOT_EDITABLE = "NOT_EDITABLE";
     public static final String NOT_APPLICABLE = "NOT APPLICABLE";
 
@@ -58,205 +57,196 @@ public class CharacterMatrixConfigLabelAccumulator implements IConfigLabelAccumu
         boolean isApplicable = true;
 
         Object rowObject = matrix.getBodyDataProvider().getRowObject(rowPosition);
-        if(rowObject instanceof TaxonNodeDto){
+        if (rowObject instanceof TaxonNodeDto) {
             configLabels.addLabel(CharacterMatrix.LABEL_TAXON_ROW);
-        }
-        else if(rowObject instanceof TaxonRowWrapperDTO){
+        } else if (rowObject instanceof TaxonRowWrapperDTO) {
             TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO) rowObject;
-            if(MatrixUtility.isAggregatedTaxonDescription(taxonRowWrapper)){
+            if (MatrixUtility.isAggregatedTaxonDescription(taxonRowWrapper)) {
                 configLabels.addLabel(CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION);
                 isEditable = false;
-                if(columnPosition==0){
+                if (columnPosition == 0) {
                     configLabels.addLabel(CharacterMatrix.LABEL_TAXON_AGGREGATED_DESCRIPTION_ICON);
                 }
-            }
-            else if(MatrixUtility.isDefaultTaxonDescription(taxonRowWrapper)){
+            } else if (MatrixUtility.isDefaultTaxonDescription(taxonRowWrapper)) {
                 configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION);
-                if(columnPosition==0){
+                if (columnPosition == 0) {
                     configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DEFAULT_DESCRIPTION_ICON);
                 }
-            }
-            else if(MatrixUtility.isLiteratureTaxonDescription(taxonRowWrapper)){
+            } else if (MatrixUtility.isLiteratureTaxonDescription(taxonRowWrapper)) {
                 configLabels.addLabel(CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION);
-                if(columnPosition==0){
+                if (columnPosition == 0) {
                     configLabels.addLabel(CharacterMatrix.LABEL_TAXON_LITERATURE_DESCRIPTION_ICON);
                 }
                 // check for existing default values
-                if(columnPosition>=CharacterMatrix.LEADING_COLUMN_COUNT){
-                    FeatureDto feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
-                    if(hasDefaultValue(feature, taxonRowWrapper)){
+                if (columnPosition >= CharacterMatrix.LEADING_COLUMN_COUNT) {
+                    FeatureDto feature = matrix.getFeatures()
+                            .get(columnPosition - CharacterMatrix.LEADING_COLUMN_COUNT);
+                    if (hasDefaultValue(feature, taxonRowWrapper)) {
                         configLabels.addLabel(HAS_DEFAULT);
-                        if(hasDefaultOverriddenValue(feature, taxonRowWrapper)){
+                        if (hasDefaultOverriddenValue(feature, taxonRowWrapper)) {
                             configLabels.removeLabel(HAS_DEFAULT);
                             configLabels.addLabel(DEFAULT_OVERRIDDEN);
                         }
                     }
                 }
             }
-            //check for supplemental data TODO: add supplemental data to DTO
-//            if(!taxonRowWrapper.getDescription().getSources().isEmpty() && columnPosition==0){
-//                configLabels.addLabel(CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
-//            }
+            // check for supplemental data TODO: add supplemental data to DTO
+            // if(!taxonRowWrapper.getDescription().getSources().isEmpty() &&
+            // columnPosition==0){
+            // configLabels.addLabel(CharacterMatrix.LABEL_DESCRIPTION_HAS_SUPPLEMENTAL_DATA);
+            // }
             configLabels.addLabel(CharacterMatrix.LABEL_TAXON_DESCRIPTION);
         }
 
-        if(columnPosition==0){
+        if (columnPosition == 0) {
             configLabels.addLabel(CharacterMatrix.TAXON_COLUMN);
-        }
-        else if(columnPosition==1){
+        } else if (columnPosition == 1) {
             configLabels.addLabel(CharacterMatrix.COLLECTOR_COLUMN);
-        }
-        else if(columnPosition==2){
+        } else if (columnPosition == 2) {
             configLabels.addLabel(CharacterMatrix.IDENTIFIER_COLUMN);
-        }
-        else if(columnPosition==3){
+        } else if (columnPosition == 3) {
             configLabels.addLabel(CharacterMatrix.COUNTRY_COLUMN);
-        }
-        else{
-            FeatureDto feature = matrix.getFeatures().get(columnPosition-CharacterMatrix.LEADING_COLUMN_COUNT);
+        } else {
+            FeatureDto feature = matrix.getFeatures().get(columnPosition - CharacterMatrix.LEADING_COLUMN_COUNT);
             configLabels.addLabel(MatrixUtility.getProperty(feature));
             // check for default values
-            if(rowObject instanceof SpecimenRowWrapperDTO){
-                SpecimenRowWrapperDTO specimenRowWrapper = (SpecimenRowWrapperDTO)rowObject;
-                if(hasDefaultValue(feature, specimenRowWrapper)){
+            if (rowObject instanceof SpecimenRowWrapperDTO) {
+                SpecimenRowWrapperDTO specimenRowWrapper = (SpecimenRowWrapperDTO) rowObject;
+                if (hasDefaultValue(feature, specimenRowWrapper)) {
                     configLabels.addLabel(HAS_DEFAULT);
-                    if(hasDefaultOverriddenValue(feature, specimenRowWrapper)){
+                    if (hasDefaultOverriddenValue(feature, specimenRowWrapper)) {
                         configLabels.removeLabel(HAS_DEFAULT);
                         configLabels.addLabel(DEFAULT_OVERRIDDEN);
                     }
                 }
-                
+
             }
-            if (rowObject instanceof RowWrapperDTO){
-                   if (hasMoreThanOneValue(feature, (RowWrapperDTO)rowObject)){
-                       isEditable = false;
-                   }
-                   if (!isApplicableCheck(feature, (RowWrapperDTO)rowObject)){
-                       isApplicable = false;
-                   }
+            if (rowObject instanceof RowWrapperDTO) {
+                if (hasMoreThanOneValue(feature, (RowWrapperDTO) rowObject)) {
+                    isEditable = false;
+                }
+                if (!isApplicableCheck(feature, (RowWrapperDTO) rowObject)) {
+                    isApplicable = false;
+                }
             }
 
-            if(feature.isSupportsCategoricalData()){
-               
+            if (feature.isSupportsCategoricalData()) {
+
                 configLabels.addLabel(CATEGORICAL);
-                if(isEditable && isApplicable){
+                if (isEditable && isApplicable) {
                     configLabels.addLabel(CATEGORICAL_EDITABLE);
-                }else if (!isEditable && isApplicable){
-                       configLabels.addLabel(NOT_EDITABLE);
+                } else if (!isEditable && isApplicable) {
+                    configLabels.addLabel(NOT_EDITABLE);
                 }
-                
-            }
-            else if(feature.isSupportsQuantitativeData()){
+
+            } else if (feature.isSupportsQuantitativeData()) {
                 configLabels.addLabel(QUANTITATIVE);
-                if(isEditable && isApplicable){
+                if (isEditable && isApplicable) {
                     configLabels.addLabel(QUANTITATIVE_EDITABLE);
-                }else if (!isEditable && isApplicable){
-                       configLabels.addLabel(NOT_EDITABLE);
+                } else if (!isEditable && isApplicable) {
+                    configLabels.addLabel(NOT_EDITABLE);
                 }
             }
-            if (!isApplicable){
-               configLabels.addLabel(NOT_APPLICABLE);
-               
+            if (!isApplicable) {
+                configLabels.addLabel(NOT_APPLICABLE);
+
             }
         }
     }
 
     private boolean hasDefaultOverriddenValue(FeatureDto feature, RowWrapperDTO<?> rowWrapper) {
         Set<DescriptionElementDto> dataValueForFeature = rowWrapper.getDataValueForFeature(feature.getUuid());
-        if(dataValueForFeature!=null){
-               for (DescriptionElementDto dto:dataValueForFeature){
-                   if(dto instanceof CategoricalDataDto && !((CategoricalDataDto) dto).getStates().isEmpty()){
-                       return true;
-                   }
-                   else if(dto instanceof QuantitativeDataDto && !((QuantitativeDataDto) dto).getValues().isEmpty()){
-                       return true;
-                   }
-               }
+        if (dataValueForFeature != null) {
+            for (DescriptionElementDto dto : dataValueForFeature) {
+                if (dto instanceof CategoricalDataDto && !((CategoricalDataDto) dto).getStates().isEmpty()) {
+                    return true;
+                } else if (dto instanceof QuantitativeDataDto && !((QuantitativeDataDto) dto).getValues().isEmpty()) {
+                    return true;
+                }
+            }
         }
         return false;
     }
 
     private boolean hasDefaultValue(FeatureDto feature, RowWrapperDTO<?> rowWrapperDTO) {
-        if(rowWrapperDTO instanceof SpecimenRowWrapperDTO
-                && ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription()!=null){
-            DescriptionBaseDto taxDescription = ((SpecimenRowWrapperDTO)rowWrapperDTO).getDefaultDescription().getDescription();
+        if (rowWrapperDTO instanceof SpecimenRowWrapperDTO
+                && ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription() != null) {
+            DescriptionBaseDto taxDescription = ((SpecimenRowWrapperDTO) rowWrapperDTO).getDefaultDescription()
+                    .getDescription();
             return hasDefaultValue(feature, taxDescription);
-        }
-        else if(rowWrapperDTO instanceof TaxonRowWrapperDTO){
-            TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO)rowWrapperDTO;
+        } else if (rowWrapperDTO instanceof TaxonRowWrapperDTO) {
+            TaxonRowWrapperDTO taxonRowWrapper = (TaxonRowWrapperDTO) rowWrapperDTO;
             Set<DescriptionBaseDto> descriptions = taxonRowWrapper.getTaxonDescriptions();
             for (DescriptionBaseDto taxonDescription : descriptions) {
-//                if(matrix.getDescriptiveDataSet().getDescriptions().contains(taxonDescription)
-//                        && taxonDescription.getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
-//                    return hasDefaultValue(feature, taxonDescription);
-//                }
-                //TODO: correct implementation
+                // if(matrix.getDescriptiveDataSet().getDescriptions().contains(taxonDescription)
+                // &&
+                // taxonDescription.getTypes().contains(DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION)){
+                // return hasDefaultValue(feature, taxonDescription);
+                // }
+                // TODO: correct implementation
                 return false;
             }
         }
         return false;
     }
+
     private boolean hasMoreThanOneValue(FeatureDto feature, RowWrapperDTO<?> rowWrapperDTO) {
-        
-            Set<DescriptionElementDto> elements = rowWrapperDTO.getDataValueForFeature(feature.getUuid());
-            return elements != null && elements.size()>1;
-        
-       
+
+        Set<DescriptionElementDto> elements = rowWrapperDTO.getDataValueForFeature(feature.getUuid());
+        return elements != null && elements.size() > 1;
+
     }
-    
+
     private boolean isApplicableCheck(FeatureDto feature, RowWrapperDTO<?> rowWrapperDTO) {
-        TermTreeDto tree = matrix.getDescriptiveDataSet().getDescriptiveSystem();
+        TermTreeDto tree = (TermTreeDto) matrix.getDescriptiveDataSet().getDescriptiveSystem();
         boolean isApplicableCheck = true;
-        if (tree.getOnlyApplicable().containsKey(feature.getUuid())){
-               
-               for (FeatureStateDto featureStateDto:tree.getOnlyApplicable().get(feature.getUuid())){
-                       isApplicableCheck = false;
-                       FeatureDto dto = featureStateDto.getFeature();
-                       TermDto stateDto = featureStateDto.getState();
-                       Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid());
-                       if (descEls != null){
-                               for (DescriptionElementDto el:descEls){
-                                       if (el instanceof CategoricalDataDto){
-                                               for (StateDataDto stateData:((CategoricalDataDto) el).getStates()){
-                                                       isApplicableCheck |= stateData.getState().getUuid().equals(stateDto.getUuid());
-                                               }
-                                       }
-                               }
-                       }
-               }               
+        if (tree.getOnlyApplicable().containsKey(feature.getUuid())) {
+
+            for (FeatureStateDto featureStateDto : tree.getOnlyApplicable().get(feature.getUuid())) {
+                isApplicableCheck = false;
+                FeatureDto dto = featureStateDto.getFeature();
+                TermDto stateDto = featureStateDto.getState();
+                Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid());
+                if (descEls != null) {
+                    for (DescriptionElementDto el : descEls) {
+                        if (el instanceof CategoricalDataDto) {
+                            for (StateDataDto stateData : ((CategoricalDataDto) el).getStates()) {
+                                isApplicableCheck |= stateData.getState().getUuid().equals(stateDto.getUuid());
+                            }
+                        }
+                    }
+                }
+            }
         }
-        if (tree.getInapplicableMap().containsKey(feature.getUuid())){
-               for (FeatureStateDto featureStateDto:tree.getInapplicableMap().get(feature.getUuid())){
-                       FeatureDto dto = featureStateDto.getFeature();
-                       TermDto stateDto = featureStateDto.getState();
-                       Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid());
-                       if (descEls != null){
-                               for (DescriptionElementDto el:descEls){
-                                       if (el instanceof CategoricalDataDto){
-                                               for (StateDataDto stateData:((CategoricalDataDto) el).getStates()){
-                                                       isApplicableCheck &= !stateData.getState().getUuid().equals(stateDto.getUuid());
-                                               }
-                                       }
-                               }
-                       }
-               }               
+        if (tree.getInapplicableMap().containsKey(feature.getUuid())) {
+            for (FeatureStateDto featureStateDto : tree.getInapplicableMap().get(feature.getUuid())) {
+                FeatureDto dto = featureStateDto.getFeature();
+                TermDto stateDto = featureStateDto.getState();
+                Set<DescriptionElementDto> descEls = rowWrapperDTO.getDataValueForFeature(dto.getUuid());
+                if (descEls != null) {
+                    for (DescriptionElementDto el : descEls) {
+                        if (el instanceof CategoricalDataDto) {
+                            for (StateDataDto stateData : ((CategoricalDataDto) el).getStates()) {
+                                isApplicableCheck &= !stateData.getState().getUuid().equals(stateDto.getUuid());
+                            }
+                        }
+                    }
+                }
+            }
         }
-        if (!isApplicableCheck){
-               
+        if (!isApplicableCheck) {
+
         }
-        return isApplicableCheck;   
+        return isApplicableCheck;
     }
 
-
     private boolean hasDefaultValue(FeatureDto feature, DescriptionBaseDto defaultDescription) {
-        if(defaultDescription!=null){
+        if (defaultDescription != null) {
             Optional<DescriptionElementDto> descriptionElement = defaultDescription.getElements().stream()
-                    .filter(element->element.getFeatureUuid().equals(feature.getUuid()))
-                    .findAny();
-            if(descriptionElement.isPresent() && descriptionElement.get() instanceof CategoricalDataDto){
+                    .filter(element -> element.getFeatureUuid().equals(feature.getUuid())).findAny();
+            if (descriptionElement.isPresent() && descriptionElement.get() instanceof CategoricalDataDto) {
                 return !((CategoricalDataDto) descriptionElement.get()).getStates().isEmpty();
-            }
-            else if(descriptionElement.isPresent() && descriptionElement.get() instanceof QuantitativeDataDto){
+            } else if (descriptionElement.isPresent() && descriptionElement.get() instanceof QuantitativeDataDto) {
                 return !((QuantitativeDataDto) descriptionElement.get()).getValues().isEmpty();
             }
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixListDataProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrixListDataProvider.java
new file mode 100644 (file)
index 0000000..b69a148
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+* Copyright (C) 2023 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.editor.descriptiveDataSet.matrix;
+
+import java.util.List;
+
+import org.eclipse.nebula.widgets.nattable.data.IColumnAccessor;
+import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
+
+/**
+ * @author katjaluther
+ * @since 16.08.2023
+ */
+public class CharacterMatrixListDataProvider<T> extends ListDataProvider<T> {
+
+    public CharacterMatrixListDataProvider(List<T> list, IColumnAccessor<T> columnAccessor) {
+       super(list, columnAccessor);
+    }
+    
+    public IColumnAccessor<T> getColumnAccessor() {
+        return this.columnAccessor;
+    }
+}
index d7928f70af33c2b18fad2b813a566f97f2541fe8..e8b87245a02ff977f7355fb1a48d761293af4b21 100644 (file)
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -38,14 +39,11 @@ import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.config.RemoveDescriptionsFromDescriptiveDataSetConfigurator;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -53,9 +51,12 @@ import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.editor.ICharacterMatrix;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -70,15 +71,15 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
  * Character matrix editor for editing specimen/taxon descriptions in a table
+ * 
  * @author pplitzner
  * @since Nov 26, 2017
  */
-public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled, IDirtyMarkable,
-               ICdmEntitySessionEnabled<DescriptiveDataSet>, IPartContentHasSupplementalData,
-               IPartContentHasDetails {
+public class CharacterMatrixPart
+        implements IE4SavablePart, IDirtyMarkable, ICdmEntitySessionEnabled<DescriptiveDataSet>,
+        IPartContentHasSupplementalData, IPartContentHasDetails, ICharacterMatrix {
 
-    private static final List<String> WS_PROPERTY_PATH = Arrays.asList(new String[] {
-            "descriptions", //$NON-NLS-1$
+    private static final List<String> WS_PROPERTY_PATH = Arrays.asList(new String[] { "descriptions", //$NON-NLS-1$
             "descriptions.describedSpecimenOrObservation", //$NON-NLS-1$
             "descriptions.describedSpecimenOrObservation.gatheringEvent", //$NON-NLS-1$
             "descriptions.describedSpecimenOrObservation.gatheringEvent.actor", //$NON-NLS-1$
@@ -103,8 +104,6 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
 
     private DescriptiveDataSetBaseDto descriptiveDataSet;
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     @Inject
@@ -127,14 +126,10 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
 
     @PostConstruct
     public void create(Composite parent, IEclipseContext context) {
-        if(CdmStore.isActive() && conversation==null){
-            conversation = CdmStore.createConversation();
-        }
-        if(cdmEntitySession == null){
+        if (cdmEntitySession == null) {
             cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
             cdmEntitySession.bind();
-        }
-        else{
+        } else {
             return;
         }
         stackLayout = new StackLayout();
@@ -147,31 +142,36 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
     }
 
     public void init(UUID descriptiveDataSetUuid, boolean treeView) {
-//        this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class).load(descriptiveDataSetUuid, WS_PROPERTY_PATH);
-        this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class).getDescriptiveDataSetDtoByUuid(descriptiveDataSetUuid);
-        if(descriptiveDataSet!=null){
-            if(descriptiveDataSet.getDescriptiveSystem()==null
-                    || descriptiveDataSet.getDescriptiveSystem().getTermType()==null
-                    || !descriptiveDataSet.getDescriptiveSystem().getTermType().equals(TermType.Character)){
-                MessagingUtils.informationDialog(Messages.CharacterMatrixPart_COULD_NOT_OPEN, Messages.CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE);
+        // this.descriptiveDataSet =
+        // CdmStore.getService(IDescriptiveDataSetService.class).load(descriptiveDataSetUuid,
+        // WS_PROPERTY_PATH);
+        this.descriptiveDataSet = CdmStore.getService(IDescriptiveDataSetService.class)
+                .getDescriptiveDataSetDtoByUuid(descriptiveDataSetUuid);
+        if (descriptiveDataSet != null) {
+            if (descriptiveDataSet.getDescriptiveSystem() == null
+                    || descriptiveDataSet.getDescriptiveSystem().getTermType() == null
+                    || !descriptiveDataSet.getDescriptiveSystem().getTermType().equals(TermType.Character)) {
+                MessagingUtils.informationDialog(Messages.CharacterMatrixPart_COULD_NOT_OPEN,
+                        Messages.CharacterMatrixPart_COULD_NOT_OPEN_MESSAGE);
                 loadingFailed();
                 return;
             }
             try {
                 matrix.initDescriptiveDataSet();
             } catch (IllegalArgumentException e) {
-                MessagingUtils.errorDialog("Error during initilization", this, "Could not load matrix", TaxeditorEditorPlugin.PLUGIN_ID, e, false);
+                MessagingUtils.errorDialog("Error during initilization", this, "Could not load matrix",
+                        TaxeditorEditorPlugin.PLUGIN_ID, e, false);
                 loadingFailed();
                 return;
             }
             matrix.createTable(treeView, true, true);
             thisPart.setLabel(descriptiveDataSet.getTitleCache());
-            matrix.loadDescriptions( true, true);
+            matrix.loadDescriptions(true, true);
 
         }
     }
 
-    public IStructuredSelection getSelection(){
+    public IStructuredSelection getSelection() {
         return matrix.getSelection();
     }
 
@@ -204,49 +204,67 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
     public void save(IProgressMonitor monitor) {
 
         HashMap<UUID, DescriptionBase<?>> descriptionResults = matrix.addSpecimensToDescriptiveDataSet();
-        //newly added descriptions should not be saved again.
-//        descriptions.removeAll(matrix.getRowsToSave().values());
+        // newly added descriptions should not be saved again.
+        // descriptions.removeAll(matrix.getRowsToSave().values());
         // save edited descriptions
         List<DescriptionBaseDto> descriptionsToMerge = matrix.getRowsToMerge().values().stream()
-                .map(row->row.getDescription())
-                .collect(Collectors.toList());
+                .map(row -> row.getDescription()).collect(Collectors.toList());
 
-        if (matrix.getDescriptionsToDelete() != null && !matrix.getDescriptionsToDelete().isEmpty()){
+        if (matrix.getDescriptionsToDelete() != null && !matrix.getDescriptionsToDelete().isEmpty()) {
             DeleteResult result = new DeleteResult();
-            for (RemoveDescriptionsFromDescriptiveDataSetConfigurator config: matrix.getDescriptionsToDelete().keySet()){
-               result.includeResult(CdmStore.getService(IDescriptiveDataSetService.class).removeDescriptions(matrix.getDescriptionsToDelete().get(config), matrix.getDescriptiveDataSet().getUuid(), config));
+            for (RemoveDescriptionsFromDescriptiveDataSetConfigurator config : matrix.getDescriptionsToDelete()
+                    .keySet()) {
+                result.includeResult(CdmStore.getService(IDescriptiveDataSetService.class).removeDescriptions(
+                        matrix.getDescriptionsToDelete().get(config), matrix.getDescriptiveDataSet().getUuid(),
+                        config));
             }
             matrix.getDescriptionsToDelete().clear();
 
         }
 
-        List<MergeResult<DescriptionBase>> resultsFromSave = CdmStore.getService(IDescriptionService.class).merge(new ArrayList<>(matrix.getDescriptionsToSave()), true);
-        for (MergeResult<DescriptionBase> result: resultsFromSave){
+        List<MergeResult<DescriptionBase>> resultsFromSave = CdmStore.getService(IDescriptionService.class)
+                .merge(new ArrayList<>(matrix.getDescriptionsToSave()), true);
+        for (MergeResult<DescriptionBase> result : resultsFromSave) {
             Set<DescriptionBase> newEntities = result.getNewEntities();
-            for(DescriptionBase<?> newEntity: newEntities){
+            for (DescriptionBase<?> newEntity : newEntities) {
                 descriptionResults.put(newEntity.getUuid(), newEntity);
             }
             descriptionResults.put(result.getMergedEntity().getUuid(), result.getMergedEntity());
         }
         matrix.getDescriptionsToSave().clear();
-        UpdateResult results = CdmStore.getService(IDescriptionService.class).mergeDescriptions(descriptionsToMerge, matrix.getDescriptiveDataSet().getUuid());
+        UpdateResult results = CdmStore.getService(IDescriptionService.class).mergeDescriptions(descriptionsToMerge,
+                matrix.getDescriptiveDataSet().getUuid());
         matrix.getRowsToMerge().clear();
-//        conversation.commit();
+        // conversation.commit();
 
-        for (CdmBase result: results.getUpdatedObjects()){
-            if (result instanceof DescriptionBase){
-                descriptionResults.put(result.getUuid(), (DescriptionBase<?>)result);
+        for (CdmBase result : results.getUpdatedObjects()) {
+            if (result instanceof DescriptionBase) {
+                descriptionResults.put(result.getUuid(), (DescriptionBase<?>) result);
             }
         }
-        List<Object> updateRows = matrix.getDescriptions().stream().filter(row->descriptionResults.keySet().contains(((RowWrapperDTO<?>)row).getDescription().getDescriptionUuid())).collect(Collectors.toList());
-        for (Object updateRow: updateRows){
-            if (updateRow instanceof SpecimenRowWrapperDTO){
-                SpecimenRowWrapperDTO dto = (SpecimenRowWrapperDTO)updateRow;
-                DescriptionBaseDto desc = DescriptionBaseDto.fromDescription(descriptionResults.get(((SpecimenRowWrapperDTO) updateRow).getDescription().getDescriptionUuid()));
-                dto.setDescription(desc);
+        List<Object> updateRows = matrix.getDescriptions().stream()
+                .filter(row -> descriptionResults.keySet()
+                        .contains(((RowWrapperDTO<?>) row).getDescription().getDescriptionUuid()))
+                .collect(Collectors.toList());
+        
+        Set<UUID> uuids = new HashSet<>();
+        for (UUID uuid: descriptionResults.keySet()) {
+            uuids.add(uuid);
+        }
+        
+        List<DescriptionBaseDto> dtos = CdmStore.getService(IDescriptionService.class).loadDtos(uuids);
+        Map<UUID, DescriptionBaseDto> dtoMap = new HashMap<>();
+        dtos.forEach(s->dtoMap.put(s.getDescriptionUuid(), s));
+        for (Object updateRow : updateRows) {
+            if (updateRow instanceof SpecimenRowWrapperDTO) {
+                SpecimenRowWrapperDTO dto = (SpecimenRowWrapperDTO) updateRow;
+                
+//                DescriptionBaseDto desc = DescriptionBaseDto.fromDescription(descriptionResults
+//                        .get(((SpecimenRowWrapperDTO) updateRow).getDescription().getDescriptionUuid()));
+                dto.setDescription(dtoMap.get(dto.getDescription().getDescriptionUuid()));
             }
         }
-//        matrix.loadDescriptions(getDescriptiveDataSet().getUuid(), false);
+        // matrix.loadDescriptions(getDescriptiveDataSet().getUuid(), false);
         eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, null);
         dirty.setDirty(false);
     }
@@ -257,22 +275,15 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
     }
 
     @Focus
-    public void setFocus(){
-        if(conversation!=null){
-            conversation.bind();
-        }
-        if(cdmEntitySession != null) {
+    public void setFocus() {
+        if (cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
     }
 
     @PreDestroy
-    public void dispose(){
-        if (conversation != null) {
-            conversation.close();
-            conversation = null;
-        }
-        if(cdmEntitySession != null) {
+    public void dispose() {
+        if (cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
         }
@@ -281,22 +292,18 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
         dirty.setDirty(false);
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     @Override
     public void changed(Object element) {
         setDirty();
         matrix.getNatTable().refresh();
-        if (element instanceof DescriptionBase){
-            if (!matrix.getRowsToMerge().containsKey(((DescriptionBase<?>)element).getUuid())){
-                matrix.addDescriptionToSave((DescriptionBase<?>)element);
+        if (element instanceof DescriptionBase) {
+            if (!matrix.getRowsToMerge().containsKey(((DescriptionBase<?>) element).getUuid())) {
+                matrix.addDescriptionToSave((DescriptionBase<?>) element);
+            }
+        }else if (element instanceof DescriptionElementDto) {
+            
+            if (!matrix.getRowsToMerge().containsKey(((DescriptionElementDto) element).getElementUuid())) {
+               // matrix.putRowToMerge(rowWrapper);
             }
         }
     }
@@ -313,14 +320,14 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
 
     @Override
     public Collection<DescriptiveDataSet> getRootEntities() {
-        //no dataset entity only dto
+        // no dataset entity only dto
         return null;
     }
 
     @Override
     public Map<Object, List<String>> getPropertyPathsMap() {
         Map<Object, List<String>> propertyMap = new HashMap<>();
-        propertyMap.put(SpecimenOrObservationBase.class,WS_PROPERTY_PATH);
+        propertyMap.put(SpecimenOrObservationBase.class, WS_PROPERTY_PATH);
         return propertyMap;
     }
 
@@ -332,4 +339,16 @@ public class CharacterMatrixPart implements IE4SavablePart, IConversationEnabled
         stackLayout.topControl = matrix;
         matrix.getParent().layout();
     }
+
+   
+    @Override
+    public IStructuredSelection getActualSelection() {
+
+        return matrix.getSelection();
+    }
+    
+    @Override
+    public FeatureDto getActualFeature(int columnPosition) {
+        return matrix.getFeatures().get(columnPosition - CharacterMatrix.LEADING_COLUMN_COUNT);
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataComboElement.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataComboElement.java
new file mode 100644 (file)
index 0000000..cfb0115
--- /dev/null
@@ -0,0 +1,264 @@
+/**
+* Copyright (C) 2023 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.editor.descriptiveDataSet.matrix;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.equinox.internal.p2.ui.misc.StringMatcher;
+import org.eclipse.jface.fieldassist.ComboContentAdapter;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalListener;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Listener;
+
+import eu.etaxonomy.cdm.persistence.dto.StateDataDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author katjaluther
+ * @since 26.09.2023
+ */
+public class DataComboElement {
+
+    private Combo valueCombo;
+    
+
+    private CdmContentProposalAdapter adapter ;
+
+    
+    public DataComboElement(Composite valuesComposite, String value, StateDataDto selectedState, List<TermDto> dataValues, boolean modifier, int style) {
+
+        valueCombo = new Combo(valuesComposite, SWT.BORDER);
+        int index = 0;
+        int selectedIndex = 0;
+        valueCombo.add("", index);
+        index++;
+        for (TermDto term : dataValues) {
+            valueCombo.add(term.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel(), index);
+            valueCombo.setData(term.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel(), term);
+
+            try {
+                   if (selectedState != null && ((!modifier && selectedState.getState() != null && term.getUuid().equals(selectedState.getState().getUuid())) || (modifier && selectedState.getModifiers() != null && !selectedState.getModifiers().isEmpty() && term.getUuid().equals(selectedState.getModifiers().iterator().next().getUuid()))) ){
+                       selectedIndex = index;
+                   }
+            }catch(NullPointerException e) {
+                System.err.println(e.getMessage());
+            }
+            index++;
+        }
+//        if (selectedIndex != 0) {
+//            valueCombo.select(selectedIndex);
+//        }else {
+//            if (value != null && !value.equals("null")) {
+//                valueCombo.setText(value);
+//                
+//            }
+//        }
+//        
+        valueCombo.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                int index = valueCombo.getSelectionIndex();
+                if (index >-1) {
+                    TermDto state = (TermDto)valueCombo.getData(valueCombo.getItem(index));
+                    if (selectedState == null) {
+                        return;
+                    }
+                    if (modifier) {
+                        if (selectedState.getModifiers() == null) {
+                            selectedState.setModifiers(new ArrayList<TermDto>());
+                        }else {
+                            selectedState.getModifiers().clear();
+                        }
+                        if (state != null) {
+                            selectedState.addModifier(state);
+                        }
+                    }else {
+                        selectedState.setState(state);
+                    }
+                }
+            }
+        });
+        
+//        ContentProposalAdapter adapter;
+
+        adapter = new CdmContentProposalAdapter(valueCombo, new ComboContentAdapter(), getProposalProvider(), null, null);
+        adapter.setPropagateKeys(true);
+        adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_INSERT);
+        adapter.addContentProposalListener(new IContentProposalListener() {
+            @SuppressWarnings("unchecked")
+            @Override
+            public void proposalAccepted(IContentProposal proposal) {
+                Listener[] listeners = valueCombo.getListeners(SWT.Selection);
+
+                for (Listener listener : listeners) {
+                    valueCombo.removeListener(SWT.Selection, listener);
+                }
+                int selectedIndex = 0;
+                if (proposal.getContent() == null) {
+                    // set selection to the emptyElement
+                    selectedIndex = 0;
+                } else {
+                    int index = 1;
+                    if (proposal.getContent() != null) {
+                        for (TermDto value: dataValues) {                           
+                            if (value.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel().equals(proposal.getContent())) {
+                                selectedIndex = index++;
+                                break;
+                            }
+                            index++;
+                            
+                        }
+                    }
+                    
+                }
+
+                for (Listener listener : listeners) {
+                    valueCombo.addListener(SWT.Selection, listener);
+                }
+                valueCombo.select(selectedIndex); 
+                TermDto state = (TermDto)valueCombo.getData(valueCombo.getItem(selectedIndex));
+                
+                if (selectedState == null) {
+                    return;
+                }
+                if (modifier) {
+                    if (selectedState.getModifiers()== null) {
+                        selectedState.setModifiers(new ArrayList<TermDto>());
+                    }else {
+                        selectedState.getModifiers().clear();
+                    }
+                    if (state != null) {
+                        selectedState.addModifier(state);
+                    }
+                }else {
+                    selectedState.setState(state);
+                }               
+            }
+        });
+
+        if (selectedIndex != 0) {
+            valueCombo.select(selectedIndex);
+        }else {
+            if (value != null && !value.equals("null")) {
+                valueCombo.setText(value);  
+                valueCombo.setFocus();
+            }
+        }
+        
+
+    }
+        
+       
+    IContentProposalProvider getProposalProvider() {
+        return new IContentProposalProvider() {
+            
+            @Override
+            public IContentProposal[] getProposals(String contents, int position) {
+                String[] items = valueCombo.getItems();
+                if (contents.length() == 0 || items.length == 0) {
+                    return new IContentProposal[0];
+                }
+                StringMatcher matcher = new StringMatcher("*" + contents + "*", true, false); //$NON-NLS-1$ //$NON-NLS-2$
+                ArrayList<String> matches = new ArrayList<>();
+                for (int i = 0; i < items.length; i++) {
+                    if (matcher.match(items[i])) {
+                        matches.add(items[i]);
+                    }
+                }
+                if (matches.size() == 0) {
+                    for (int i = 0; i < items.length; i++) {
+                        matches.add(items[i]);
+                    }
+                }
+                Collections.sort(matches);
+
+                // We don't want to autoactivate if the only proposal exactly matches
+                // what is in the combo.  This prevents the popup from
+                // opening when the user is merely scrolling through the combo values or
+                // has accepted a combo value.
+                if (matches.size() == 1 && matches.get(0).equals(valueCombo.getText())) {
+                    return new IContentProposal[0];
+                }
+
+                if (matches.isEmpty()) {
+                    return new IContentProposal[0];
+                }
+
+                // Make the proposals
+                IContentProposal[] proposals = new IContentProposal[matches.size()];
+                for (int i = 0; i < matches.size(); i++) {
+                    final String proposal = matches.get(i);
+                    proposals[i] = new IContentProposal() {
+
+                        @Override
+                        public String getContent() {
+                            return proposal;
+                        }
+
+                        @Override
+                        public int getCursorPosition() {
+                            return proposal.length();
+                        }
+
+                        @Override
+                        public String getDescription() {
+                            return null;
+                        }
+
+                        @Override
+                        public String getLabel() {
+                            return null;
+                        }
+                    };
+                }
+
+                return proposals;
+            }
+        };
+    }
+
+
+    /**
+     * @return the valueCombo
+     */
+    public Combo getValueCombo() {
+        return valueCombo;
+    }
+
+
+    /**
+     * @param valueCombo the valueCombo to set
+     */
+    public void setValueCombo(Combo valueCombo) {
+        this.valueCombo = valueCombo;
+    }
+    
+    public void setListVisible(boolean isSet) {
+        this.valueCombo.setListVisible(isSet);
+    }
+
+
+    /**
+     * @return the adapter
+     */
+    public CdmContentProposalAdapter getAdapter() {
+        return adapter;
+    }
+    
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataDialogComposite.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataDialogComposite.java
new file mode 100644 (file)
index 0000000..8337870
--- /dev/null
@@ -0,0 +1,131 @@
+/**
+* Copyright (C) 2023 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.editor.descriptiveDataSet.matrix;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+import eu.etaxonomy.cdm.model.description.NoDescriptiveDataStatus;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author katjaluther
+ * @since 19.09.2023
+ */
+public abstract class DataDialogComposite extends Composite {
+    protected Combo noDataCombo;
+    protected Composite valuesComposite;
+    protected Composite headComposite;
+    protected CharacterMatrix matrix;
+    protected DescriptionElementDto editorValue;     
+    
+    public DataDialogComposite(Composite parent, int style) {
+        super(parent, style);       
+    }
+    
+    public NoDescriptiveDataStatus getNoDataValue(){
+        int selectIndex = noDataCombo.getSelectionIndex();
+        if (selectIndex > -1) {
+            String item = noDataCombo.getItem(selectIndex);
+            NoDescriptiveDataStatus status = (NoDescriptiveDataStatus)noDataCombo.getData(item);
+            return status;
+        }
+       return null;
+    }
+    
+    protected void createNoDataCombo(Composite composite) {
+        
+        Composite noDataComposite = new Composite(this, SWT.NONE);
+        noDataComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        noDataComposite.setLayout(new GridLayout(2, false));       
+        
+        Label lblNoDataLabel = new Label(noDataComposite, SWT.NONE);
+        lblNoDataLabel.setText("No Data Available");
+        noDataCombo = new Combo(noDataComposite, SWT.NONE | SWT.READ_ONLY);
+        noDataCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        int index = 1;
+        noDataCombo.add("", 0);
+        List<NoDescriptiveDataStatus> valueList = new ArrayList<>();
+        Collections.addAll(valueList, NoDescriptiveDataStatus.values());
+        Collections.sort(valueList, new Comparator<NoDescriptiveDataStatus>() {
+            @Override
+            public int compare(NoDescriptiveDataStatus o1, NoDescriptiveDataStatus o2) {
+                return o1.getLabel(CdmStore.getDefaultLanguage()).compareTo(o2.getLabel(CdmStore.getDefaultLanguage()));
+            }
+        });
+        for (NoDescriptiveDataStatus status : valueList) {            
+            noDataCombo.add(status.getLabel(), index);
+            noDataCombo.setData(status.getLabel(), status);   
+            if (editorValue != null && editorValue.getNoDataStatus() != null && editorValue.getNoDataStatus().equals(status)) {
+                noDataCombo.select(index);
+            }
+            index++;
+
+        }
+        
+        noDataCombo.addSelectionListener(new SelectionAdapter() {
+
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String name = noDataCombo.getText();
+                editorValue.setNoDataStatus((NoDescriptiveDataStatus)noDataCombo.getData(name));
+                if (StringUtils.isNotBlank(name)) {
+                    valuesComposite.setEnabled(false);
+                    for(Control c: valuesComposite.getChildren()) {
+                        c.setVisible(false);
+                    }
+                    if (headComposite != null) {
+                        headComposite.setEnabled(false);
+                        for(Control c: headComposite.getChildren()) {
+                            c.setVisible(false);
+                        }
+                    }
+                   // valuesComposite.dispose();
+                }else {
+                    valuesComposite.setEnabled(true);
+                    for(Control c: valuesComposite.getChildren()) {
+                        c.setVisible(true);
+                    }
+                    if (headComposite != null) {
+                        headComposite.setEnabled(true);
+                        for(Control c: headComposite.getChildren()) {
+                            c.setVisible(true);
+                        }
+                    }
+                }
+                
+            }
+
+       });
+    }
+    
+    protected void refresh() {
+        this.getShell().redraw();
+        this.getShell().pack();
+    }
+   
+    
+    
+
+}
index b480bbff421202247ed13eda04b16f9b1ac768cd..556d9fb79675bf060f033c6afc4125f617ccf3e7 100644 (file)
@@ -10,9 +10,9 @@ package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
 
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.model.description.DescriptionType;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoByNameComparator;
 
index a1b9e8d7d275df39e55103cd24cf51725a50bb23..b561396127c91f6789cf9e5c84c70ad6c9816563 100644 (file)
@@ -12,18 +12,18 @@ import java.util.Set;
 
 import org.eclipse.swt.graphics.Image;
 
-import eu.etaxonomy.cdm.api.service.dto.CategoricalDataDto;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
-import eu.etaxonomy.cdm.api.service.dto.StateDataDto;
 import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
 import eu.etaxonomy.cdm.model.description.DescriptionType;
 import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
+import eu.etaxonomy.cdm.persistence.dto.StateDataDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.taxeditor.model.ImageResources;
index 437ebeaeca5f04a6ed1a9b5b62969415013f0c36..2f41c8abaac42940a5aeee248333d20a21824f87 100644 (file)
@@ -11,19 +11,23 @@ package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor;
 
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * Property accessor class which maps setting and getting data for
  * each row in the character matrix
+ *
  * @author pplitzner
  * @since Nov 26, 2017
  *
@@ -85,8 +89,64 @@ public class SpecimenColumnPropertyAccessor implements IColumnPropertyAccessor<O
             }
             return taxonWrapper.getDisplayDataForFeature(feature.getUuid());
 
+        } else if (columnIndex == 0) {
+            return rowObject;
         }
-        else if (columnIndex == 0) {
+        return null;
+    }
+    
+    public Object getData(Object rowObject, int columnIndex) {
+        if (rowObject instanceof SpecimenRowWrapperDTO) {
+            SpecimenRowWrapperDTO rowWrapper = (SpecimenRowWrapperDTO) rowObject;
+            switch (columnIndex) {
+            case 0:
+                if (matrix.isTreeView()) {
+                    return "#" + rowWrapper.getSpecimenDto().getId();
+                } else {
+                    return rowWrapper.getTaxonNode();
+                }
+            case 1:
+                if (rowWrapper.getSpecimenDto() != null) {
+                    if (StringUtils.isBlank(rowWrapper.getSpecimenDto().getCollectorsString())) {
+                        if (rowWrapper.getFieldUnit() != null) {
+                            return rowWrapper.getFieldUnit().getTitleCache();
+                        } else {
+                            return "no information";
+                        }
+                    }
+                    return rowWrapper.getSpecimenDto().getCollectorsString();
+                } else if (rowWrapper.getFieldUnit() != null) {
+                    return rowWrapper.getFieldUnit().getTitleCache();
+                } else {
+                    return "no information";
+                }
+            case 2:
+                return rowWrapper.getIdentifier();
+            case 3:
+                return rowWrapper.getCountry();
+
+            default:
+                break;
+            }
+            FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
+            Set<DescriptionElementDto> data = rowWrapper.getDataValueForFeature(feature.getUuid());
+            DescriptionElementDto result = null;
+            if (data != null && !data.isEmpty()) {
+                result = data.iterator().next();
+            }
+            return result;
+        } else if (rowObject instanceof TaxonRowWrapperDTO) {
+            TaxonRowWrapperDTO taxonWrapper = (TaxonRowWrapperDTO) rowObject;
+            if (columnIndex == 0) {
+                return taxonWrapper.getDescription();
+            }
+            FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
+            if (feature == null) {
+                return null;
+            }
+            return taxonWrapper.getDataValueForFeature(feature.getUuid());
+
+        } else if (columnIndex == 0) {
             return rowObject;
         }
         return null;
@@ -94,19 +154,21 @@ public class SpecimenColumnPropertyAccessor implements IColumnPropertyAccessor<O
 
     @Override
     public void setDataValue(Object rowObject, int columnIndex, Object newValue) {
-        if(rowObject instanceof RowWrapperDTO){
-            RowWrapperDTO rowWrapper = (RowWrapperDTO)rowObject;
+        if (rowObject instanceof RowWrapperDTO) {
+            RowWrapperDTO rowWrapper = (RowWrapperDTO) rowObject;
 
             FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
             if(feature.isSupportsCategoricalData()
                     && newValue instanceof Collection){
-               
-               List<TermDto> dtos = new ArrayList<>();
-               if (((Collection) newValue).stream().allMatch(o->o instanceof TermDto) ){
-                       dtos = (List<TermDto>)newValue;
-               }
 
-                rowWrapper.setDataValueForCategoricalData(feature.getUuid(), dtos);
+                List<Object> dtos = new ArrayList<>();
+                
+                //TODO:This needs to be adapted because already added modifiers will be deleted!!!!!
+                if (((Collection) newValue).stream().allMatch(o -> o instanceof TermDto)) {
+                    dtos = (List<Object>) newValue;
+                }
+
+                rowWrapper.setDataValueForCategoricalData(feature.getUuid(), dtos, PreferencesUtil.getGlobalLanguage());
                 matrix.putRowToMerge(rowWrapper);
             }
         }
index 135b56f944976be5e8ed3cd4fa7109fa8d6ab21c..21440607633a0f5a67ab37ca3207ee522ca4a8ad 100644 (file)
@@ -9,6 +9,7 @@
 */
 package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider;
@@ -34,8 +35,20 @@ public class CategoricalComboBoxDataProvider implements IComboBoxDataProvider {
     @Override
     public List<?> getValues(int columnIndex, int rowIndex) {
         FeatureDto feature = matrix.getIndexToFeatureMap().get(columnIndex);
-        List<TermDto> supportedStatesForCategoricalFeature = matrix.getSupportedStatesForCategoricalFeature(feature.getUuid());
-        return supportedStatesForCategoricalFeature;
+        List<TermDto> supportedStatesForCategoricalFeature = matrix
+                .getSupportedStatesForCategoricalFeature(feature.getUuid());
+        List<Object> objectsList = new ArrayList<>();
+
+        int index = 0;
+//        for (NoDescriptiveDataStatus status : NoDescriptiveDataStatus.values()) {
+//            objectsList.add(index, status);
+//            index++;
+//        }
+        for (TermDto term : supportedStatesForCategoricalFeature) {
+            objectsList.add(index, term);
+            index++;
+        }
+        return objectsList;
     }
 
 }
index 9a422356e4a780ba426dc4ef0be157a0e6d9dd2c..4a2b4d16ec4daae4bdc4633e2c3c3fe2661b0dbb 100644 (file)
 */
 package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
+import java.util.Iterator;
+import java.util.Map;
 import java.util.Set;
 
-import org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor;
-import org.eclipse.nebula.widgets.nattable.widget.NatCombo;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.jface.window.Window;
+import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
+import org.eclipse.nebula.widgets.nattable.edit.ICellEditHandler;
+import org.eclipse.nebula.widgets.nattable.edit.gui.AbstractDialogCellEditor;
+import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
+import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
-import eu.etaxonomy.taxeditor.event.EventUtility;
-import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 
 /**
  * Cell editor for CategoricalData
+ * 
  * @author pplitzner
  * @since Dec 7, 2017
  *
  */
-public class CategoricalDataCellEditor extends ComboBoxCellEditor{
+public class CategoricalDataCellEditor extends AbstractDialogCellEditor {
 
+    private CategoricalDataDto editorValue;
+    private RowWrapperDTO<?> rowWrapperDTO;
+    private boolean closed;
     private CharacterMatrix matrix;
+    private Character initialInput;
+   
 
-    public CategoricalDataCellEditor(CharacterMatrix matrix, CategoricalComboBoxDataProvider categoricalComboBoxDataProvider) {
-        super(categoricalComboBoxDataProvider, 10);
+    public CategoricalDataCellEditor(CharacterMatrix matrix) {
+        super();
         this.matrix = matrix;
-        setUseCheckbox(true);
-        setMultiselect(true);
-        setShowDropdownFilter(true);
     }
 
     @Override
-    public void setCanonicalValue(Object canonicalValue) {
-        List canonicalValueList = new ArrayList<>();
-        
-        if (canonicalValue instanceof String[]){
-               String[] stringArray = (String[])canonicalValue;
-               for (int i = 0; i<stringArray.length; i++){
-                       canonicalValueList.add(stringArray[i]);
-               }
-        }else if (canonicalValue instanceof List){
-               canonicalValueList = (List<String>)canonicalValue;
-        }else if (canonicalValue instanceof String){
-               canonicalValueList.add((String)canonicalValue);
-        }else if (canonicalValue instanceof HashSet){
-               canonicalValueList = new ArrayList(((HashSet)canonicalValue));
+    public int open() {
+        Object rowObject = matrix.getBodyDataProvider().getRowObject(getRowIndex());
+        if(rowObject instanceof RowWrapperDTO){
+            this.closed = false;
+            return getDialogInstance().open();
         }
-        super.setCanonicalValue(canonicalValueList);
+        return Window.CANCEL;
     }
 
     @Override
-    protected Control activateCell(Composite parent, Object originalCanonicalValue) {
-       
-        if(matrix.getBodyDataProvider().getRowObject(this.getRowIndex()) instanceof RowWrapperDTO){
-            NatCombo natCombo = (NatCombo) super.activateCell(parent, originalCanonicalValue);
-            natCombo.addSelectionListener(new SelectionListener() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    matrix.setDirty();
-                }
-                @Override
-                public void widgetDefaultSelected(SelectionEvent e) {
+    public CategoricalDataDialog createDialogInstance() {
+        return new CategoricalDataDialog(this.initialInput, matrix, this.parent.getShell(), getCanonicalValue(), this.layerCell, this, this.configRegistry);
+    }
+
+    @Override
+    public CategoricalDataDialog getDialogInstance() {
+        return (CategoricalDataDialog) this.dialog;
+    }
+
+    @Override
+    public Object getEditorValue() {
+        return this.editorValue;
+    }
+
+    @Override
+    public void setEditorValue(Object value) {
+        ((CategoricalDataDialog)this.dialog).setEditorValue((CategoricalDataDto) value);
+        ((CategoricalDataDialog)this.dialog).setRowWrapper(rowWrapperDTO);
+        this.editorValue = (CategoricalDataDto) value;
+    }
+
+    @Override
+    public void close() {
+        this.closed = true;
+        this.dialog = null;
+        this.editorValue = null;
+    }
+
+    @Override
+    public boolean isClosed() {
+        return closed;
+    }
+
+    @Override
+    public Control activateCell(Composite parent, Object originalCanonicalValue, EditModeEnum editMode,
+            ICellEditHandler editHandler, ILayerCell cell, IConfigRegistry configRegistry) {
+        this.initialInput = null;
+        Object rowObject = matrix.getBodyDataProvider().getRowObject(cell.getRowIndex());
+        FeatureDto feature = matrix.getIndexToFeatureMap().get(cell.getColumnIndex());
+        if(feature.getSupportedCategoricalEnumerations().isEmpty()) {
+            return null;
+        }
+        CategoricalDataDto categoricalDataDto = null;
+        if(rowObject instanceof RowWrapperDTO){
+            rowWrapperDTO = (RowWrapperDTO<?>) rowObject;
+            Set<DescriptionElementDto> dataValueForFeature = rowWrapperDTO.getDataValueForFeature(feature.getUuid());
+            if (dataValueForFeature != null && dataValueForFeature.size() > 1){
+                return null;
+            }
+            
+            DescriptionElementDto dto = null;
+            if (dataValueForFeature != null){
+                Iterator<DescriptionElementDto> it = dataValueForFeature.iterator();
+                if(it.hasNext() ){
+                    dto = it.next();                    
                 }
-            });
-            return natCombo;
+            }
+            if(dto instanceof CategoricalDataDto){
+                categoricalDataDto = (CategoricalDataDto) dto;
+                categoricalDataDto.setFeatureDto(feature);
+            }
+            //create new Quantitative Data
+            if (categoricalDataDto == null) {
+                categoricalDataDto = ((RowWrapperDTO) rowObject).addCategoricalData(feature);
+            }
+            /**
+             * when opening the the dialog by a key stroke, store the key pressed
+             * and pass it to the dialog. This is common behavior but by overriding
+             * this method we always pass the QuantitativeData object to the dialog
+             * so we need to buffer the key stroke
+             */
+            if(originalCanonicalValue instanceof Character){
+                this.initialInput = (Character) originalCanonicalValue;
+            }
         }
-        return null;
+        return super.activateCell(parent, categoricalDataDto, editMode, editHandler, cell, configRegistry);
+    }
+
+    @Override
+    public void setDialogSettings(Map<String, Object> editDialogSettings) {
+        //pass through dialog setting to wrapped dialog
+        ((CategoricalDataDialog)this.dialog).setDialogSettings(editDialogSettings);
     }
 
+   
+
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialog.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialog.java
new file mode 100644 (file)
index 0000000..99256cb
--- /dev/null
@@ -0,0 +1,122 @@
+/**
+* Copyright (C) 2018 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.editor.descriptiveDataSet.matrix.categorical;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
+import org.eclipse.nebula.widgets.nattable.edit.editor.ICellEditor;
+import org.eclipse.nebula.widgets.nattable.edit.gui.CellEditDialog;
+import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
+import eu.etaxonomy.cdm.persistence.dto.StateDataDto;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author pplitzner
+ * @since Jul 19, 2018
+ *
+ */
+public class CategoricalDataDialog extends CellEditDialog {
+
+    private Character initialInput;
+
+    private CharacterMatrix matrix;
+
+    public CategoricalDataDialog(Character initialInput, CharacterMatrix matrix, Shell parentShell, Object originalCanonicalValue, ILayerCell cell,
+            ICellEditor cellEditor, IConfigRegistry configRegistry) {
+        super(parentShell, originalCanonicalValue, cell, cellEditor, configRegistry);
+        this.initialInput = initialInput;
+        this.matrix = matrix;
+        
+        
+    }
+
+    private CategoricalDataDto editorValue;
+    private RowWrapperDTO<?> rowWrapperDTO;
+
+    private CategoricalDataDialogComposite composite;
+
+    @Override
+    protected Control createDialogArea(Composite parent) {
+        Collection<String> displayStrings = rowWrapperDTO.getDisplayDataForFeature(editorValue.getFeatureUuid());
+        String initialDisplay = null;
+        StringBuffer sb = new StringBuffer();
+        boolean first = true;
+        if (displayStrings != null) {
+            for (String o : displayStrings) {
+                sb.append(first? o : ", " + o);
+                first = false;
+                           
+            }
+        }
+        initialDisplay = (sb.length() > 0)? sb.toString() : "-";
+        
+        composite = new CategoricalDataDialogComposite(initialDisplay, this.initialInput, editorValue , parent, matrix,SWT.NONE);
+        return composite;
+    }
+
+    void setEditorValue(CategoricalDataDto editorValue) {
+        this.editorValue = editorValue;
+    }
+
+    void setRowWrapper(RowWrapperDTO<?> rowWrapperDTO) {
+        this.rowWrapperDTO = rowWrapperDTO;
+    }
+
+    @Override
+    public boolean close() {
+        if(getReturnCode()==Window.OK){
+            //clear values
+            //editorValue.getValues().clear();
+            //add back all values from text fields
+            
+            if (composite.getNoDataValue() == null) {
+                Set<StateDataDto> selectedStates= composite.getSelectedStates();
+                Set<StateDataDto> statesToRemove = new HashSet<>();
+                for (StateDataDto state: selectedStates) {
+                    if (state.getState() == null) {
+                        statesToRemove.add(state);
+                    }
+                }
+                selectedStates.removeAll(statesToRemove);
+                rowWrapperDTO.setDataValueForCategoricalData(editorValue.getFeatureDto().getUuid(), new ArrayList<StateDataDto>(selectedStates), PreferencesUtil.getGlobalLanguage());
+            }else {
+                rowWrapperDTO.getDataValueForFeature(editorValue.getFeatureDto().getUuid()).clear();
+                CategoricalDataDto element = rowWrapperDTO.addCategoricalData(editorValue.getFeatureDto());
+                element.setNoDataStatus(composite.getNoDataValue());
+                
+                rowWrapperDTO.generateNewDisplayString(editorValue.getFeatureUuid(), element, PreferencesUtil.getGlobalLanguage());
+            }
+            
+            
+            matrix.putRowToMerge(rowWrapperDTO);
+
+            matrix.setDirty();
+        }
+        return super.close();
+    }
+    
+    @Override
+    protected boolean isResizable() {
+        return true;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialogComposite.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialogComposite.java
new file mode 100644 (file)
index 0000000..e1923f1
--- /dev/null
@@ -0,0 +1,209 @@
+// $Id$
+/**
+ * Copyright (C) 2018 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.editor.descriptiveDataSet.matrix.categorical;
+
+
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
+import eu.etaxonomy.cdm.persistence.dto.StateDataDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.DataComboElement;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.DataDialogComposite;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+
+/**
+ * @author k.luther
+ * @date 16.09.2023
+ *
+ */
+public class CategoricalDataDialogComposite extends DataDialogComposite {
+
+   
+//    Combo noDataCombo;
+    
+    String initialString;
+    private Set<StateDataDto> stateList;
+    
+    
+    
+
+    public CategoricalDataDialogComposite(String initialInput, Character c, CategoricalDataDto editorVal, Composite parent, CharacterMatrix matrix,
+            int style) {
+        super(parent, style);
+        this.matrix = matrix;
+        this.editorValue = editorVal;
+        initialString = initialInput;
+        
+
+        setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        ((GridData)getLayoutData()).minimumWidth= 300;
+
+        setLayout(new GridLayout(1, false));       
+
+        createNoDataCombo(this);
+        headComposite = new Composite(this, SWT.NONE);
+        headComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        headComposite.setLayout(new GridLayout(2, false));  
+        Label lblNewLabel = new Label(headComposite, SWT.NONE);
+        if (getModifiers() != null && !getModifiers().isEmpty()) {
+            lblNewLabel.setText("Modifier and State");
+        }else {
+            lblNewLabel.setText("State");
+        }
+        
+        Button addNewState =  new Button(headComposite, SWT.NONE);
+        addNewState.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, true, 1,1));
+        
+        addNewState.setImage(ImageResources.getImage(ImageResources.ADD_ICON));
+        //new Label(composite_2, SWT.NONE);
+        addNewState.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                DataComboElement emptyTextField = addState(valuesComposite, 
+                        initialString == null ? null : c, new StateDataDto());
+                emptyTextField.getValueCombo().setFocus();
+                emptyTextField.setListVisible(true);
+                
+                refresh();
+            }
+        });
+        
+        valuesComposite = new Composite(this, SWT.NONE);
+        valuesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+
+        valuesComposite.setLayout(new GridLayout(1, false));     
+        
+        List<TermDto> selectedTerms = new ArrayList<>();
+        if (editorVal != null) {
+            editorVal.getStates().removeIf(s->s == null);
+            editorVal.getStates().forEach(s -> selectedTerms.add(s.getState()));
+        }
+       
+       
+        // add empty text field for new state
+        DataComboElement emptyDataElement = addState(valuesComposite, 
+               initialString == null ? null : c, new StateDataDto());
+
+        // add existing states
+        ((CategoricalDataDto)editorValue).getStates().stream()
+                .forEach(state -> addState(valuesComposite, null, state));
+
+        if (editorValue.getNoDataStatus()!= null) {
+            headComposite.setEnabled(false);
+            valuesComposite.setEnabled(false);
+            for(Control control: valuesComposite.getChildren()) {
+                control.setVisible(false);
+            }
+            for(Control control: headComposite.getChildren()) {
+                control.setVisible(false);
+            }
+        }       
+       emptyDataElement.getAdapter().activate();
+    }
+   
+    public DescriptionElementDto getEditorValue() {
+        return editorValue;
+    }
+    
+    private List<TermDto> getCategoricalValues(){
+       List<TermDto> supportedStatesForCategoricalFeature = matrix
+                .getSupportedStatesForCategoricalFeature(editorValue.getFeatureUuid());
+        
+       return supportedStatesForCategoricalFeature;
+    }
+    
+    
+    private List<TermDto> getModifiers(){
+        List<TermDto> recommendedModifiersForCategoricalFeature = matrix
+                 .getRecommendModifiersForCategoricalFeature(editorValue.getFeatureUuid());
+         
+        return recommendedModifiersForCategoricalFeature;
+    }
+    
+    public Set<StateDataDto> getSelectedStates(){
+//        String[] selected = valueCombo.getSelections();
+//        List<TermDto> selectedStates = new ArrayList<>();
+//        for (String value: selected) {
+//            selectedStates.add((TermDto)valueCombo.getData(value));
+//        }
+        return stateList;
+    }
+    
+    private DataComboElement addState(Composite valuesComposite, Character value, StateDataDto selectedState) {
+        
+        Composite composite_2 = new Composite(valuesComposite, SWT.NONE);
+        
+        composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+        int numColumns = 2;
+        if (getModifiers() != null && !getModifiers().isEmpty()) {
+            numColumns = 3;
+        }
+        GridLayout gl_composite_2 = new GridLayout(numColumns, false);
+        gl_composite_2.marginHeight = 0;
+        gl_composite_2.marginWidth = 0;
+        gl_composite_2.verticalSpacing = 0;
+        gl_composite_2.horizontalSpacing = 1;
+        composite_2.setLayout(gl_composite_2);
+        
+        Composite composite_3 = new Composite(composite_2, SWT.NONE);        
+        composite_3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, numColumns, 2));
+        GridLayout gl_composite_3 = new GridLayout(1, false);
+        gl_composite_3.marginHeight = 0;
+        gl_composite_3.marginWidth = 0;
+        gl_composite_3.verticalSpacing = 0;
+        gl_composite_3.horizontalSpacing = 1;
+        composite_3.setLayout(gl_composite_3);
+        
+        if (getModifiers() != null && !getModifiers().isEmpty()) {
+            DataComboElement modifierCombo = new DataComboElement(composite_2, null, selectedState, getModifiers(), true, getStyle());
+        }
+        DataComboElement element = new DataComboElement(composite_2, String.valueOf(value), selectedState, getCategoricalValues(), false, getStyle());
+        
+        if (stateList == null) {
+            stateList = new HashSet<>();
+        }
+        if (selectedState != null) {
+            stateList.add(selectedState);
+        }
+        
+        Button btnRemove = new Button(composite_2, SWT.NONE);
+        btnRemove.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
+        //new Label(composite_2, SWT.NONE);
+        btnRemove.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                  composite_2.dispose();
+                  stateList.remove(selectedState);
+                  valuesComposite.getShell().redraw();
+                  valuesComposite.getShell().pack();
+            }
+        });
+        return element;
+    }
+}
\ No newline at end of file
index 34f5487211e55c0c1188882063d8b17c0050d1b3..2db98be511f09ea0a7b65abc05f43759731cf6fc 100644 (file)
@@ -9,11 +9,11 @@
 package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.categorical;
 
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
 
 import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
+import eu.etaxonomy.cdm.persistence.dto.CategoricalDataDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 
 /**
@@ -28,21 +28,22 @@ public class CategoricalDataDisplayConverter extends DisplayConverter {
 
     @Override
     public Object canonicalToDisplayValue(Object canonicalValue) {
-        if(canonicalValue instanceof TermDto){
+        if(canonicalValue instanceof CategoricalDataDto){
+            return canonicalValue;
+        }
+        if (canonicalValue instanceof TermDto) {
             ((TermDto) canonicalValue).localize(new TermRepresentation_L10n());
             return ((TermDto) canonicalValue).getTitleCache();
-        }
-        else if (canonicalValue instanceof Collection) {
+        } else if (canonicalValue instanceof Collection) {
             // Collection.toString() will add [ and ] around
             // the values in the Collection
             // So by removing the leading and ending
             // character, we remove the brackets
-               
+
             String result = canonicalValue.toString();
             result = result.substring(1, result.length() - 1);
             return result;
-        }
-        else if(canonicalValue!=null){
+        } else if (canonicalValue != null) {
             return canonicalValue.toString();
         }
         return null;
index 1130d242b7bd3ed203519d42325e2790144d4f9a..66b55b4291705f2c5ca9f04ff003d4e6d32a7c0d 100755 (executable)
@@ -48,6 +48,7 @@ import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IFeedbackGenerator;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.dialog.configurator.StructuredAggregationConfigurationWizard;
@@ -148,7 +149,7 @@ public class AggregationHandler {
                        Set<TaxonRowWrapperDTO> dtos = new HashSet<>();
                        DescriptiveDataSet dataSet = (DescriptiveDataSet) result.getCdmEntity();
                        for (UUID updatedObj: updatedObjects){
-                                       TaxonRowWrapperDTO rowWrapper = CdmStore.getService(IDescriptiveDataSetService.class).createTaxonRowWrapper(updatedObj, matrix.getDescriptiveDataSet().getUuid());
+                                       TaxonRowWrapperDTO rowWrapper = CdmStore.getService(IDescriptiveDataSetService.class).createTaxonRowWrapper(updatedObj, matrix.getDescriptiveDataSet().getUuid(), PreferencesUtil.getGlobalLanguage());
                                        boolean isRemoved = matrixPart.getMatrix().getDescriptions().remove(rowWrapper);
                                        matrixPart.getMatrix().getDescriptions().add(rowWrapper);
                        }
index 12891d7d86eaf53baced3db0a0ad8893f2b46754..1f1bc70ab0364b1933e889073ba87cacb13701b7 100644 (file)
@@ -16,9 +16,8 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.api.service.IDescriptiveDataSetService;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.model.description.DescriptionType;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
index d7d2b95ed7c5d139c07e2d82225142871855078a..af459357c60e4077796d70d65e6d2f6fbe51f67a 100644 (file)
@@ -24,6 +24,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionType;
 import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrixPart;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
@@ -43,7 +44,7 @@ public abstract class CreateTaxonDescriptionHandler {
         DescriptiveDataSetBaseDto descriptiveDataSet = matrixPart.getDescriptiveDataSet();
         TaxonNodeDto node = (TaxonNodeDto) matrixPart.getSelection().getFirstElement();
         TaxonRowWrapperDTO taxonRowWrapperDTO = CdmStore.getService(IDescriptiveDataSetService.class)
-                .createTaxonDescription(descriptiveDataSet.getUuid(), node.getUuid(), getDescriptionType());
+                .createTaxonDescription(descriptiveDataSet.getUuid(), node.getUuid(), getDescriptionType(), PreferencesUtil.getGlobalLanguage());
 //        matrixPart.getMatrix().getCdmEntitySession().load(taxonRowWrapperDTO.getDescription(), true);
         matrixPart.getMatrix().getDescriptions().add(taxonRowWrapperDTO);
         matrixPart.getMatrix().layout();
index 039a5615fe25b7eaf2a04f4b06a5c9c2fe5707c4..f97352c1ce1758205fe35084fdaa3399038409e5 100755 (executable)
@@ -20,10 +20,10 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.config.RemoveDescriptionsFromDescriptiveDataSetConfigurator;
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.api.service.dto.SpecimenRowWrapperDTO;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.DescriptiveDataSetBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
index 7717a1c33c8994e1cc72822ec7ab7b1fae51019d..14c6cc3c110bb7bebc4aa77577fdcaa3144efbf7 100644 (file)
@@ -26,10 +26,11 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * @author pplitzner
@@ -86,13 +87,20 @@ public class QuantitativeDataDialog extends CellEditDialog {
                         .collect(Collectors.toList());
                 measureToValueMap.put(statisticalMeasure, values);
             }
-            rowWrapperDTO.setDataValueForQuantitativeData(editorValue.getFeatureDto().getUuid(), measureToValueMap, composite.getEditorValue().getMeasurementUnit());
+            rowWrapperDTO.setDataValueForQuantitativeData(editorValue.getFeatureDto().getUuid(), measureToValueMap, composite.getEditorValue().getMeasurementUnit(), composite.getNoDataValue(), PreferencesUtil.getGlobalLanguage());
             if (composite.getEditorValue().getMeasurementUnit() == null && (composite.getEditorValue().getFeatureDto().getRecommendedMeasurementUnits() != null && composite.getEditorValue().getFeatureDto().getRecommendedMeasurementUnits().size() == 1)){
                 editorValue.setMeasurementUnit(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next());
             }
 
 //            ((QuantitativeDataDto)rowWrapperDTO.getDataValueForFeature(editorValue.getFeatureDto().getUuid())).setMeasurementUnit(editorValue.getMeasurementUnit());
             matrix.putRowToMerge(rowWrapperDTO);
+//            DescriptionElementDto actualSelection = null;
+//            if (rowWrapperDTO.getDataValueForFeature(editorValue.getFeatureDto().getUuid()).iterator().hasNext()) {
+//                actualSelection = rowWrapperDTO.getDataValueForFeature(editorValue.getFeatureDto().getUuid()).iterator()
+//                        .next();
+//            }
+//
+//            matrix.setActualSelection(actualSelection);
             matrix.setDirty();
         }
         return super.close();
index c7a4e98f116342828226fbc22cedceea74fd73b4..2ff7df09c9905415bc2b88202e2e29c7839b5e76 100644 (file)
@@ -31,11 +31,11 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
-import eu.etaxonomy.cdm.api.service.dto.StatisticalMeasurementValueDto;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
+import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.DataDialogComposite;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 
 /**
@@ -43,21 +43,25 @@ import eu.etaxonomy.taxeditor.model.ImageResources;
  * @date 16.07.2018
  *
  */
-public class QuantitativeDataDialogComposite extends Composite {
+public class QuantitativeDataDialogComposite extends DataDialogComposite {
 
     private Map<TermDto, List<Text>> textFieldMap = new HashMap<>();
-    QuantitativeDataDto editorValue;
     Combo unitCombo;
+   
     Map<TermDto, Integer> unitMap = null;
     TermDto exactValueDto = TermDto.fromTerm(StatisticalMeasure.EXACT_VALUE());
 
-    public QuantitativeDataDialogComposite(Character initialInput, QuantitativeDataDto editorVal, Composite parent, int style) {
+   
+    
+    public QuantitativeDataDialogComposite(Character initialInput, QuantitativeDataDto editorVal, Composite parent,
+            int style) {
         super(parent, style);
         this.editorValue = editorVal;
-        if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size()>0){
+        if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null
+                && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() > 0) {
             unitMap = new HashMap<>();
-            Integer i = editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() -1;
-            for (TermDto unit: editorValue.getFeatureDto().getRecommendedMeasurementUnits()){
+            Integer i = editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() - 1;
+            for (TermDto unit : editorValue.getFeatureDto().getRecommendedMeasurementUnits()) {
                 unitMap.put(unit, i);
                 i--;
             }
@@ -67,143 +71,169 @@ public class QuantitativeDataDialogComposite extends Composite {
 
         setLayout(new GridLayout(1, false));
 
+        
+        createNoDataCombo(this);
+       
+        
+//        Label lblNoDataLabel = new Label(this, SWT.NONE);
+//        lblNoDataLabel.setText("No Data available");
+//        lblNoDataLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+//
+//        noDataCombo = new Combo(this, SWT.NONE | SWT.READ_ONLY);
+//        noDataCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+//        int index = 1;
+//        noDataCombo.add("", 0);
+//        for (NoDescriptiveDataStatus status : NoDescriptiveDataStatus.values()) {
+//            noDataCombo.add(status.getLabel(), index);
+//            noDataCombo.setData(status.getLabel(), status);
+//            index++;
+//
+//        }
+        
+//        noDataCombo.addSelectionListener(new SelectionAdapter() {
+//
+//            @Override
+//            public void widgetSelected(SelectionEvent e) {
+//                String name = noDataCombo.getText();
+//                editorValue.setNoDataStatus((NoDescriptiveDataStatus)noDataCombo.getData(name));
+//                if (StringUtils.isNotBlank(name)) {
+//                    valuesComposite.setEnabled(false);                    
+//                }else {
+//                    valuesComposite.setEnabled(true);
+//                }
+//            }
+//
+//        });
+        
         ScrolledComposite scrolledComposite_1 = new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL);
         scrolledComposite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
         scrolledComposite_1.setExpandHorizontal(true);
         scrolledComposite_1.setExpandVertical(true);
-
-        Composite valuesComposite = new Composite(scrolledComposite_1, SWT.NONE);
+        valuesComposite = new Composite(scrolledComposite_1, SWT.NONE);
         GridLayout gl_valuesComposite = new GridLayout();
         gl_valuesComposite.marginWidth = 0;
         gl_valuesComposite.marginHeight = 0;
         valuesComposite.setLayout(gl_valuesComposite);
 
-        Composite composite_2 = new Composite(valuesComposite, SWT.NONE);
-        composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-        GridLayout gl_composite_2 = new GridLayout(2, false);
-        gl_composite_2.marginHeight = 0;
-        gl_composite_2.marginWidth = 0;
-        gl_composite_2.verticalSpacing = 0;
-        gl_composite_2.horizontalSpacing = 2;
-        composite_2.setLayout(gl_composite_2);
-
-        Label lblNewLabel = new Label(composite_2, SWT.NONE);
+        Label lblNewLabel = new Label(valuesComposite, SWT.NONE);
         lblNewLabel.setText("Measurement Unit");
         lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() == 1){
-            Label lblUnit = new Label(composite_2, SWT.BORDER);
-            lblUnit.setText(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next().getIdInVocabulary());
+        if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null
+                && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() == 1) {
+            Label lblUnit = new Label(valuesComposite, SWT.BORDER);
+            lblUnit.setText(
+                    editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next().getIdInVocabulary());
             lblUnit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-            editorValue.setMeasurementUnit(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next());
-        }else if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() > 1){
-            unitCombo = new Combo(composite_2, SWT.NONE | SWT.READ_ONLY);
+            ((QuantitativeDataDto)editorValue)
+                    .setMeasurementUnit(editorValue.getFeatureDto().getRecommendedMeasurementUnits().iterator().next());
+        } else if (editorValue.getFeatureDto().getRecommendedMeasurementUnits() != null
+                && editorValue.getFeatureDto().getRecommendedMeasurementUnits().size() > 1) {
+            unitCombo = new Combo(valuesComposite, SWT.NONE | SWT.READ_ONLY);
             unitCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
 
             Set<Entry<TermDto, Integer>> entries = unitMap.entrySet();
             TermDto[] terms = new TermDto[entries.size()];
 
-            for (Entry<TermDto, Integer> unit: unitMap.entrySet()){
-                if (unit.getValue() != null){
+            for (Entry<TermDto, Integer> unit : unitMap.entrySet()) {
+                if (unit.getValue() != null) {
                     terms[unit.getValue()] = unit.getKey();
                 }
             }
             int index = 0;
-            for (TermDto term: terms){
+            for (TermDto term : terms) {
                 unitCombo.add(term.getTitleCache(), index);
                 unitCombo.setData(term.getTitleCache(), term);
-                index ++;
+                index++;
             }
-            if (editorValue.getMeasurementUnit()!= null){
-                unitCombo.select(unitMap.get(editorValue.getMeasurementUnit()));
-            }else{
+            if (((QuantitativeDataDto)editorValue).getMeasurementUnit() != null) {
+                unitCombo.select(unitMap.get(((QuantitativeDataDto)editorValue).getMeasurementUnit()));
+            } else {
                 unitCombo.select(0);
                 String name = unitCombo.getText();
-                editorValue.setMeasurementUnit((TermDto)unitCombo.getData(name));
+                ((QuantitativeDataDto)editorValue).setMeasurementUnit((TermDto) unitCombo.getData(name));
             }
 
-            unitCombo.addSelectionListener(new SelectionAdapter(){
+            unitCombo.addSelectionListener(new SelectionAdapter() {
 
                 @Override
                 public void widgetSelected(SelectionEvent e) {
                     String name = unitCombo.getText();
-                    editorValue.setMeasurementUnit((TermDto)unitCombo.getData(name));
+                    ((QuantitativeDataDto)editorValue).setMeasurementUnit((TermDto) unitCombo.getData(name));
                 }
 
             });
         }
 
-        //add empty text field for exact value
-        Text emptyTextField = addText(valuesComposite, exactValueDto, initialInput==null?null:initialInput.toString());
+        // add empty text field for exact value
+        Text emptyTextField = addText(valuesComposite, exactValueDto,
+                initialInput == null ? null : initialInput.toString());
         emptyTextField.setFocus();
         emptyTextField.setSelection(emptyTextField.getText().length());
 
-        //add existing exact values
-        editorValue.getValues().stream()
-        .filter(measure->measure.getType().getUuid().equals(StatisticalMeasure.EXACT_VALUE().getUuid()))
-        .forEach(exact->addText(valuesComposite, exact.getType(), exact.getValue().toString()));
-
-//        
-
-
-        //add aggregation values
-        if (editorValue.getFeatureDto().getRecommendedStatisticalMeasures() != null){
-               List<TermDto> orderedStatisticalMeasures = new ArrayList<>();
-               orderedStatisticalMeasures.addAll(editorValue.getFeatureDto().getRecommendedStatisticalMeasures());
-               Collections.sort(orderedStatisticalMeasures, new Comparator<TermDto>() {     
-                   @Override
-                   public int compare(TermDto o1, TermDto o2) {
-                       if (o1.getUuid().equals(o2.getUuid())){
-                           return 0;
-                       }
-                       if (o1.getUuid().equals(StatisticalMeasure.MIN().getUuid())){
-                           return -1;
-                       }
-                       if (o2.getUuid().equals(StatisticalMeasure.MIN().getUuid())){
-                           return 1;
-                       }
-                       if (o1.getUuid().equals(StatisticalMeasure.MAX().getUuid())){
-                           return 1;
-                       }
-                       if (o2.getUuid().equals(StatisticalMeasure.MAX().getUuid())){
-                           return -1;
-                       }
-                       if (o1.getUuid().equals(StatisticalMeasure.TYPICAL_LOWER_BOUNDARY().getUuid()) && o2.getUuid().equals(StatisticalMeasure.TYPICAL_UPPER_BOUNDARY().getUuid())){
-                           return -1;
-                       }
-                       if (o2.getUuid().equals(StatisticalMeasure.TYPICAL_LOWER_BOUNDARY().getUuid()) && o1.getUuid().equals(StatisticalMeasure.TYPICAL_UPPER_BOUNDARY().getUuid())){
-                           return -1;
-                       }
-                       return o1.compareTo(o2);
-                   }
-               });
-               
-               orderedStatisticalMeasures
-               .stream()
-               .filter(sm->!sm.equals(exactValueDto))
-               .forEach(measure->{
-                   BigDecimal specificStatisticalValue = editorValue.getSpecificStatisticalValue(measure.getUuid());
-                   addText(valuesComposite, measure, specificStatisticalValue!=null?specificStatisticalValue.toString():null);
-               });
+        // add existing exact values
+        ((QuantitativeDataDto)editorValue).getValues().stream()
+                .filter(measure -> measure.getType().getUuid().equals(StatisticalMeasure.EXACT_VALUE().getUuid()))
+                .forEach(exact -> addText(valuesComposite, exact.getType(), exact.getValue().toString()));
+
+        //
+
+        // add aggregation values
+        if (editorValue.getFeatureDto().getRecommendedStatisticalMeasures() != null) {
+            List<TermDto> orderedStatisticalMeasures = new ArrayList<>();
+            orderedStatisticalMeasures.addAll(editorValue.getFeatureDto().getRecommendedStatisticalMeasures());
+            Collections.sort(orderedStatisticalMeasures, new Comparator<TermDto>() {
+                @Override
+                public int compare(TermDto o1, TermDto o2) {
+                    if (o1.getUuid().equals(o2.getUuid())) {
+                        return 0;
+                    }
+                    if (o1.getUuid().equals(StatisticalMeasure.MIN().getUuid())) {
+                        return -1;
+                    }
+                    if (o2.getUuid().equals(StatisticalMeasure.MIN().getUuid())) {
+                        return 1;
+                    }
+                    if (o1.getUuid().equals(StatisticalMeasure.MAX().getUuid())) {
+                        return 1;
+                    }
+                    if (o2.getUuid().equals(StatisticalMeasure.MAX().getUuid())) {
+                        return -1;
+                    }
+                    if (o1.getUuid().equals(StatisticalMeasure.TYPICAL_LOWER_BOUNDARY().getUuid())
+                            && o2.getUuid().equals(StatisticalMeasure.TYPICAL_UPPER_BOUNDARY().getUuid())) {
+                        return -1;
+                    }
+                    if (o2.getUuid().equals(StatisticalMeasure.TYPICAL_LOWER_BOUNDARY().getUuid())
+                            && o1.getUuid().equals(StatisticalMeasure.TYPICAL_UPPER_BOUNDARY().getUuid())) {
+                        return -1;
+                    }
+                    return o1.compareTo(o2);
+                }
+            });
+
+            orderedStatisticalMeasures.stream().filter(sm -> !sm.equals(exactValueDto)).forEach(measure -> {
+                BigDecimal specificStatisticalValue = ((QuantitativeDataDto)editorValue).getSpecificStatisticalValue(measure.getUuid());
+                addText(valuesComposite, measure,
+                        specificStatisticalValue != null ? specificStatisticalValue.toString() : null);
+            });
         }
 
         scrolledComposite_1.setContent(valuesComposite);
         scrolledComposite_1.setMinSize(valuesComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
 
-//        if(initialInput!=null){
-               boolean hasExactValues = textFieldMap.entrySet().stream()
-                    .filter(entry->entry.getKey().equals(exactValueDto))
-            .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-            );
-            
-            boolean hasAggregatedValues = textFieldMap.entrySet().stream()
-                    .filter(entry->!entry.getKey().equals(exactValueDto))
-            .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-            );
-            enableAggregationFields(hasExactValues, hasAggregatedValues);
-//        }
+        // if(initialInput!=null){
+        boolean hasExactValues = textFieldMap.entrySet().stream().filter(entry -> entry.getKey().equals(exactValueDto))
+                .anyMatch(exactEntry -> exactEntry.getValue().stream()
+                        .anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
+
+        boolean hasAggregatedValues = textFieldMap.entrySet().stream()
+                .filter(entry -> !entry.getKey().equals(exactValueDto)).anyMatch(exactEntry -> exactEntry.getValue()
+                        .stream().anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
+        enableAggregationFields(hasExactValues, hasAggregatedValues);
+        // }
     }
 
-    private Text addText(Composite valuesComposite, TermDto type, String value){
+    private Text addText(Composite valuesComposite, TermDto type, String value) {
         Composite composite_2 = new Composite(valuesComposite, SWT.NONE);
         composite_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
         GridLayout gl_composite_2 = new GridLayout(4, false);
@@ -221,12 +251,12 @@ public class QuantitativeDataDialogComposite extends Composite {
         GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
         gd_text.widthHint = 15;
         text.setLayoutData(gd_text);
-        if(value!=null){
+        if (value != null) {
             text.setText(value);
         }
 
         List<Text> list = textFieldMap.get(type);
-        if(list==null){
+        if (list == null) {
             list = new ArrayList<>();
         }
         textFieldMap.put(type, list);
@@ -240,49 +270,43 @@ public class QuantitativeDataDialogComposite extends Composite {
             public void widgetSelected(SelectionEvent e) {
                 text.setText("");
                 boolean hasExactValues = textFieldMap.entrySet().stream()
-                        .filter(entry->entry.getKey().equals(exactValueDto))
-                .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-                );
-                
+                        .filter(entry -> entry.getKey().equals(exactValueDto)).anyMatch(exactEntry -> exactEntry
+                                .getValue().stream().anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
+
                 boolean hasAggregatedValues = textFieldMap.entrySet().stream()
-                        .filter(entry->!entry.getKey().equals(exactValueDto))
-                .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-                );
+                        .filter(entry -> !entry.getKey().equals(exactValueDto)).anyMatch(exactEntry -> exactEntry
+                                .getValue().stream().anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
 
                 enableAggregationFields(hasExactValues, hasAggregatedValues);
             }
         });
-        text.addModifyListener(e->{
+        text.addModifyListener(e -> {
             boolean hasExactValues = textFieldMap.entrySet().stream()
-                    .filter(entry->entry.getKey().equals(exactValueDto))
-            .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-            );
-            
+                    .filter(entry -> entry.getKey().equals(exactValueDto)).anyMatch(exactEntry -> exactEntry.getValue()
+                            .stream().anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
+
             boolean hasAggregatedValues = textFieldMap.entrySet().stream()
-                    .filter(entry->!entry.getKey().equals(exactValueDto))
-            .anyMatch(exactEntry->exactEntry.getValue().stream().anyMatch(exactText->CdmUtils.isNotBlank(exactText.getText()))
-            );
+                    .filter(entry -> !entry.getKey().equals(exactValueDto)).anyMatch(exactEntry -> exactEntry.getValue()
+                            .stream().anyMatch(exactText -> CdmUtils.isNotBlank(exactText.getText())));
 
             enableAggregationFields(hasExactValues, hasAggregatedValues);
-//            if(hasExactValues){
-//                enableAggregationFields(false);
-//            }
-//            else{
-//                enableAggregationFields(true);
-//            }
+            // if(hasExactValues){
+            // enableAggregationFields(false);
+            // }
+            // else{
+            // enableAggregationFields(true);
+            // }
         });
         return text;
     }
 
-    private void enableAggregationFields(boolean hasExactValues, boolean hasAggregatedValues){
-       boolean enableAggregatedValues = hasAggregatedValues ==( hasAggregatedValues != hasExactValues);
-        textFieldMap.entrySet().stream()
-        .filter(entry->!entry.getKey().equals(exactValueDto))
-        .forEach(aggEntry->aggEntry.getValue().forEach(aggText->aggText.setEnabled(enableAggregatedValues)));
-        boolean enableExactValues = hasExactValues ==( hasAggregatedValues != hasExactValues);
-        textFieldMap.entrySet().stream()
-        .filter(entry->entry.getKey().equals(exactValueDto))
-        .forEach(aggEntry->aggEntry.getValue().forEach(aggText->aggText.setEnabled(enableExactValues)));
+    private void enableAggregationFields(boolean hasExactValues, boolean hasAggregatedValues) {
+        boolean enableAggregatedValues = hasAggregatedValues == (hasAggregatedValues != hasExactValues);
+        textFieldMap.entrySet().stream().filter(entry -> !entry.getKey().equals(exactValueDto)).forEach(
+                aggEntry -> aggEntry.getValue().forEach(aggText -> aggText.setEnabled(enableAggregatedValues)));
+        boolean enableExactValues = hasExactValues == (hasAggregatedValues != hasExactValues);
+        textFieldMap.entrySet().stream().filter(entry -> entry.getKey().equals(exactValueDto))
+                .forEach(aggEntry -> aggEntry.getValue().forEach(aggText -> aggText.setEnabled(enableExactValues)));
     }
 
     public Map<TermDto, List<Text>> getTextFields() {
@@ -290,7 +314,8 @@ public class QuantitativeDataDialogComposite extends Composite {
     }
 
     public QuantitativeDataDto getEditorValue() {
-        return editorValue;
+        return ((QuantitativeDataDto)editorValue);
     }
-
+    
+  
 }
index 045a28722b601e742975dc1c804565f70cf7aec1..e8360878f5fc41ea816c3f6850b4e79bd844b093 100644 (file)
@@ -21,10 +21,10 @@ import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionElementDto;
-import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionElementDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
+import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
 import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.CharacterMatrix;
 
 /**
@@ -95,6 +95,7 @@ public class QuantitativeDataDialogEditor extends AbstractDialogCellEditor {
         this.initialInput = null;
         Object rowObject = matrix.getBodyDataProvider().getRowObject(cell.getRowIndex());
         FeatureDto feature = matrix.getIndexToFeatureMap().get(cell.getColumnIndex());
+        
         QuantitativeDataDto quantitativeData = null;
         if(rowObject instanceof RowWrapperDTO){
             rowWrapperDTO = (RowWrapperDTO<?>) rowObject;
index cacc81246e3fff70a2d3eef30bccf6dd27ecb271..d2b489a48e5a85a83f941224b12258acd9d5a508 100644 (file)
@@ -10,7 +10,8 @@ package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.quantitative;
 
 import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
 
-import eu.etaxonomy.cdm.api.service.dto.QuantitativeDataDto;
+import eu.etaxonomy.cdm.persistence.dto.QuantitativeDataDto;
+
 
 /**
  * Converts QuantitativeData of one cell of the character matrix to a String.
index 6b5d1988e60f1699bbe6c48aff6e0d4f6baebf4c..b3cf5e265d794e995f0d46240a814501a4191dd4 100644 (file)
@@ -10,13 +10,13 @@ package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix.supplementalInfo
 
 import org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 
 /**
similarity index 85%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInput.java
index acfd4651813a6590493da3bdbaab6ffdae58a268..8711c666e5ee86254e286bdb0797033116a05972 100644 (file)
@@ -28,8 +28,6 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.e4.ui.di.UISynchronize;
 import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
@@ -46,13 +44,11 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 import eu.etaxonomy.taxeditor.editor.ChooseFromMultipleAcceptedTaxaDialog;
 import eu.etaxonomy.taxeditor.editor.ChooseFromMultipleTaxonNodesDialog;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -64,23 +60,20 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
-               implements IConversationEnabled {
+public class TaxonEditorInput  extends CdmEntitySessionInput<TaxonNode>{
 
     private static final String INCORRECT_STATE = Messages.TaxonEditorInput_INCORRECT_STATE;
 
-    private final ConversationHolder conversation;
-
     private TaxonNode taxonNode;
 
     private Map<TaxonBase, TaxonBaseDeletionConfigurator> toDeletes = new HashMap<>();
     private Set<Synonym> toSaveNewSynonyms = new HashSet<>();
-    private List<TaxonBase> toSaveConcepts = new ArrayList<>();
-    private List<TaxonName> toSaveNewNames = new ArrayList<>();
+    private Set<TaxonBase> toSaveConcepts = new HashSet<>();
+    private Set<TaxonName> toSaveNewNames = new HashSet<>();
 
     private Set<AbstractPostOperation> operations = new HashSet<>();
 
-    private TaxonEditorInputDataChangeBehaviourE4 dataChangeBehavior;
+//    private TaxonEditorInputDataChangeBehaviourE4 dataChangeBehavior;
 
     private TaxonBase<?> initiallySelectedTaxonBase;
 
@@ -97,10 +90,9 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
         PARENT_TAXON_NODE
     }
 
-    private TaxonEditorInputE4(UUID uuid, CdmType type) {
+    private TaxonEditorInput(UUID uuid, CdmType type) {
         super(true);
-        this.conversation = CdmStore.createConversation();
-        switch(type) {
+       switch(type) {
         case PARENT_TAXON_NODE:
             initForParentTaxonNode(uuid);
             break;
@@ -110,6 +102,8 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
         case TAXON_NODE:
             initForTaxonNode(uuid);
             break;
+        default:
+            throw new RuntimeException("Type not supported yet for TaxonEditorInput: " + type);
         }
     }
 
@@ -122,11 +116,10 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
         TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, getTaxonNodePropertyPaths());
 //     TaxonNode taxonNode = getCdmEntitySession().remoteLoad(CdmStore.getService(ITaxonNodeService.class), taxonNodeUuid, getTaxonNodePropertyPaths());
         if(taxonNode == null){
-            MessagingUtils.warningDialog(Messages.TaxonEditorInput_NOT_IMPLEMENTED, TaxonEditorInputE4.class, Messages.TaxonEditorInput_NOT_IMPLEMENTED_MESSAGE);
+            MessagingUtils.warningDialog(Messages.TaxonEditorInput_NOT_IMPLEMENTED, TaxonEditorInput.class, Messages.TaxonEditorInput_NOT_IMPLEMENTED_MESSAGE);
         }
         init(taxonNode);
         setInitiallySelectedTaxonBase(getTaxon());
-
     }
 
     private void initForTaxonBase(UUID taxonBaseUuid) {
@@ -152,10 +145,10 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
                     if (taxon.getTaxonNodes().size() > 0){
                         acceptedTaxa.add(taxon);
                     }
-                    setInputForRelatedTaxa(conversation, acceptedTaxa);
+                    setInputForRelatedTaxa(acceptedTaxa);
 
                 }else{
-                    setInputForMultipleNodes(conversation, taxon.getTaxonNodes());
+                    setInputForMultipleNodes(taxon.getTaxonNodes());
                 }
             }else if(taxonBase instanceof Synonym){
                 Synonym synonym = (Synonym) taxonBase;
@@ -165,13 +158,12 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
                 if (taxon != null){
                        taxa.add(taxon);
                 }
-                setInputForMultipleTaxa(conversation, taxa);
+                setInputForMultipleTaxa(taxa);
                 setInitiallySelectedTaxonBase(synonym);
             }
         }
     }
 
-
     private void initForParentTaxonNode(UUID parentNodeUuid){
        this.getCdmEntitySession().bind();
         TaxonName name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
@@ -186,7 +178,7 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
         initForTaxonNode(newTaxonNodeUuid);
     }
 
-    private void setInputForMultipleNodes(ConversationHolder conversation, Set<TaxonNode> taxonNodes){
+    private void setInputForMultipleNodes(Set<TaxonNode> taxonNodes){
         if(taxonNodes.size() == 1){
             TaxonNode taxonNode = taxonNodes.iterator().next();
             taxonNode = getCdmEntitySession().remoteLoad(CdmStore.getService(ITaxonNodeService.class), taxonNode.getUuid(), getTaxonNodePropertyPaths());
@@ -202,28 +194,28 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
             }
         } else if (taxonNodes.size() == 0) {
             // this is an undesired state
-            MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInputE4.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
+            MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInput.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
         }
     }
 
-    private void setInputForMultipleTaxa(ConversationHolder conversation, Set<Taxon> taxa){
+    private void setInputForMultipleTaxa(Set<Taxon> taxa){
         if(taxa.size() == 1){
             Taxon taxon = taxa.iterator().next();
             Set<TaxonNode> nodes = taxon.getTaxonNodes();
-            setInputForMultipleNodes(conversation, nodes);
+            setInputForMultipleNodes(nodes);
         }else if(taxa.size() > 1){
             Set<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
             for ( Taxon taxon : taxa ){
                 taxonNodes.addAll(taxon.getTaxonNodes());
             }
-            setInputForMultipleNodes(conversation, taxonNodes);
+            setInputForMultipleNodes(taxonNodes);
         }else if(taxa.size() == 0){
             // this is an undesired state
-            MessagingUtils.warningDialog(INCORRECT_STATE, TaxonEditorInputE4.class, Messages.TaxonEditorInput_NO_ACCEPTED_TAXON_PRESENT);
+            MessagingUtils.warningDialog(INCORRECT_STATE, TaxonEditorInput.class, Messages.TaxonEditorInput_NO_ACCEPTED_TAXON_PRESENT);
         }
     }
 
-    private void setInputForRelatedTaxa(ConversationHolder conversation, Set<Taxon> taxa){
+    private void setInputForRelatedTaxa(Set<Taxon> taxa){
         if(taxa.size() == 1){
             Taxon taxon = taxa.iterator().next();
             Set<TaxonNode> nodes = taxon.getTaxonNodes();
@@ -233,7 +225,7 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
             }else if (nodes.size()==1){
                 taxonNode = nodes.iterator().next();
             }else{
-                MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInputE4.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
+                MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInput.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
             }
             init(taxonNode);
         }else if(taxa.size() > 1){
@@ -252,22 +244,21 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
             }
         } else if (taxa.size() == 0) {
             // this is an undesired state
-            MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInputE4.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
+            MessagingUtils.warningDialog(INCORRECT_STATE,TaxonEditorInput.class,Messages.TaxonEditorInput_TAXON_NOT_IN_CLASSIFICATION);
         }
     }
 
-    public static TaxonEditorInputE4 NewInstance(UUID taxonNodeUuid) {
-        return new TaxonEditorInputE4(taxonNodeUuid, CdmType.TAXON_NODE);
-
+    public static TaxonEditorInput NewInstance(UUID taxonNodeUuid) {
+        return new TaxonEditorInput(taxonNodeUuid, CdmType.TAXON_NODE);
     }
 
-    public static TaxonEditorInputE4 NewInstanceFromTaxonBase(UUID taxonBaseUuid){
-        return new TaxonEditorInputE4(taxonBaseUuid, CdmType.TAXON_BASE);
+    public static TaxonEditorInput NewInstanceFromTaxonBase(UUID taxonBaseUuid){
+        return new TaxonEditorInput(taxonBaseUuid, CdmType.TAXON_BASE);
     }
 
 
-    public static TaxonEditorInputE4 NewEmptyInstance(UUID parentNodeUuid){
-        return new TaxonEditorInputE4(parentNodeUuid, CdmType.PARENT_TAXON_NODE);
+    public static TaxonEditorInput NewEmptyInstance(UUID parentNodeUuid){
+        return new TaxonEditorInput(parentNodeUuid, CdmType.PARENT_TAXON_NODE);
     }
 
     public Object getAdapter(Class adapter) {
@@ -291,11 +282,11 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
      */
     @Override
     public boolean equals(Object obj) {
-        if (TaxonEditorInputE4.class.equals(obj.getClass())
+        if (TaxonEditorInput.class.equals(obj.getClass())
                 && getTaxon() != null
-                && getTaxon().equals(((TaxonEditorInputE4) obj).getTaxon())) {
-            if (((TaxonEditorInputE4) obj).getInitiallySelectedTaxonBase() != null){
-                setInitiallySelectedTaxonBase(((TaxonEditorInputE4) obj).getInitiallySelectedTaxonBase());
+                && getTaxon().equals(((TaxonEditorInput) obj).getTaxon())) {
+            if (((TaxonEditorInput) obj).getInitiallySelectedTaxonBase() != null){
+                setInitiallySelectedTaxonBase(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase());
             }
             return true;
         }
@@ -304,7 +295,7 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
 
     public Taxon getTaxon(){
         if(taxonNode!=null){
-            Taxon taxon = CdmBase.deproxy(taxonNode.getTaxon(), Taxon.class);
+            Taxon taxon = CdmBase.deproxy(taxonNode.getTaxon());
             return taxon;
         }
         return null;
@@ -314,20 +305,6 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
         return taxonNode;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
-    @Override
-    public void update(CdmDataChangeMap events) {
-        if(dataChangeBehavior == null){
-            dataChangeBehavior = new TaxonEditorInputDataChangeBehaviourE4(this);
-        }
-
-        DataChangeBridge.handleDataChange(events, dataChangeBehavior);
-    }
-
     public void setInitiallySelectedTaxonBase(TaxonBase taxonBase) {
         this.initiallySelectedTaxonBase = taxonBase;
     }
@@ -391,15 +368,15 @@ public class TaxonEditorInputE4  extends CdmEntitySessionInput<TaxonNode>
                 }
             }
         }
-//        for (TaxonName name:toSaveNewNames){
-//            name.get
-//        }
+
 
         if (!toSaveNewNames.isEmpty()){
-            CdmStore.getService(INameService.class).merge(toSaveNewNames, true);
+               List<TaxonName> listNames = new ArrayList(toSaveNewNames);
+            CdmStore.getService(INameService.class).merge(listNames, true);
         }
         if (!toSaveConcepts.isEmpty()){
-            CdmStore.getService(ITaxonService.class).merge(toSaveConcepts, true);
+               List<TaxonBase> listTaxa = new ArrayList(toSaveConcepts);
+            CdmStore.getService(ITaxonService.class).merge(listTaxa, true);
         }
 
         toSaveNewNames.clear();
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputDataChangeBehaviourE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/e4/TaxonEditorInputDataChangeBehaviourE4.java
deleted file mode 100644 (file)
index 751f059..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.editor.e4;
-
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
-
-/**
- * @author pplitzner
- * @date Aug 24, 2017
- */
-public class TaxonEditorInputDataChangeBehaviourE4 extends
-               AbstractDataChangeBehaviour {
-
-       private TaxonEditorInputE4 source;
-
-       public TaxonEditorInputDataChangeBehaviourE4(TaxonEditorInputE4 taxonEditorInput) {
-               source = taxonEditorInput;
-       }
-
-       @Override
-       public void reactOnDataChange(CdmDataChangeMap events) {
-               source.update(events);
-
-       }
-}
index a6edaaa2832c1545e252109e4a61d7b020deb022..5694db462a73f4baca1f19cacc92c8d97b71f65a 100644 (file)
@@ -13,11 +13,8 @@ import java.util.Collection;
 import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.model.permission.Group;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -28,15 +25,12 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Mar 28, 2013
  */
 public class CdmAuthorityEditorInput 
-               extends CdmEntitySessionInput<Group> 
-               implements IConversationEnabled {
+               extends CdmEntitySessionInput<Group> {
        
-       private ConversationHolder conversation;
        private Group group;
 
-       protected CdmAuthorityEditorInput(ConversationHolder conversation, Group group) {
+       protected CdmAuthorityEditorInput(Group group) {
            super(true);
-               this.conversation = conversation;
                this.group = CdmApplicationState.getCurrentAppConfig().getGroupService().load(group.getUuid());
 
        }
@@ -49,9 +43,8 @@ public class CdmAuthorityEditorInput
         * @throws Exception
         */
        public static CdmAuthorityEditorInput NewInstance(UUID groupUuid) throws Exception{
-               ConversationHolder conversation = CdmStore.createConversation();
                Group group = CdmStore.getService(IGroupService.class).load(groupUuid, null);
-               return new CdmAuthorityEditorInput(conversation, group);
+               return new CdmAuthorityEditorInput( group);
        }
 
        public Object getAdapter(Class adapter) {
@@ -62,16 +55,6 @@ public class CdmAuthorityEditorInput
                return null;
        }
 
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-               // TODO Auto-generated method stub
-       }
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return this.conversation;
-       }
-       
        public String getName() {
                return group.getName();
        }
index 7d9783cc7b7c625397a80a8c3fc52fcb8aff7bc8..1d030ba53e5bd6fa985bd2778959ecc79f533ef8 100644 (file)
@@ -21,10 +21,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.permission.Group;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
@@ -35,15 +32,13 @@ import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeVie
  *
  * @author cmathew
  * @created Mar 28, 2013
- *
  */
-public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkable {
+public class CdmAuthorityEditorE4 implements IDirtyMarkable {
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.group.authority"; //$NON-NLS-1$
 
        @Inject
        private MDirtyable dirty;
-       private ConversationHolder conversation;
        private CdmAuthorityCompositeViewer viewer;
 
        private CdmAuthorityEditorInput input;
@@ -55,18 +50,15 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
 
        @Inject
        public CdmAuthorityEditorE4() {
-
        }
 
        /**
         * Create contents of the editor part.
-        * @param parent
         */
        @PostConstruct
        public void createPartControl(Composite parent) {
                container = new Composite(parent, SWT.NONE);
                container.setLayout(new FillLayout(SWT.HORIZONTAL));
-
        }
 
        @Focus
@@ -80,7 +72,6 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
        public void doSave(IProgressMonitor monitor) {
                try {
                        monitor.beginTask(Messages.CdmAuthorityEditor_SAVING_AUTHORITY_EDITOR, 1);
-                       getConversationHolder().commit(true);
                        input.merge();
                        dirty.setDirty(false);
                        monitor.worked(1);
@@ -92,9 +83,6 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
 
        public void init(CdmAuthorityEditorInput input) {
            this.input = input;
-
-        conversation = input.getConversationHolder();
-
         this.viewer = new CdmAuthorityCompositeViewer(container, this,input.getGroup());
 
         thisPart.setLabel(input.getName());
@@ -109,10 +97,6 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
         return input;
     }
 
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-       }
-
        @Override
        public void changed(Object element) {
                //FIXME : should be optimised to split changes into adding / removing authorities
@@ -125,7 +109,6 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
                    //FIXME E4 migrate/delete
 //                     getSite().getPage().activate(this);
                }
-
        }
 
        @Override
@@ -133,18 +116,8 @@ public class CdmAuthorityEditorE4 implements IConversationEnabled, IDirtyMarkabl
            changed(null);
        }
 
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
        @PreDestroy
        public void dispose() {
-           if(conversation!=null){
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-               conversation = null;
-           }
                if(input!=null){
                    input.getCdmEntitySession().dispose();
                }
index 4e84c6c233ee81f6e589e8dbf232a025764e6cac..70934c67b903f508c9d3a2974820b1e4387b6fd3 100644 (file)
@@ -38,6 +38,6 @@ public class DefaultOpenTaxonEditorForTaxonBaseHandler
 
     @Override
     protected String getPartId() {
-        return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4;
+        return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR;
     }
 }
\ No newline at end of file
index a44e35fb400f1f4991f9b2711d2cbd5640fb7bf6..897e31071657b8395d87f2eb265b1901fc5416ab 100644 (file)
@@ -40,6 +40,6 @@ public class DefaultOpenTaxonEditorForTaxonNodeHandler
 
     @Override
     protected String getPartId() {
-        return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_NAME_E4_TAXONNAMEEDITORE4;
+        return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_TAXONEDITOR;
     }
 }
\ No newline at end of file
index bd28dd2e901dd22071e6f1a6ad63f9d430507637..39f4b18d4ac044b8b756ba78aa5c4ed10ad00b06 100644 (file)
@@ -8,36 +8,22 @@
 */
 package eu.etaxonomy.taxeditor.editor.key;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.description.IIdentificationKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
 
 /**
  * @author n.hoffmann
  */
 public abstract class AbstractIdentificationEditorInput<T extends IIdentificationKey>
-               extends CdmEntitySessionInput implements IConversationEnabled {
+               extends CdmEntitySessionInput  {
 
-       private final ConversationHolder conversation;
-
-       protected AbstractIdentificationEditorInput(ConversationHolder conversation) {
+       protected AbstractIdentificationEditorInput() {
            super(true);
-               this.conversation = conversation;
-       }
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
        }
 
+       
        public abstract T getKey();
 
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-       }
-
        @Override
        public boolean equals(Object obj) {
                // TODO Auto-generated method stub
similarity index 92%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/AbstractGraphKeyEditorE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/AbstractGraphKeyEditor.java
index fc4a43cc054c0f732e01a98576a9075422ac24ba..e095e0d36aacf6932cb6ebc486dabc89eaeb4506 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.editor.key.e4;
 
 import javax.inject.Inject;
@@ -25,10 +30,8 @@ import org.eclipse.zest.layouts.LayoutAlgorithm;
 import org.eclipse.zest.layouts.LayoutStyles;
 import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.description.IIdentificationKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -36,15 +39,13 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
- *
  * @author pplitzner
  * @since Sep 28, 2017
  *
  * @param <T>
  */
-public abstract class AbstractGraphKeyEditorE4<T extends IIdentificationKey>
-implements IConversationEnabled, IE4SavablePart,
-               IZoomableWorkbenchPart, IPostOperationEnabled,
+public abstract class AbstractGraphKeyEditor<T extends IIdentificationKey>
+implements IE4SavablePart, IZoomableWorkbenchPart, IPostOperationEnabled,
                IDirtyMarkable {
 
        protected CdmFormFactory formFactory;
@@ -72,7 +73,6 @@ implements IConversationEnabled, IE4SavablePart,
        @Override
     @Persist
        public void save(IProgressMonitor monitor) {
-               getConversationHolder().commit(true);
                setDirty(false);
                viewer.refresh();
        }
@@ -123,11 +123,6 @@ implements IConversationEnabled, IE4SavablePart,
                viewer.refresh();
        }
 
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-
-       }
-
        @Override
        public AbstractZoomableViewer getZoomableViewer() {
                return viewer;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/KeyEditorDataChangeBehaviourE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/KeyEditorDataChangeBehaviourE4.java
deleted file mode 100644 (file)
index 8e34d4f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.editor.key.e4;
-
-import java.util.Vector;
-
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
-import eu.etaxonomy.taxeditor.editor.key.polytomous.e4.PolytomousKeyListEditorE4;
-import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
-
-/**
- * @author n.hoffmann
- * @created May 5, 2011
- */
-public class KeyEditorDataChangeBehaviourE4 extends AbstractDataChangeBehaviour {
-
-       private final PolytomousKeyListEditorE4 source;
-       private PolytomousKeyEditorInput input;
-
-       public KeyEditorDataChangeBehaviourE4(PolytomousKeyListEditorE4 keyEditor) {
-               source = keyEditor;
-       }
-
-       @Override
-       public void reactOnDataChange(CdmDataChangeMap changeEvents) {
-               input = source.getEditorInput();
-
-               if(changeEvents.sizeByEventType(EventType.UPDATE) > 0){
-                       reactOnUpdate(changeEvents.getEvents(EventType.UPDATE));
-               }
-       }
-
-       @Override
-       public void reactOnUpdate(Vector<CdmDataChangeEvent> events){
-
-               for(CdmDataChangeEvent event : events){
-
-                       // update editor title
-                       if(event.getEntity() instanceof PolytomousKey){
-                               if(input.getKey().equals(event.getEntity())){
-                                       // set the name of the editor window
-                                       source.setPartName();
-                               }
-                       }
-               }
-       }
-}
index 2edbbe2da99fecb72d740a9e744ee9ab120b79f2..3464422f3418c6176c0e9e0f4519af4ee0b8ef5e 100644 (file)
@@ -9,7 +9,7 @@ import org.eclipse.e4.core.di.annotations.Execute;
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 import org.eclipse.e4.ui.services.IServiceConstants;
 
-import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditorE4;
+import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditor;
 
 /**
  * @author n.hoffmann
@@ -19,7 +19,7 @@ public class ApplyLayoutHandlerE4 {
 
        @Execute
        public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
-           AbstractGraphKeyEditorE4 graphKeyEditorE4 = (AbstractGraphKeyEditorE4) activePart.getObject();
+           AbstractGraphKeyEditor graphKeyEditorE4 = (AbstractGraphKeyEditor) activePart.getObject();
                        graphKeyEditorE4.applyLayout();
        }
 
index e1b8578389013a5883ca5e35792b888957f178e1..7036ab69a6b8a5026f4595971d7dd818a354b507 100644 (file)
@@ -15,7 +15,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.editor.key.AbstractIdentificationEditorInput;
@@ -29,9 +28,8 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
     private PolytomousKey key;
 
 
-    protected PolytomousKeyEditorInput(ConversationHolder conversation,
-            UUID polytomousKeyUuid) {
-        super(conversation);
+    protected PolytomousKeyEditorInput(UUID polytomousKeyUuid) {
+        super();
         List<String> propertyPath = new ArrayList<>();
         propertyPath.add("root");
         propertyPath.add("root.*");
@@ -40,8 +38,7 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
 
     public static PolytomousKeyEditorInput NewInstance(UUID polytomousKeyUuid) throws Exception{
         try{
-            ConversationHolder conversation = CdmStore.createConversation();
-            return new PolytomousKeyEditorInput(conversation, polytomousKeyUuid);
+               return new PolytomousKeyEditorInput( polytomousKeyUuid);
         }catch(Exception e){
             throw e;
         }
index e87e33988b87249f5451d87783b2eb911449cba0..7ab18e9294c4ffa286c282b67d2c79af7bb89124 100644 (file)
@@ -1,5 +1,10 @@
 /**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
  *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
  */
 package eu.etaxonomy.taxeditor.editor.key.polytomous.e4;
 
@@ -20,9 +25,8 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.zest.core.viewers.GraphViewer;
 import org.eclipse.zest.core.widgets.ZestStyles;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditorE4;
+import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphContentProvider;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyLabelProvider;
@@ -32,11 +36,10 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 
 /**
  * @author n.hoffmann
- *
  */
-public class PolytomousKeyGraphEditorE4 extends
-               AbstractGraphKeyEditorE4<PolytomousKey> implements
-               IPolytomousKeyEditorPage, IPartContentHasDetails {
+public class PolytomousKeyGraphEditorE4
+        extends AbstractGraphKeyEditor<PolytomousKey>
+        implements IPolytomousKeyEditorPage, IPartContentHasDetails {
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.key.polytomous.graph"; //$NON-NLS-1$
 
@@ -88,11 +91,6 @@ public class PolytomousKeyGraphEditorE4 extends
         });
     }
 
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return getEditorInput()
-                               .getConversationHolder();
-       }
 
        @Override
        public PolytomousKey getKey() {
index 2705e692b08bbe8b6a42c162454c55fbbd4e1156..fbfec4dae20e147ed34fbc96b700b5d7737a9f12 100644 (file)
@@ -38,21 +38,16 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.key.e4.KeyEditorDataChangeBehaviourE4;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListContentProvider;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListLabelProvider;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
@@ -63,7 +58,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @since Sep 28, 2017
  */
 public class PolytomousKeyListEditorE4 implements
-               IConversationEnabled, IDirtyMarkable, IPartContentHasDetails, IPartContentHasSupplementalData,
+               IDirtyMarkable, IPartContentHasDetails, IPartContentHasSupplementalData,
                IPolytomousKeyEditorPage, IE4SavablePart{
 
        private class LinkListener extends MouseAdapter {
@@ -137,9 +132,7 @@ public class PolytomousKeyListEditorE4 implements
 
        private TableViewer viewer;
 
-    private KeyEditorDataChangeBehaviourE4 dataChangeBehavior;
-
-    private PolytomousKeyEditorInput input;
+       private PolytomousKeyEditorInput input;
 
     @Inject
     private ESelectionService selService;
@@ -164,27 +157,12 @@ public class PolytomousKeyListEditorE4 implements
     @Inject
        public PolytomousKeyListEditorE4() {
        }
-
-       @Override
-       public void update(CdmDataChangeMap map) {
-           if(dataChangeBehavior == null){
-            dataChangeBehavior = new KeyEditorDataChangeBehaviourE4(this);
-        }
-        DataChangeBridge.handleDataChange(map, dataChangeBehavior);
-       }
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return input.getConversationHolder();
-       }
-
+       
        @Override
     @Persist
        public void save(IProgressMonitor monitor) {
         try {
             monitor.beginTask(Messages.KeyEditor_SAVING, 1);
-            getConversationHolder().bind();
-            getConversationHolder().commit(true);
             input.merge();
             dirty.setDirty(false);
             monitor.worked(1);
@@ -243,7 +221,6 @@ public class PolytomousKeyListEditorE4 implements
     public void dispose() {
         if(input!=null){
             input.dispose();
-            input.getConversationHolder().close();
         }
     }
 
index 788381341b87ca8093185dfba00ff7c5cdf5c2f3..f9c153257a8aa2da0d07b554b01cede3a5466f90 100644 (file)
@@ -40,9 +40,9 @@ OpenDerivateEditorForTaxonHandler_NO_DERIVATIVES_FOUND=No Derivatives found
 DeleteTaxonBaseHandler_CONFIRM_DELETION=Confirm Deletion
 DeleteTaxonBaseHandler_ELEMENT_MUST_BE_SYNONYM_MISAPP_CONCEPT=Element has to be Synonym, Misapplication or Concept
 DeleteTaxonBaseHandler_REALLY_DELETE_TAXON=Are you sure you want to delete the selected taxon?
-DeleteTaxonBaseHandler_REALLY_DELETE_SYNONYM=Are you sure you want to delete the selected synoym?
-DeleteTaxonBaseHandler_DELETE_SYNONYM_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS=The Synonym could be deleted, but related object(s) could not be deleted
-DeleteTaxonBaseHandler_DELETE_MISAPPLIEDNAME_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS=The misapplied name could be deleted, but related object(s) could not be deleted
+DeleteTaxonBaseHandler_REALLY_DELETE_SYNONYM=Are you sure you want to delete the selected synonym?
+DeleteTaxonBaseHandler_DELETE_SYNONYM_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS=The synonym could be deleted but related object(s) could not be deleted
+DeleteTaxonBaseHandler_DELETE_MISAPPLIEDNAME_SUCCESSFULL_BUT_REMAINING_RELATED_OBJECTS=The misapplied name could be deleted but related object(s) could not be deleted
 DeleteTaxonBaseHandler_REALLY_DELETE_MISAPPLICATION=Are you sure you want to delete the selected misapplication, this is irreversible?
 DescriptionElementDropAdapter_MOVE_DESC=Move Descriptions
 DescriptionElementDropAdapter_NOT_SUPPORTED=Operation not supported yet
@@ -138,7 +138,7 @@ SpecimenSelectionDialog_SELECT_SPECIMENS=Select specimens
 SpecimenSelectionDialog_REMOVE_FILTER=Remove filter
 TaxonEditorInput_INCORRECT_STATE=Incorrect state
 TaxonEditorInput_NEW_TAXON=New taxon
-TaxonEditorInput_NO_ACCEPTED_TAXON_PRESENT=Trying to open accepted taxon for a synonym or misapplication but misapplication but the accepted taxon is not present in any classification and can\u2019t be opened in taxon editor.
+TaxonEditorInput_NO_ACCEPTED_TAXON_PRESENT=Trying to open accepted taxon for a synonym or misapplication but the accepted taxon is not present in any classification and can\u2019t be opened in taxon editor.
 TaxonEditorInput_NOT_IMPLEMENTED=Not yet implemented
 TaxonEditorInput_NOT_IMPLEMENTED_MESSAGE=Selected Taxonnode does not exist, probably it is deleted or moved.
 TaxonEditorInput_OPEN_MISSAPPLIED_NAME=trying to open Mispplied Name 
@@ -298,7 +298,7 @@ ChecklistEditor_REMOVE_DEFAULT_SOURCE=Remove Source
 FactualDataView_Lable=Factual Data
 NameFactsDataView_Lable=Name Facts
 TaxaFactsDataView_Lable=Taxon Facts
-OccurrenceFactsDataView_Lable=Name Facts
+OccurrenceFactsDataView_Lable=Specimen Facts
 DeleteDescriptiveDatasetHandler_Exception_Message=Descriptive Dataset could not be deleted.
 DeleteDescriptiveDatasetHandler_Warning_Message=Deletion was successful but with warnings. 
 ChangeSynonymToAcceptedHandler_Select_Sec_Reference_Handling_title=Select secundum reference
similarity index 79%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/IDropTargetableE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/IDropTargetable.java
index f0eb85f17c06db353099ba2b8d84da8b4ac199c3..1fec648dd5b215adbd7c793d928361aa8f418fec 100644 (file)
@@ -14,11 +14,11 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @date Aug 24, 2017
  *
  */
-public interface IDropTargetableE4 extends IPostOperationEnabled {
+public interface IDropTargetable extends IPostOperationEnabled {
 
        public Composite getControl();
 
-       public TaxonNameEditorE4 getEditor();
+       public TaxonEditor getEditor();
 
        public void dragEntered();
 
similarity index 81%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonEditor.java
index 26cabe36f32a6e4995ef85e3d17ff54671a49225..1e878466b712cc05c246d1989398e26e20339488 100644 (file)
@@ -53,8 +53,6 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -66,23 +64,22 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AcceptedGroupE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroup;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainer;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AcceptedGroup;
 import eu.etaxonomy.taxeditor.editor.name.e4.container.AcceptedNameContainerE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainerE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.ContainerFactoryE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.HomotypicalSynonymGroupE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroupE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetListenerE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainer;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.ContainerFactory;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.HomotypicalSynonymGroup;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroup;
+import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetListener;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -104,9 +101,10 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable, IPartContentHasDetails,
-        IPartContentHasSupplementalData, IPartContentHasMedia, IPartContentHasFactualData, IPartChangeListener,
-        ISelectionListener, ISecuredEditor, IE4SavablePart, ITaxonEditor, IDropTargetableE4 {
+public class TaxonEditor
+        implements IDirtyMarkable, IPartContentHasDetails,
+            IPartContentHasSupplementalData, IPartContentHasMedia, IPartContentHasFactualData, IPartChangeListener,
+            ISelectionListener, ISecuredEditor, IE4SavablePart, ITaxonEditor, IDropTargetable {
 
     private Taxon taxon;
 
@@ -120,16 +118,14 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     private EPartService partService;
     private TaxonBase<?> selection;
 
-    private ConversationHolder conversation;
-
-    private AcceptedGroupE4 acceptedGroup;
-    private List<HomotypicalSynonymGroupE4> heterotypicSynonymGroups = new ArrayList<>();
-    private MisappliedGroupE4 misappliedGroup;
+    private AcceptedGroup acceptedGroup;
+    private List<HomotypicalSynonymGroup> heterotypicSynonymGroups = new ArrayList<>();
+    private MisappliedGroup misappliedGroup;
 
     private DropTarget target;
 
     @Inject
-    UISynchronize sync;
+    private UISynchronize sync;
 
     private TaxonBase<?> objectAffectedByLastOperation;
 
@@ -150,7 +146,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
     private MPart thisPart;
 
-    private TaxonEditorInputE4 input;
+    private TaxonEditorInput input;
 
     private UndoContext undoContext;
 
@@ -158,7 +154,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     private IEventBroker eventBroker;
 
     @Inject
-    public TaxonNameEditorE4() {
+    public TaxonEditor() {
         undoContext = new UndoContext();
     }
 
@@ -182,9 +178,9 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
             @Override
             public boolean setInput(Object input) {
-                if (input instanceof AbstractGroupedContainerE4) {
-                    TaxonBase<?> newSelection = ((AbstractGroupedContainerE4<?>) input).getData();
-                    if (selection != newSelection || TaxonNameEditorE4.this.isDirty()) {
+                if (input instanceof AbstractGroupedContainer) {
+                    TaxonBase<?> newSelection = ((AbstractGroupedContainer<?>) input).getData();
+                    if (selection != newSelection || TaxonEditor.this.isDirty()) {
                         selection = newSelection;
                         selService.setSelection(new StructuredSelection(selection));
 
@@ -219,15 +215,15 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     public void createOrUpdateNameComposites(boolean accepted, boolean heterotypicGroups, boolean misappliedNames) {
 
         if (accepted) {
-            ContainerFactoryE4.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
+            ContainerFactory.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
         }
         if (heterotypicGroups) {
-            ContainerFactoryE4.createOrUpdateHeterotypicSynonymyGroups(this);
+            ContainerFactory.createOrUpdateHeterotypicSynonymyGroups(this);
         }
         if (misappliedNames) {
-            ContainerFactoryE4.createOrUpdateMisapplicationsGroup(this);
+            ContainerFactory.createOrUpdateMisapplicationsGroup(this);
         }
-        ContainerFactoryE4.setMenuToAllContainers(this);
+        ContainerFactory.setMenuToAllContainers(this);
 
         // Redraw composite
         parent.pack();
@@ -253,29 +249,28 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     public void setFocus() {
         // make sure to bind again if maybe in another view the conversation was
         // unbound
+
         eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, this);
-        if (conversation != null && !conversation.isBound()) {
-            conversation.bind();
-        }
+
         if (EditorUtil.isFactsVisible()){
             EditorUtil.showFacts(modelService, partService);
+            EditorUtil.setFactsVisible(false);
         }
         if (EditorUtil.isMediaVisible()){
             EditorUtil.showMedia(modelService, partService);
+            EditorUtil.setMediaVisible(false);
         }
         if (input != null) {
             if (getSelectedContainer() == null) {
                 throw new IllegalStateException(Messages.TaxonNameEditor_THERE_SHOULD_ALWAYS_BE);
             }
-            getSelectedContainer().setSelected();
 
             if (input.getCdmEntitySession() != null && !input.getCdmEntitySession().isActive()) {
                 input.bind();
             }
+
         }
-//        if(selection!=null){
-//            selService.setSelection(new StructuredSelection(selection));
-//        }
+
         // check permissions
         boolean doEnable = permissionsSatisfied();
         managedForm.getForm().setEnabled(doEnable);
@@ -292,16 +287,6 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return doEnable;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
-    @Override
-    public void update(CdmDataChangeMap events) {
-        // redraw();
-    }
-
     /**
      * Redraws this editor return true on success
      *
@@ -351,7 +336,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
      * @return true if there are empty names
      */
     public boolean checkForEmptyNames() {
-        for (AbstractGroupedContainerE4<?> container : getGroupedContainers()) {
+        for (AbstractGroupedContainer<?> container : getGroupedContainers()) {
             if (container != null
                     && (container.getName() == null || StringUtils.isEmpty(container.getName().getTitleCache()))) {
                 return true;
@@ -360,10 +345,10 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return false;
     }
 
-    public Set<AbstractGroupedContainerE4> getEmptyContainers() {
-        Set<AbstractGroupedContainerE4> containersWithEmptyNames = new HashSet<>();
+    public Set<AbstractGroupedContainer> getEmptyContainers() {
+        Set<AbstractGroupedContainer> containersWithEmptyNames = new HashSet<>();
 
-        for (AbstractGroupedContainerE4<?> container : getGroupedContainers()) {
+        for (AbstractGroupedContainer<?> container : getGroupedContainers()) {
             if (container.getName() == null || StringUtils.isEmpty(container.getName().getTitleCache())) {
                 containersWithEmptyNames.add(container);
             }
@@ -377,26 +362,22 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     public void save(IProgressMonitor monitor) {
 
         monitor.beginTask(Messages.TaxonNameEditor_SAVING_NAMES, getGroupedContainers().size());
-        if (!conversation.isBound()) {
-            conversation.bind();
-
-        }
-        conversation.commit(true);
         monitor.worked(1);
-
+        this.getEditorInput().getCdmEntitySession().load(this.taxon, true);
+        //this.getDirtyNames().forEach(container -> container.refresh());
         // check for empty names
         if (checkForEmptyNames()) {
             MessageDialog.openWarning(AbstractUtility.getShell(), Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED,
                     Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED_MESSAGE);
             return;
         }
-        for (AbstractGroupedContainerE4<?> container : getGroupedContainers()) {
+        for (AbstractGroupedContainer<?> container : getGroupedContainers()) {
 
             monitor.subTask(Messages.TaxonNameEditor_SAVING_COMPOSITES + container.getTaxonBase().getTitleCache());
             container.persistName();
             // because of missing cascading the concepts need to be saved
             // separately
-            if (container instanceof ConceptContainerE4) {
+            if (container instanceof ConceptContainer) {
                 input.addToSaveConcept((Taxon) container.getData());
             }
             // In case the progress monitor was canceled throw an exception.
@@ -407,19 +388,25 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
             // Otherwise declare this step as done.
             monitor.worked(1);
         }
+
         input.setSync(sync);
         input.merge();
-        // commit the conversation and start a new transaction immediately
-        conversation.commit(true);
 
         dirty.setDirty(false);
-        EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode().getParent()));
+
+        if (input.getTaxonNode().getParent() != null) {
+            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode().getParent()));
+        }else {
+            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode()));
+        }
         EventUtility.postEvent(WorkbenchEventConstants.SAVE_TAXON, true);
+        EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+//        EventUtility.postAsyncEvent(WorkbenchEventConstants.NEED_REFRESH_DETAILS, false);
         // Stop the progress monitor.
         monitor.done();
     }
 
-    public void init(TaxonEditorInputE4 input) {
+    public void init(TaxonEditorInput input) {
         if (this.input != null) {
             this.input.dispose();
             // this.acceptedGroup = null;
@@ -440,19 +427,20 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         }
 
         this.input = input;
-        conversation = input.getConversationHolder();
-
         createOrUpdateNameComposites(true, true, true);
 
         createDragSupport();
 
         setPartName();
-//        this.setFocus();
         // set initial selection
         TaxonBase<?> initiallySelectedTaxonBase = input.getInitiallySelectedTaxonBase();
         if (initiallySelectedTaxonBase != null) {
             selService.setSelection(new StructuredSelection(initiallySelectedTaxonBase));
-            getContainer(initiallySelectedTaxonBase).setSelected();
+            sync.asyncExec(()->{
+                if (getContainer(initiallySelectedTaxonBase)!= null) {
+                    getContainer(initiallySelectedTaxonBase).setSelected();
+                }
+            });
         }
     }
 
@@ -464,7 +452,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         if (target == null) {
             target = new DropTarget(parent, operations);
             target.setTransfer(types);
-            target.addDropListener(new NameEditorDropTargetListenerE4(this));
+            target.addDropListener(new NameEditorDropTargetListener(this));
         }
     }
 
@@ -472,8 +460,8 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return getAcceptedGroup().getAcceptedNameContainer();
     }
 
-    public HomotypicalSynonymGroupE4 getHomotypicalGroupContainer(HomotypicalGroup homotypicalGroup) {
-        for (HomotypicalSynonymGroupE4 group : getHeterotypicSynonymGroups()) {
+    public HomotypicalSynonymGroup getHomotypicalGroupContainer(HomotypicalGroup homotypicalGroup) {
+        for (HomotypicalSynonymGroup group : getHeterotypicSynonymGroups()) {
             if (group.getGroup().equals(homotypicalGroup)) {
                 return group;
             }
@@ -489,10 +477,10 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
      *
      * @return a Set containing all composites that have been edited
      */
-    public Set<AbstractGroupedContainerE4> getDirtyNames() {
-        Set<AbstractGroupedContainerE4> dirtyNames = new HashSet<>();
+    public Set<AbstractGroupedContainer> getDirtyNames() {
+        Set<AbstractGroupedContainer> dirtyNames = new HashSet<>();
 
-        for (AbstractGroupedContainerE4<?> composite : getGroupedContainers()) {
+        for (AbstractGroupedContainer<?> composite : getGroupedContainers()) {
             if (composite.isDirty()) {
                 dirtyNames.add(composite);
             }
@@ -501,10 +489,10 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return dirtyNames;
     }
 
-    public List<AbstractGroupedContainerE4> getGroupedContainers() {
-        List<AbstractGroupedContainerE4> groupedComposites = new ArrayList<>();
+    public List<AbstractGroupedContainer> getGroupedContainers() {
+        List<AbstractGroupedContainer> groupedComposites = new ArrayList<>();
 
-        for (AbstractGroupE4 group : getAllGroups()) {
+        for (AbstractGroup group : getAllGroups()) {
             if (group != null) {
                 groupedComposites.addAll(group.getGroupedContainers());
             }
@@ -513,8 +501,8 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return groupedComposites;
     }
 
-    public List<AbstractGroupE4> getAllGroups() {
-        List<AbstractGroupE4> allGroups = new ArrayList<>();
+    public List<AbstractGroup> getAllGroups() {
+        List<AbstractGroup> allGroups = new ArrayList<>();
 
         allGroups.add(getAcceptedGroup());
 
@@ -543,10 +531,6 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
     @PreDestroy
     public void dispose() {
-        if (conversation != null) {
-            conversation.unregisterForDataStoreChanges(this);
-            conversation.close();
-        }
         if (input != null) {
             input.dispose();
         }
@@ -559,7 +543,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
     }
 
-    public AbstractGroupedContainerE4 getSelectedContainer() {
+    public AbstractGroupedContainer getSelectedContainer() {
         if (selection == null && input != null){
             selection = this.input.getTaxon();
         }
@@ -577,7 +561,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         getControl().setBackground(AbstractUtility.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
     }
 
-    public void setMisapplicationsGroup(MisappliedGroupE4 misappliedGroup) {
+    public void setMisapplicationsGroup(MisappliedGroup misappliedGroup) {
         this.misappliedGroup = misappliedGroup;
     }
 
@@ -585,23 +569,23 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return managedForm.getToolkit();
     }
 
-    public List<HomotypicalSynonymGroupE4> getHeterotypicSynonymGroups() {
+    public List<HomotypicalSynonymGroup> getHeterotypicSynonymGroups() {
         return heterotypicSynonymGroups;
     }
 
-    public void addHeterotypicSynonymGroup(HomotypicalSynonymGroupE4 group) {
+    public void addHeterotypicSynonymGroup(HomotypicalSynonymGroup group) {
         heterotypicSynonymGroups.add(group);
     }
 
-    public AcceptedGroupE4 getAcceptedGroup() {
+    public AcceptedGroup getAcceptedGroup() {
         return acceptedGroup;
     }
 
-    public void setAcceptedGroup(AcceptedGroupE4 acceptedGroup) {
+    public void setAcceptedGroup(AcceptedGroup acceptedGroup) {
         this.acceptedGroup = acceptedGroup;
     }
 
-    public MisappliedGroupE4 getMisappliedGroup() {
+    public MisappliedGroup getMisappliedGroup() {
         return misappliedGroup;
     }
 
@@ -611,7 +595,9 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
     @Override
     public boolean onComplete() {
-        getContainer(objectAffectedByLastOperation).setSelected();
+        if (objectAffectedByLastOperation != null && getContainer(objectAffectedByLastOperation) != null) {
+            getContainer(objectAffectedByLastOperation).setSelected();
+        }
         return true;
     }
 
@@ -623,7 +609,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         }
     }
 
-    public void removeGroup(AbstractGroupE4 group) {
+    public void removeGroup(AbstractGroup group) {
         if (group != null) {
             group.dispose();
 
@@ -633,10 +619,10 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         }
     }
 
-    public AbstractGroupedContainerE4 getContainer(TaxonBase taxonBase) {
+    public AbstractGroupedContainer<?> getContainer(TaxonBase taxonBase) {
         @SuppressWarnings("rawtypes")
-        List<AbstractGroupedContainerE4> groupedContainers = getGroupedContainers();
-        for (AbstractGroupedContainerE4<?> container : groupedContainers) {
+        List<AbstractGroupedContainer> groupedContainers = getGroupedContainers();
+        for (AbstractGroupedContainer<?> container : groupedContainers) {
             if (container.getData().equals(taxonBase) && container.getNameViewer().getTextWidget() != null) {
                 return container;
             }
@@ -656,7 +642,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
 
     protected void setEnabled(boolean enabled, Color background) {
 
-        for (AbstractGroupedContainerE4<?> groupedContainer : getGroupedContainers()) {
+        for (AbstractGroupedContainer<?> groupedContainer : getGroupedContainers()) {
             groupedContainer.setEnabled(enabled);
         }
 
@@ -665,7 +651,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         if (!enabled) {
             getManagedForm().setInput(null);
 
-            for (AbstractGroupedContainerE4<?> groupedContainer : getGroupedContainers()) {
+            for (AbstractGroupedContainer<?> groupedContainer : getGroupedContainers()) {
                 groupedContainer.setBackground(background);
             }
         }
@@ -686,16 +672,18 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         }
 
         if (element instanceof TaxonBase) {
-            AbstractGroupedContainerE4<?> container = getContainer((TaxonBase<?>) element);
+            AbstractGroupedContainer<?> container = getContainer((TaxonBase<?>) element);
             if (container != null) {
                 container.refresh();
+                container.setDirty(false);
             }
         }
 
         if (element instanceof TaxonRelationship) {
-            AbstractGroupedContainerE4 container = getContainer(((TaxonRelationship) element).getFromTaxon());
+            AbstractGroupedContainer container = getContainer(((TaxonRelationship) element).getFromTaxon());
             if (container != null) {
                 container.refresh();
+                container.setDirty(false);
             }
         }
     }
@@ -733,12 +721,12 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
         return true;
     }
 
-    public TaxonEditorInputE4 getEditorInput() {
+    public TaxonEditorInput getEditorInput() {
         return input;
     }
 
     @Override
-    public TaxonNameEditorE4 getEditor() {
+    public TaxonEditor getEditor() {
         return this;
     }
 
@@ -777,7 +765,7 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_NAME_EDITOR) UUID cdmbaseUuid) {
         if (this.taxon.getUuid().equals(cdmbaseUuid)) {
-            TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstanceFromTaxonBase(cdmbaseUuid);
+            TaxonEditorInput input = TaxonEditorInput.NewInstanceFromTaxonBase(cdmbaseUuid);
             init(input);
         }
     }
@@ -814,4 +802,6 @@ public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable,
     public TaxonNode getTaxonNode() {
         return input.getTaxonNode();
     }
+
+
 }
\ No newline at end of file
similarity index 77%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroup.java
index cf85b45c64da2d22f93c38b9006051d86fb687b4..ebb52cb6c1aa22c076c901a0f6b9e2b254befc60 100644 (file)
@@ -25,10 +25,10 @@ import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
-import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetableE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetable;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetEffect;
-import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetListenerE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetListener;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
 
@@ -36,20 +36,20 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public abstract class AbstractGroupE4 implements IDropTargetableE4{
+public abstract class AbstractGroup implements IDropTargetable{
 
        private Composite control;
 
        private IEclipseContext context;
 
-       private final List<AbstractGroupedContainerE4> groupedContainers = new ArrayList<>();
+       private final List<AbstractGroupedContainer> groupedContainers = new ArrayList<>();
 
-       protected TaxonNameEditorE4 editor;
+       protected TaxonEditor editor;
 
        private DropTarget target;
        private DropTargetListener dropListener;
 
-       public AbstractGroupE4(TaxonNameEditorE4 editor){
+       public AbstractGroup(TaxonEditor editor){
                this.editor = editor;
                this.context = editor.getContext();
        }
@@ -83,20 +83,20 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
                control.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
        }
 
-       public void add(AbstractGroupedContainerE4 groupedContainer){
+       public void add(AbstractGroupedContainer groupedContainer){
                groupedContainers.add(groupedContainer);
        }
 
-       public void remove(AbstractGroupedContainerE4 groupedContainer){
+       public void remove(AbstractGroupedContainer groupedContainer){
                groupedContainer.dispose();
                groupedContainers.remove(groupedContainer);
 
-               if(!(this instanceof AcceptedGroupE4) && groupedContainers.isEmpty()){
+               if(!(this instanceof AcceptedGroup) && groupedContainers.isEmpty()){
                        getEditor().removeGroup(this);
                }
        }
 
-       public List<AbstractGroupedContainerE4> getGroupedContainers(){
+       public List<AbstractGroupedContainer> getGroupedContainers(){
                return groupedContainers;
        }
 
@@ -107,7 +107,7 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
                        int operations = DND.DROP_MOVE;
                        target = new DropTarget(control, operations);
                        target.setTransfer(types);
-                       dropListener = new NameEditorDropTargetListenerE4(this);
+                       dropListener = new NameEditorDropTargetListener(this);
                        target.addDropListener(dropListener);
 
                        target.setDropTargetEffect(new NameEditorDropTargetEffect(control));
@@ -125,7 +125,7 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
        }
 
        @Override
-    public TaxonNameEditorE4 getEditor() {
+    public TaxonEditor getEditor() {
                return editor;
        }
 
@@ -133,14 +133,14 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
     public void dragEntered() {
                Color color = AbstractUtility.getColor(Resources.COLOR_DRAG_ENTER);
 
-               for(AbstractGroupedContainerE4<?> container : groupedContainers){
+               for(AbstractGroupedContainer<?> container : groupedContainers){
                        container.setBackground(color);
                }
        }
 
        @Override
     public void dragLeft() {
-               for(AbstractGroupedContainerE4<?> container : groupedContainers){
+               for(AbstractGroupedContainer<?> container : groupedContainers){
                        container.restoreColor();
                }
        }
@@ -173,7 +173,7 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
        public void dispose(){
                if(getControl() != null){
                    getControl().setMenu(null);
-                       for(AbstractGroupedContainerE4<?> container : getGroupedContainers()){
+                       for(AbstractGroupedContainer<?> container : getGroupedContainers()){
                                container.dispose();
                        }
                        getControl().dispose();
@@ -181,7 +181,7 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
        }
 
        protected void emptyGroup(){
-               for(AbstractGroupedContainerE4<?> container : groupedContainers){
+               for(AbstractGroupedContainer<?> container : groupedContainers){
                    container.getControl().setMenu(null);
                        container.dispose();
                }
@@ -189,7 +189,7 @@ public abstract class AbstractGroupE4 implements IDropTargetableE4{
        }
 
        protected void setMenuToGroup(){
-        for(AbstractGroupedContainerE4<?> container : groupedContainers){
+        for(AbstractGroupedContainer<?> container : groupedContainers){
             container.setMenu();
 
         }
@@ -6,7 +6,6 @@
  * 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.editor.name.e4.container;
 
 import java.util.Iterator;
@@ -58,10 +57,12 @@ import eu.etaxonomy.taxeditor.editor.name.container.EditorAnnotation.EditorAnnot
 import eu.etaxonomy.taxeditor.editor.name.container.IContainerConstants;
 import eu.etaxonomy.taxeditor.editor.name.container.LineBreakListener;
 import eu.etaxonomy.taxeditor.editor.name.container.LineWrapSupport;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDragListenerE4;
 import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDragSourceEffect;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInNewGroupOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
 import eu.etaxonomy.taxeditor.model.NameHelper;
@@ -84,7 +85,7 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * in its own <code>getData()</code>.
  * </p>
  * <p>
- * The <code>IManagedForm</code> can also used for drawing borders by calling
+ * The <code>IManagedForm</code> can also be used for drawing borders by calling
  * the method <code>createBorderSupport()</code>.
  * </p>
  * @author pplitzner
@@ -92,7 +93,7 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  *
  * @param <T>
  */
-abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
+abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                IFormPart, IContainerConstants, IElementHasDetails {
 
        protected ParseHandler parseHandler;
@@ -100,26 +101,28 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
        private FocusListener nameCompositeFocusListener;
        private ModifyListener nameCompositeModifyListener;
 
-       protected NameViewerE4 nameViewer;
+       protected NameViewer nameViewer;
 
-       private AbstractGroupE4 group;
+       private AbstractGroup group;
 
        private Label nonEditableInfoLabel;
        private DefaultToolTip nonEditableInfoHover;
 
-       private static AbstractGroupedContainerE4<?> selection;
+       private static AbstractGroupedContainer<?> selection;
 
        private FocusListener focusListener;
        private LineBreakListener lineBreakListener;
 
        private int cursorPosition;
 
+       private long lastEventTime;
+
        protected Composite control;
 
        private Color backgroundColor;
        private boolean isDirty;
 
-       public AbstractGroupedContainerE4(AbstractGroupE4 group, T taxonBase) {
+       public AbstractGroupedContainer(AbstractGroup group, T taxonBase) {
                setData(taxonBase);
                this.group = group;
                parseHandler = ParseHandler.NewInstance(taxonBase.getName());
@@ -150,6 +153,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                nameCompositeModifyListener = (ModifyEvent e)->{
                                // mark the composite dirty
                                setDirty(true);
+                               lastEventTime = System.currentTimeMillis();
                                // parse the text
                                String text = nameViewer.getTextWidget().getText();
 
@@ -157,12 +161,15 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                                getTaxonBase().setName(name);
                                getTaxonBase().setTitleCache((getTaxonBase().generateTitle()));
 
+
                                // show errors resulting from parsing
                                calculateAnnotations();
                                // store the position of the cursor
                                storeCursor();
                                // notify selection listener
                                setDelayedSelection();
+                               EventUtility.postAsyncEvent(WorkbenchEventConstants.NEED_REFRESH_DETAILS, false);
+
                };
 
                nameCompositeFocusListener = new FocusAdapter() {
@@ -172,6 +179,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                                super.focusLost(e);
                                persistName();
                        }
+
                };
 
                addListener();
@@ -440,7 +448,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                }
        }
 
-       public AbstractGroupE4 getGroup() {
+       public AbstractGroup getGroup() {
                if (group == null) {
                        throw new IllegalStateException("Group shall not be null."); //$NON-NLS-1$
                }
@@ -469,7 +477,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
 
        }
 
-       protected TaxonNameEditorE4 getEditor() {
+       protected TaxonEditor getEditor() {
                return getGroup().getEditor();
        }
 
@@ -477,12 +485,13 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                return control;
        }
 
-       protected void createLineWrapSupport() {
+       @SuppressWarnings("unused")
+    protected void createLineWrapSupport() {
                new LineWrapSupport(getNameViewer(), getEditor().getManagedForm());
        }
 
        protected void createTextViewer() {
-               nameViewer = new NameViewerE4(control);
+               nameViewer = new NameViewer(control);
 
                focusListener = new FocusAdapter() {
                        @Override
@@ -492,12 +501,12 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                                return;
                            }
 
-                               for (AbstractGroupedContainerE4<?> container : getEditor()
+                               for (AbstractGroupedContainer<?> container : getEditor()
                                                .getGroupedContainers()) {
                                        container.colorSelected(NOT_SELECTED);
                                }
                                getEditor().getManagedForm().setInput(
-                                               AbstractGroupedContainerE4.this);
+                                               AbstractGroupedContainer.this);
                                placeCursor();
                                colorSelected(SELECTED_FOCUS);
                        }
@@ -533,7 +542,9 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
        }
 
        public void setSelected() {
-               getNameViewer().getTextWidget().setFocus();
+           if (getNameViewer() != null && getNameViewer().getTextWidget() != null) {
+               getNameViewer().getTextWidget().setFocus();
+           }
        }
 
        public boolean isSelected() {
@@ -568,9 +579,10 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
            private volatile boolean stop = false;
         private Display display;
 
-        public Delay(Display display) {
+        private Delay(Display display) {
             this.display = display;
         }
+
         @Override
         public void run() {
 
@@ -602,7 +614,6 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                delay.requestStop();
                delay = new Delay(display);
                delay.start();
-
        }
 
        public void setBackground(Color color) {
@@ -619,7 +630,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                getNameViewer().getTextWidget().setFont(font);
        }
 
-       public NameViewerE4 getNameViewer() {
+       public NameViewer getNameViewer() {
                if (nameViewer == null) {
                        throw new RuntimeException(
                                        "The Name Viewer is corrupt for Name Container: " //$NON-NLS-1$
@@ -782,7 +793,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                        // Set indent to viewer ruler's width
                        if (getNameViewer().getRulerControl() != null) {
                                // TODO right justify
-                               layoutData.indent = NameViewerE4.RULER_WIDTH;
+                               layoutData.indent = NameViewer.RULER_WIDTH;
                        }
                        nonEditableInfoLabel.setLayoutData(layoutData);
 
@@ -824,7 +835,7 @@ abstract public class AbstractGroupedContainerE4<T extends TaxonBase> implements
                lineBreakListener = new LineBreakListener() {
                        @Override
                        public void handleSplitText(String text) {
-                               AbstractGroupedContainerE4.this.handleSplitText(text);
+                               AbstractGroupedContainer.this.handleSplitText(text);
                        }
 
                };
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 
 /**
  *
@@ -24,11 +24,11 @@ import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
  * @date Aug 24, 2017
  *
  */
-public abstract class AbstractHomotypicalGroupContainerE4 extends AbstractGroupE4 {
+public abstract class AbstractHomotypicalGroupContainer extends AbstractGroup {
 
        private HomotypicalGroup group;
 
-       public AbstractHomotypicalGroupContainerE4(TaxonNameEditorE4 editor, HomotypicalGroup group) {
+       public AbstractHomotypicalGroupContainer(TaxonEditor editor, HomotypicalGroup group) {
                super(editor);
                this.group = group;
 
@@ -61,11 +61,11 @@ public abstract class AbstractHomotypicalGroupContainerE4 extends AbstractGroupE
                List<Synonym> synonyms = taxon.getSynonymsInGroup(homotypicalGroup);
 
                List<Synonym> presentSynonyms = new ArrayList<Synonym>();
-               List<AbstractGroupedContainerE4> containers = getGroupedContainers();
+               List<AbstractGroupedContainer> containers = getGroupedContainers();
                if (containers == null || containers.isEmpty() || (containers.get(0) == null && containers.size() == 1)){
                    return true;
                }
-               for(AbstractGroupedContainerE4 container : getGroupedContainers()){
+               for(AbstractGroupedContainer container : getGroupedContainers()){
                        if(container.getData() instanceof Synonym){
                                presentSynonyms.add((Synonym) container.getData());
                        }
similarity index 86%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedGroupE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AcceptedGroup.java
index b62fdb12ed6b864df7776e0e555bc314f2bb6006..841ce4a687b702f90e474290e640d2d1b87d086b 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
 
@@ -26,11 +26,11 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @date Aug 24, 2017
  *
  */
-public class AcceptedGroupE4 extends AbstractHomotypicalGroupContainerE4 {
+public class AcceptedGroup extends AbstractHomotypicalGroupContainer {
 
        private AcceptedNameContainerE4 acceptedContainer;
 
-       public AcceptedGroupE4(TaxonNameEditorE4 editor, HomotypicalGroup group) {
+       public AcceptedGroup(TaxonEditor editor, HomotypicalGroup group) {
                super(editor, group);
        }
 
@@ -48,8 +48,8 @@ public class AcceptedGroupE4 extends AbstractHomotypicalGroupContainerE4 {
        }
 
        @Override
-       public List<AbstractGroupedContainerE4> getGroupedContainers() {
-               List<AbstractGroupedContainerE4> containers = new ArrayList<>();
+       public List<AbstractGroupedContainer> getGroupedContainers() {
+               List<AbstractGroupedContainer> containers = new ArrayList<>();
                containers.add(getAcceptedNameContainer());
                containers.addAll(super.getGroupedContainers());
                return containers;
index dbf44bac644c0313e4861a276073abf1f80e4d37..b77ebbdf79fe355ef50d07b9f7e2bb34683f76f5 100644 (file)
@@ -18,9 +18,9 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @author pplitzner
  * @date 24-08-2017
  */
-public class AcceptedNameContainerE4 extends AbstractGroupedContainerE4<Taxon> {
+public class AcceptedNameContainerE4 extends AbstractGroupedContainer<Taxon> {
 
-       public AcceptedNameContainerE4(AcceptedGroupE4 group, Taxon taxon) {
+       public AcceptedNameContainerE4(AcceptedGroup group, Taxon taxon) {
                super(group, taxon);
        }
 
similarity index 93%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ConceptContainerE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ConceptContainer.java
index c1817fc61ddafdcd7eab7ffa5dfdac3371ac1f27..01c8e00abf066ccbf9a2205a1373a6f173fb2dc2 100755 (executable)
@@ -20,8 +20,8 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.strategy.cache.TaggedCacheHelper;
 import eu.etaxonomy.cdm.strategy.cache.TaggedText;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroupE4.ConceptType;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroup.ConceptType;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.NameHelper;
 import eu.etaxonomy.taxeditor.preference.Resources;
@@ -31,13 +31,13 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public class ConceptContainerE4 extends AbstractGroupedContainerE4<Taxon> {
+public class ConceptContainer extends AbstractGroupedContainer<Taxon> {
 
     private TaxonRelationship relationship;
     private TaxonRelationshipFormatter misappliedFormatter;
     private ConceptType conceptType;
 
-       public ConceptContainerE4(AbstractGroupE4 group, Taxon misappliedName,  ConceptType conceptType) {
+       public ConceptContainer(AbstractGroup group, Taxon misappliedName,  ConceptType conceptType) {
                super(group, misappliedName);
                this.conceptType = conceptType;
                misappliedFormatter = TaxonRelationshipFormatter.INSTANCE();
@@ -47,7 +47,7 @@ public class ConceptContainerE4 extends AbstractGroupedContainerE4<Taxon> {
        protected void initializeComposite() {
                setIsDraggable(true);
                setFont(getViewerFont());
-               TaxonNameEditorE4 editor = getEditor();
+               TaxonEditor editor = getEditor();
                Taxon taxon = editor.getTaxon();
                for (TaxonRelationship rel: taxon.getTaxonRelations(getMisappliedName())){
                        if (rel.getType().isAnyMisappliedName() && this.conceptType.equals(ConceptType.Misapplication)){
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactory.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactory.java
new file mode 100644 (file)
index 0000000..525b74a
--- /dev/null
@@ -0,0 +1,117 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.editor.name.e4.container;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
+
+/**
+ *
+ * @author pplitzner
+ * @date Aug 24, 2017
+ *
+ */
+public class ContainerFactory {
+
+       public static void createOrUpdateAcceptedTaxonsHomotypicGroup(
+               TaxonEditor taxonEditor) {
+
+               if(taxonEditor.getAcceptedGroup() == null){
+                       taxonEditor.setAcceptedGroup(new AcceptedGroup(taxonEditor, taxonEditor.getTaxon().getHomotypicGroup()));
+               }
+               else{
+                       taxonEditor.getAcceptedGroup().redraw(taxonEditor.getTaxon().getHomotypicGroup());
+               }
+
+       }
+
+       public static void createOrUpdateHeterotypicSynonymyGroups(
+                       TaxonEditor taxonEditor) {
+               List<HomotypicalSynonymGroup> retainedGroups = new ArrayList<>();
+
+               List<HomotypicalSynonymGroup> heterotypicSynonymGroups = taxonEditor.getHeterotypicSynonymGroups();
+
+               if (heterotypicSynonymGroups != null) {
+
+                       for(HomotypicalSynonymGroup group : heterotypicSynonymGroups){
+                               retainedGroups.add(group);
+                       }
+               }
+
+               for(HomotypicalGroup homotypicalGroup : taxonEditor.getTaxon().getHeterotypicSynonymyGroups()){
+                   homotypicalGroup = HibernateProxyHelper.deproxy(homotypicalGroup, HomotypicalGroup.class);
+                   HomotypicalSynonymGroup group = createOrUpdateHeterotypicSynonymyGroup(taxonEditor, homotypicalGroup);
+
+                       retainedGroups.remove(group);
+               }
+
+               for(HomotypicalSynonymGroup retainedGroup : retainedGroups){
+                       taxonEditor.removeGroup(retainedGroup);
+               }
+       }
+
+
+       public static HomotypicalSynonymGroup createOrUpdateHeterotypicSynonymyGroup(
+               TaxonEditor taxonEditor, HomotypicalGroup homotypicalGroup){
+           HomotypicalSynonymGroup group = null;
+               if(taxonEditor.getHomotypicalGroupContainer(homotypicalGroup) == null){
+                       group = new HomotypicalSynonymGroup(taxonEditor, homotypicalGroup);
+                       taxonEditor.addHeterotypicSynonymGroup(group);
+                       if(taxonEditor.getMisappliedGroup() != null){
+                               group.getControl().moveAbove(taxonEditor.getMisappliedGroup().getControl());
+                       }
+               }
+               else{
+                       group = taxonEditor.getHomotypicalGroupContainer(homotypicalGroup);
+                       group.redraw(homotypicalGroup);
+               }
+
+               return group;
+       }
+
+       public static void createOrUpdateMisapplicationsGroup(
+               TaxonEditor taxonEditor) {
+               MisappliedGroup group = taxonEditor.getMisappliedGroup();
+               Taxon taxon = HibernateProxyHelper.deproxy(taxonEditor.getTaxon(), Taxon.class);
+
+               if(taxon.getMisappliedNames(true).isEmpty() && taxon.getProParteAndPartialSynonyms().isEmpty()){
+                       taxonEditor.removeGroup(group);
+                       taxonEditor.setMisapplicationsGroup(null);
+               }else{
+                       if(group == null){
+                               taxonEditor.setMisapplicationsGroup(new MisappliedGroup(taxonEditor));
+                       }else{
+                               group.redraw();
+                       }
+               }
+
+       }
+
+       public static void setMenuToAllContainers(TaxonEditor taxonEditor){
+           if (taxonEditor == null) {
+            return;
+        }
+           if (taxonEditor.getAcceptedGroup() != null){
+               taxonEditor.getAcceptedGroup().setMenuToGroup();
+           }
+           if (taxonEditor.getTaxon() != null){
+           for(HomotypicalGroup homotypicalGroup : taxonEditor.getTaxon().getHeterotypicSynonymyGroups()){
+                homotypicalGroup = HibernateProxyHelper.deproxy(homotypicalGroup, HomotypicalGroup.class);
+                HomotypicalSynonymGroup group = taxonEditor.getHomotypicalGroupContainer(homotypicalGroup);
+                if (group != null){
+                    group.setMenuToGroup();
+                }
+            }
+           if (taxonEditor.getMisappliedGroup() != null){
+               taxonEditor.getMisappliedGroup().setMenuToGroup();
+           }
+           }
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactoryE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/ContainerFactoryE4.java
deleted file mode 100644 (file)
index 43d2039..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- *
- */
-package eu.etaxonomy.taxeditor.editor.name.e4.container;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-
-/**
- *
- * @author pplitzner
- * @date Aug 24, 2017
- *
- */
-public class ContainerFactoryE4 {
-
-       public static void createOrUpdateAcceptedTaxonsHomotypicGroup(
-               TaxonNameEditorE4 taxonNameEditor) {
-
-               if(taxonNameEditor.getAcceptedGroup() == null){
-                       taxonNameEditor.setAcceptedGroup(new AcceptedGroupE4(taxonNameEditor, taxonNameEditor.getTaxon().getHomotypicGroup()));
-               }
-               else{
-                       taxonNameEditor.getAcceptedGroup().redraw(taxonNameEditor.getTaxon().getHomotypicGroup());
-               }
-
-       }
-
-       public static void createOrUpdateHeterotypicSynonymyGroups(
-                       TaxonNameEditorE4 taxonNameEditor) {
-               List<HomotypicalSynonymGroupE4> retainedGroups = new ArrayList<>();
-
-               List<HomotypicalSynonymGroupE4> heterotypicSynonymGroups = taxonNameEditor.getHeterotypicSynonymGroups();
-
-               if (heterotypicSynonymGroups != null) {
-
-                       for(HomotypicalSynonymGroupE4 group : heterotypicSynonymGroups){
-                               retainedGroups.add(group);
-                       }
-               }
-
-               for(HomotypicalGroup homotypicalGroup : taxonNameEditor.getTaxon().getHeterotypicSynonymyGroups()){
-                   homotypicalGroup = HibernateProxyHelper.deproxy(homotypicalGroup, HomotypicalGroup.class);
-                   HomotypicalSynonymGroupE4 group = createOrUpdateHeterotypicSynonymyGroup(taxonNameEditor, homotypicalGroup);
-
-                       retainedGroups.remove(group);
-               }
-
-               for(HomotypicalSynonymGroupE4 retainedGroup : retainedGroups){
-                       taxonNameEditor.removeGroup(retainedGroup);
-               }
-       }
-
-
-       public static HomotypicalSynonymGroupE4 createOrUpdateHeterotypicSynonymyGroup(
-               TaxonNameEditorE4 taxonNameEditor, HomotypicalGroup homotypicalGroup){
-           HomotypicalSynonymGroupE4 group = null;
-               if(taxonNameEditor.getHomotypicalGroupContainer(homotypicalGroup) == null){
-                       group = new HomotypicalSynonymGroupE4(taxonNameEditor, homotypicalGroup);
-                       taxonNameEditor.addHeterotypicSynonymGroup(group);
-                       if(taxonNameEditor.getMisappliedGroup() != null){
-                               group.getControl().moveAbove(taxonNameEditor.getMisappliedGroup().getControl());
-                       }
-               }
-               else{
-                       group = taxonNameEditor.getHomotypicalGroupContainer(homotypicalGroup);
-                       group.redraw(homotypicalGroup);
-               }
-
-               return group;
-       }
-
-       public static void createOrUpdateMisapplicationsGroup(
-               TaxonNameEditorE4 taxonNameEditor) {
-               MisappliedGroupE4 group = taxonNameEditor.getMisappliedGroup();
-               Taxon taxon = HibernateProxyHelper.deproxy(taxonNameEditor.getTaxon(), Taxon.class);
-
-               if(taxon.getMisappliedNames(true).isEmpty() && taxon.getProParteAndPartialSynonyms().isEmpty()){
-                       taxonNameEditor.removeGroup(group);
-                       taxonNameEditor.setMisapplicationsGroup(null);
-               }else{
-                       if(group == null){
-                               taxonNameEditor.setMisapplicationsGroup(new MisappliedGroupE4(taxonNameEditor));
-                       }else{
-                               group.redraw();
-                       }
-               }
-
-       }
-
-       public static void setMenuToAllContainers(TaxonNameEditorE4 taxonNameEditor){
-           if (taxonNameEditor == null) {
-            return;
-        }
-           if (taxonNameEditor.getAcceptedGroup() != null){
-               taxonNameEditor.getAcceptedGroup().setMenuToGroup();
-           }
-           if (taxonNameEditor.getTaxon() != null){
-           for(HomotypicalGroup homotypicalGroup : taxonNameEditor.getTaxon().getHeterotypicSynonymyGroups()){
-                homotypicalGroup = HibernateProxyHelper.deproxy(homotypicalGroup, HomotypicalGroup.class);
-                HomotypicalSynonymGroupE4 group = taxonNameEditor.getHomotypicalGroupContainer(homotypicalGroup);
-                if (group != null){
-                    group.setMenuToGroup();
-                }
-            }
-           if (taxonNameEditor.getMisappliedGroup() != null){
-               taxonNameEditor.getMisappliedGroup().setMenuToGroup();
-           }
-           }
-       }
-
-}
@@ -14,7 +14,7 @@ import org.eclipse.swt.graphics.Image;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.taxeditor.editor.name.container.IContainerConstants;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 
 /**
  *
@@ -22,9 +22,9 @@ import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
  * @date Aug 24, 2017
  *
  */
-public class HomotypicalSynonymGroupE4 extends AbstractHomotypicalGroupContainerE4 {
+public class HomotypicalSynonymGroup extends AbstractHomotypicalGroupContainer {
 
-       public HomotypicalSynonymGroupE4(TaxonNameEditorE4 editor, HomotypicalGroup group) {
+       public HomotypicalSynonymGroup(TaxonEditor editor, HomotypicalGroup group) {
                super(editor, group);
        }
 
@@ -13,13 +13,13 @@ import java.util.HashSet;
 import java.util.Set;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 
 /**
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public class MisappliedGroupE4 extends AbstractGroupE4{
+public class MisappliedGroup extends AbstractGroup{
 
     protected enum ConceptType {
         Misapplication,
@@ -27,7 +27,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
     }
 
 
-       public MisappliedGroupE4(TaxonNameEditorE4 editor) {
+       public MisappliedGroup(TaxonEditor editor) {
                super(editor);
 
                createContent();
@@ -37,7 +37,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
        protected void createContainers() {
 
                for(Taxon proParteSynonym : getEditor().getTaxon().getAllProParteSynonyms()){
-            ConceptContainerE4 container = new ConceptContainerE4(this, proParteSynonym, ConceptType.Synonym);
+            ConceptContainer container = new ConceptContainer(this, proParteSynonym, ConceptType.Synonym);
             this.add(container);
             container.createContent();
         }
@@ -45,7 +45,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
 
                for(Taxon misapplication : getEditor().getTaxon().getAllMisappliedNames()){
 
-            ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, ConceptType.Misapplication);
+            ConceptContainer container = new ConceptContainer(this, misapplication, ConceptType.Misapplication);
             this.add(container);
             container.createContent();
         }
@@ -66,7 +66,7 @@ public class MisappliedGroupE4 extends AbstractGroupE4{
 
                Set<Taxon> presentConcepts = new HashSet<>();
 
-               for (AbstractGroupedContainerE4<Taxon> container  : getGroupedContainers()){
+               for (AbstractGroupedContainer<Taxon> container  : getGroupedContainers()){
                    presentConcepts.add(container.getData());
                }
                return ! (presentConcepts.containsAll(concepts) && concepts.containsAll(presentConcepts));
similarity index 98%
rename from eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/NameViewerE4.java
rename to eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/NameViewer.java
index 6e156188cd7b7fbd84dba80702cbca840e1c9647..6acb5d132bfc0f88f7da07f85f5c730f54b64f1a 100644 (file)
@@ -58,14 +58,14 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @since Aug 25, 2017
  *
  */
-public class NameViewerE4 extends SourceViewer {
+public class NameViewer extends SourceViewer {
 
        public static final int RULER_WIDTH = 16;
 
        private final IVerticalRuler ruler;
        private final AnnotationModel annotationModel;
 
-       public NameViewerE4(Composite parent) {
+       public NameViewer(Composite parent) {
                super(parent, new RulerWithIcon(RULER_WIDTH), SWT.WRAP | SWT.MULTI | SWT.RESIZE);
 
                this.ruler = getVerticalRuler();
index fd7d07bcecd9eca19f2abf6ec0719f5e559b7e7d..d8008dccfc6a638863246476340134ba7288ff0c 100644 (file)
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @author p.ciardelli
  * @created 13.01.2009
  */
-public class SynonymContainerE4 extends AbstractGroupedContainerE4<Synonym> {
+public class SynonymContainerE4 extends AbstractGroupedContainer<Synonym> {
 
        private int indent = SYNONYM_INDENT;
        private Image icon = HETEROTYPIC_SYNONYM_ICON;
@@ -37,15 +37,15 @@ public class SynonymContainerE4 extends AbstractGroupedContainerE4<Synonym> {
        /**
         * <p>Constructor for SynonymContainer.</p>
         *
-        * @param editor a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor} object.
+        * @param editor a {@link eu.etaxonomy.taxeditor.editor.name.TaxonEditor} object.
         * @param group a {@link eu.etaxonomy.taxeditor.editor.name.container.AbstractGroup} object.
         * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
         */
-       public SynonymContainerE4(AbstractHomotypicalGroupContainerE4 group, Synonym synonym) {
+       public SynonymContainerE4(AbstractHomotypicalGroupContainer group, Synonym synonym) {
                super(group, synonym);
        }
 
-       public SynonymContainerE4(AbstractHomotypicalGroupContainerE4 group, Synonym synonym, int indent, Image icon){
+       public SynonymContainerE4(AbstractHomotypicalGroupContainer group, Synonym synonym, int indent, Image icon){
                super(group, synonym);
                this.indent = indent;
                this.icon = icon;
index 4c5195317b4cb27129ca57dc9fc48bef4641d19f..72c8a6ce72b2f1902121b59b13aee2d96f361a23 100644 (file)
@@ -10,8 +10,8 @@ import org.eclipse.ui.forms.ManagedForm;
 
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainerE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainer;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainer;
 
 /**
  * @author pplitzner
@@ -19,9 +19,9 @@ import eu.etaxonomy.taxeditor.editor.name.e4.container.ConceptContainerE4;
  */
 public class NameEditorDragListenerE4 extends DragSourceAdapter {
 
-       private AbstractGroupedContainerE4<?> container;
+       private AbstractGroupedContainer<?> container;
 
-       public NameEditorDragListenerE4(AbstractGroupedContainerE4 container){
+       public NameEditorDragListenerE4(AbstractGroupedContainer container){
                this.container = container;
        }
 
@@ -48,6 +48,6 @@ public class NameEditorDragListenerE4 extends DragSourceAdapter {
 
        @Override
        public void dragStart(DragSourceEvent event) {
-               event.doit = (container.getData() != null) && !(container instanceof ConceptContainerE4);
+               event.doit = (container.getData() != null) && !(container instanceof ConceptContainer);
        }
 }
index 693cde5f90a0b742442c63663a018a6a2e23a5bb..e92012a6edb9f78a61833d207351c1f4c736ad6f 100644 (file)
@@ -8,7 +8,7 @@ import org.eclipse.swt.dnd.DropTargetEvent;
 import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetableE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetable;
 import eu.etaxonomy.taxeditor.preference.Resources;
 
 /**
@@ -22,8 +22,8 @@ public class NameEditorDropTargetEffect extends DropTargetEffect {
 
        @Override
     public void dragEnter(DropTargetEvent dropTargetEvent) {
-               if(dropTargetEvent.widget instanceof IDropTargetableE4){
-                       ((IDropTargetableE4) dropTargetEvent.widget).dragEntered();
+               if(dropTargetEvent.widget instanceof IDropTargetable){
+                       ((IDropTargetable) dropTargetEvent.widget).dragEntered();
                }
        }
 
@@ -20,10 +20,10 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetableE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractHomotypicalGroupContainerE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroupE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.IDropTargetable;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractHomotypicalGroupContainer;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroup;
 import eu.etaxonomy.taxeditor.editor.name.e4.operation.MoveSynonymToAnotherAcceptedTaxonOperationE4;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTypeOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
@@ -40,11 +40,11 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
  * @author pplitzner
  * @date Aug 24, 2017
  */
-public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
+public class NameEditorDropTargetListener extends DropTargetAdapter {
 
-       private IDropTargetableE4 target;
+       private IDropTargetable target;
 
-       public NameEditorDropTargetListenerE4(IDropTargetableE4 target){
+       public NameEditorDropTargetListener(IDropTargetable target){
                this.target = target;
        }
 
@@ -71,7 +71,7 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
                        return;
                }
 
-               if (target instanceof MisappliedGroupE4){
+               if (target instanceof MisappliedGroup){
                   dropTargetEvent.detail = DND.DROP_NONE;
               return;
                }
@@ -94,48 +94,44 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
                if(taxonBase instanceof Synonym){
                        Synonym synonym = (Synonym) taxonBase;
 
-                       if(target instanceof AbstractHomotypicalGroupContainerE4){
-                               HomotypicalGroup homotypicalGroup = ((AbstractHomotypicalGroupContainerE4) target).getGroup();
-                               if (((AbstractHomotypicalGroupContainerE4) target).getEditor().getTaxon().equals(synonym.getAcceptedTaxon())){
+                       if(target instanceof AbstractHomotypicalGroupContainer){
+                               HomotypicalGroup homotypicalGroup = ((AbstractHomotypicalGroupContainer) target).getGroup();
+                               if (((AbstractHomotypicalGroupContainer) target).getEditor().getTaxon().equals(synonym.getAcceptedTaxon())){
                                    //the actual accepted taxon is the same as the taxon of the target editor
                                    try{
                                        return new ChangeHomotypicGroupOperation(Messages.NameEditorDropTargetListener_CHANGE_HOMOTYPICAL_GROUP, getEditor().getUndoContext(),
-                                                                           ((AbstractHomotypicalGroupContainerE4) target).getEditor().getTaxon(), synonym, homotypicalGroup, target);
+                                                                           ((AbstractHomotypicalGroupContainer) target).getEditor().getTaxon(), synonym, homotypicalGroup, target);
                                    }catch (NullPointerException e){
                                        return null;
                                    }
                                 } else{
-                    getEditor().getConversationHolder().commit();
-                    ((TaxonNameEditorE4) target).getConversationHolder().commit();
-                    UUID newSecUuid = null;
-                    try{
-                        newSecUuid = getNewSecRef(synonym);
-                    }catch (Exception e){
-                        return null;
-                    }
-                    return new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.NameEditorDropTargetListener_CHANGE_ACC_TAXON, getEditor().getUndoContext(), synonym.getUuid(), ((TaxonNameEditorE4) target).getTaxon(), newSecUuid, (TaxonNameEditorE4) target, (TaxonNameEditorE4) target);
+                                        UUID newSecUuid = null;
+                                        try{
+                                                newSecUuid = getNewSecRef(synonym);
+                                        }catch (Exception e){
+                                                return null;
+                                        }
+                                        return new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.NameEditorDropTargetListener_CHANGE_ACC_TAXON, getEditor().getUndoContext(), synonym.getUuid(), ((TaxonEditor) target).getTaxon(), newSecUuid, (TaxonEditor) target);
 
                 }
 
                        }
-                       else if(target instanceof MisappliedGroupE4){
+                       else if(target instanceof MisappliedGroup){
                                return new ChangeSynonymToMisapplicationOperation(Messages.NameEditorDropTargetListener_CHANGE_SYNONYM_TO_MISAPP, getEditor().getUndoContext(),
                                                getEditor().getTaxon(), synonym, target);
                        }
-                       else if(target instanceof TaxonNameEditorE4){
-                               if (((TaxonNameEditorE4) target).getTaxon().equals(synonym.getAcceptedTaxon())){
+                       else if(target instanceof TaxonEditor){
+                               if (((TaxonEditor) target).getTaxon().equals(synonym.getAcceptedTaxon())){
                                        return new ChangeHomotypicGroupOperation(Messages.NameEditorDropTargetListener_CHANGE_HOMOTYPICAL_GROUP, getEditor().getUndoContext(),
-                                               ((TaxonNameEditorE4) target).getTaxon(), synonym, null, target);
+                                               ((TaxonEditor) target).getTaxon(), synonym, null, target);
                                } else{
-                                       getEditor().getConversationHolder().commit();
-                                       ((TaxonNameEditorE4) target).getConversationHolder().commit();
                                        UUID newSecUuid = null;
                                        try{
                                            newSecUuid = getNewSecRef(synonym);
                                        }catch (Exception e){
                                            return null;
                                        }
-                                       return new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.NameEditorDropTargetListener_CHANGE_ACC_TAXON, getEditor().getUndoContext(), synonym.getUuid(), ((TaxonNameEditorE4) target).getTaxon(), newSecUuid, (TaxonNameEditorE4) target, (TaxonNameEditorE4) target);
+                                       return new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.NameEditorDropTargetListener_CHANGE_ACC_TAXON, getEditor().getUndoContext(), synonym.getUuid(), ((TaxonEditor) target).getTaxon(), newSecUuid, (TaxonEditor) target);
 
                                }
                        }
@@ -143,13 +139,13 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
                }else if(taxonBase instanceof Taxon){
                        Taxon concept = (Taxon) taxonBase;
 
-                       if(target instanceof AbstractHomotypicalGroupContainerE4){
-                               HomotypicalGroup homotypicalGroup = ((AbstractHomotypicalGroupContainerE4) target).getGroup();
+                       if(target instanceof AbstractHomotypicalGroupContainer){
+                               HomotypicalGroup homotypicalGroup = ((AbstractHomotypicalGroupContainer) target).getGroup();
 
                                return new ChangeConceptToSynonymOperation(Messages.NameEditorDropTargetListener_CHANGE_SYNONYM, getEditor().getUndoContext(),
                                                getEditor().getTaxon(), concept, homotypicalGroup, target);
                        }
-                       else if(target instanceof MisappliedGroupE4){
+                       else if(target instanceof MisappliedGroup){
                                return new ChangeConceptRelationshipTypeOperation(Messages.NameEditorDropTargetListener_CHANGE, getEditor().getUndoContext(),
                                                getEditor().getTaxon(), concept, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), target);
                        }
@@ -163,7 +159,7 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
         Reference synSecRef = synonym.getSec();
         UUID newSecUuid = null;
         SecReferenceHandlingEnum secHandling = PreferencesUtil.getSecReferenceHandlingPreference();
-        Reference parentSecRef = ((AbstractHomotypicalGroupContainerE4) target).getEditor().getTaxon() != null? ((AbstractHomotypicalGroupContainerE4) target).getEditor().getTaxon().getSec():null;
+        Reference parentSecRef = ((AbstractHomotypicalGroupContainer) target).getEditor().getTaxon() != null? ((AbstractHomotypicalGroupContainer) target).getEditor().getTaxon().getSec():null;
         if ((synSecRef != parentSecRef && secHandling.equals(SecReferenceHandlingEnum.KeepOrWarn) )|| secHandling.equals(SecReferenceHandlingEnum.KeepOrSelect)){
 
             if ((parentSecRef != synSecRef && secHandling.equals(SecReferenceHandlingEnum.KeepOrWarn) )|| secHandling.equals(SecReferenceHandlingEnum.KeepOrSelect)){
@@ -192,8 +188,8 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
        }
 
        private HomotypicalGroup getHomotypicalGroup() {
-               if(target instanceof AbstractHomotypicalGroupContainerE4){
-                       return ((AbstractHomotypicalGroupContainerE4) target).getGroup();
+               if(target instanceof AbstractHomotypicalGroupContainer){
+                       return ((AbstractHomotypicalGroupContainer) target).getGroup();
                }
                return null;
        }
@@ -210,7 +206,7 @@ public class NameEditorDropTargetListenerE4 extends DropTargetAdapter {
                return null;
        }
 
-       private TaxonNameEditorE4 getEditor() {
-               return (TaxonNameEditorE4) EventUtility.getTaxonEditor();
+       private TaxonEditor getEditor() {
+               return (TaxonEditor) EventUtility.getTaxonEditor();
        }
 }
@@ -37,9 +37,9 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation;
 import eu.etaxonomy.taxeditor.event.EventUtility;
@@ -55,11 +55,11 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
  * @author pplitzner
  * @since Aug 28, 2017
  */
-public class ChangeSynonymToAcceptedTaxonHandlerE4 implements IPostOperationEnabled {
+public class ChangeSynonymToAcceptedTaxonHandler implements IPostOperationEnabled {
 
-    private static final Logger logger = LogManager.getLogger(ChangeSynonymToAcceptedTaxonHandlerE4.class);
+    private static final Logger logger = LogManager.getLogger(ChangeSynonymToAcceptedTaxonHandler.class);
 
-       private TaxonNameEditorE4 editor;
+       private TaxonEditor editor;
     private EPartService partService;
     private MApplication application;
     private EModelService modelService;
@@ -74,9 +74,9 @@ public class ChangeSynonymToAcceptedTaxonHandlerE4 implements IPostOperationEnab
         this.application = application;
         this.partService = partService;
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
-        TaxonEditorInputE4 input = editor.getEditorInput();
+        TaxonEditorInput input = editor.getEditorInput();
 
                // Get synonym from selection
                if (!(selection.getFirstElement() instanceof Synonym)) {
@@ -95,8 +95,7 @@ public class ChangeSynonymToAcceptedTaxonHandlerE4 implements IPostOperationEnab
                // Get taxon
                Taxon taxon = input.getTaxon();
 
-               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(shell,// editor.getConversationHolder(),
-                       Messages.ChangeSynonymToAcceptedTaxonHandler_SELECT_PARENT, null, null, input.getTaxonNode().getClassification().getUuid(), true);
+               TaxonNode newParentNode = TaxonNodeSelectionDialog.select(shell, Messages.ChangeSynonymToAcceptedTaxonHandler_SELECT_PARENT, null, null, input.getTaxonNode().getClassification().getUuid(), true);
 
                if(newParentNode != null){
                    Reference parentSecRef = newParentNode.getTaxon() != null? newParentNode.getTaxon().getSec(): null;
@@ -159,7 +158,7 @@ public class ChangeSynonymToAcceptedTaxonHandlerE4 implements IPostOperationEnab
                        ChangeSynonymToAcceptedTaxonOperation operation = new ChangeSynonymToAcceptedTaxonOperation(Messages.ChangeSynonymToAcceptedTaxonHandler_CHANGE_SYN_TO_ACC_TAXON, EditorUtil.getUndoContext(),
                                        taxon, newParentNode, synonym,
                                        newSecUuid, secHandling,
-                                       this, editor, editor.getEditorInput()); //$NON-NLS-1$
+                                       this, editor.getEditorInput()); //$NON-NLS-1$
 
                        AbstractUtility.executeOperation(operation, sync);
                }
@@ -24,7 +24,7 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTypeOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToMisapplicationOperation;
@@ -37,9 +37,9 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
  * @since Aug 28, 2017
  *
  */
-public class ChangeToMisapplicationHandlerE4 {
+public class ChangeToMisapplicationHandler {
 
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -48,7 +48,7 @@ public class ChangeToMisapplicationHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
         if (!EditorUtil.forceUserSaveE4Editor(editor, shell)){
             return ;
@@ -24,7 +24,7 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptRelationshipTypeOperation;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToConceptOperation;
@@ -37,9 +37,9 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
  * @since Aug 28, 2017
  *
  */
-public class ChangeToProParteSynonymHandlerE5 {
+public class ChangeToProParteSynonymHandler {
 
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -48,7 +48,7 @@ public class ChangeToProParteSynonymHandlerE5 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
                if (!EditorUtil.forceUserSaveE4Editor(editor, shell)){
             return ;
@@ -20,7 +20,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
  * @since Aug 28, 2017
  *
  */
-public class ChangeToSynonymHandlerE4 {
+public class ChangeToSynonymHandler {
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -40,7 +40,7 @@ public class ChangeToSynonymHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
 
                Taxon concept  = (Taxon) selection.getFirstElement();
@@ -20,7 +20,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.name.TaxonName;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInNewGroupOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
  * @since Aug 28, 2017
  *
  */
-public class CreateHeterotypicSynonymHandlerE4 {
+public class CreateHeterotypicSynonymHandler {
 
 
     @Execute
@@ -40,7 +40,7 @@ public class CreateHeterotypicSynonymHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
                TaxonName newSynonymName = ParseHandler.createEmptyName();
 
@@ -22,7 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -35,7 +35,7 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
  * @since Aug 28, 2017
  *
  */
-public class CreateHomotypicSynonymHandlerE4 {
+public class CreateHomotypicSynonymHandler {
 
 
     @Execute
@@ -43,7 +43,7 @@ public class CreateHomotypicSynonymHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
                Taxon taxon = editor.getTaxon();
                HomotypicalGroup group = taxon.getHomotypicGroup();
                TaxonName newSynonymName = ParseHandler.createEmptyName();
@@ -22,7 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -34,14 +34,14 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
  * @since Aug 28, 2017
  *
  */
-public class CreateMisapplicationHandlerE4 {
+public class CreateMisapplicationHandler {
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
                TaxonName conceptName = ParseHandler.createEmptyName();
                Taxon concept = Taxon.NewInstance(conceptName, null);
@@ -20,7 +20,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -31,7 +31,7 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
  * @since 15.05.2018
  *
  */
-public class CreateProParteSynonymHandlerE4 {
+public class CreateProParteSynonymHandler {
 
 
         @Execute
@@ -39,7 +39,7 @@ public class CreateProParteSynonymHandlerE4 {
                 MHandledMenuItem menuItem,
                 UISynchronize sync) {
 
-            TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+            TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
             TaxonName conceptName = ParseHandler.createEmptyName();
             Taxon concept = Taxon.NewInstance(conceptName, null);
@@ -22,7 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInExistingHomotypicalGroupOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -33,7 +33,7 @@ import eu.etaxonomy.taxeditor.parser.ParseHandler;
  * @author pplitzner
  * @since Aug 28, 2017
  */
-public class CreateSynonymInHomotypicalGroupHandlerE4 {
+public class CreateSynonymInHomotypicalGroupHandler {
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -41,7 +41,7 @@ public class CreateSynonymInHomotypicalGroupHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
                Object selectedObject = selection.getFirstElement();
 
@@ -20,8 +20,8 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
+import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainer;
 
 /**
  *
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE
  * @since Aug 28, 2017
  *
  */
-public class DeleteAllEmptyNamesHandlerE4 extends DeleteTaxonBaseHandlerE4 {
+public class DeleteAllEmptyNamesHandler extends DeleteTaxonBaseHandler {
 
     @Override
     @Execute
@@ -39,9 +39,9 @@ public class DeleteAllEmptyNamesHandlerE4 extends DeleteTaxonBaseHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
-               for(AbstractGroupedContainerE4 containerWithEmptyName : editor.getEmptyContainers()){
+               for(AbstractGroupedContainer containerWithEmptyName : editor.getEmptyContainers()){
                    editor.removeGroup(containerWithEmptyName.getGroup());
                        doExecute(menuItem.getLocalizedLabel(), shell, editor, containerWithEmptyName.getData(), sync);
                }
@@ -55,7 +55,7 @@ public class DeleteAllEmptyNamesHandlerE4 extends DeleteTaxonBaseHandlerE4 {
             @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
             MHandledMenuItem menuItem){
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
         boolean canExecute = false;
         canExecute = editor.checkForEmptyNames();
@@ -31,7 +31,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -45,9 +45,9 @@ import eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator.DeleteCo
  * @since Aug 28, 2017
  *
  */
-public class DeleteTaxonBaseHandlerE4 implements IPostOperationEnabled {
+public class DeleteTaxonBaseHandler implements IPostOperationEnabled {
 
-    protected TaxonNameEditorE4 editor;
+    protected TaxonEditor editor;
 
        @Execute
        public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -56,13 +56,13 @@ public class DeleteTaxonBaseHandlerE4 implements IPostOperationEnabled {
                MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-           editor = (TaxonNameEditorE4) activePart.getObject();
+           editor = (TaxonEditor) activePart.getObject();
 
            doExecute(menuItem.getLocalizedLabel(), shell, editor, selection.getFirstElement(), sync);
 
        }
 
-       protected void doExecute(String commandName, Shell shell, TaxonNameEditorE4 editor, Object selectedElement,
+       protected void doExecute(String commandName, Shell shell, TaxonEditor editor, Object selectedElement,
             UISynchronize sync) {
                AbstractPostOperation operation = null;
 
@@ -26,9 +26,9 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.e4.operation.MoveSynonymToAnotherAcceptedTaxonOperationE4;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -38,11 +38,11 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 
-public class MoveSynonymToAnotherAcceptedTaxonHandlerE4 implements IPostOperationEnabled{
+public class MoveSynonymToAnotherAcceptedTaxonHandler implements IPostOperationEnabled{
 
-    private static final Logger logger = LogManager.getLogger(MoveSynonymToAnotherAcceptedTaxonHandlerE4.class);
+    private static final Logger logger = LogManager.getLogger(MoveSynonymToAnotherAcceptedTaxonHandler.class);
 
-       private TaxonNameEditorE4 editor;
+       private TaxonEditor editor;
 
     private TaxonNode newParentNode;
 
@@ -66,9 +66,9 @@ public class MoveSynonymToAnotherAcceptedTaxonHandlerE4 implements IPostOperatio
            this.activePart = activePart;
            this.partService = partService;
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
-        TaxonEditorInputE4 input = editor.getEditorInput();
+        TaxonEditorInput input = editor.getEditorInput();
 
                if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
                        return ;
@@ -122,7 +122,7 @@ public class MoveSynonymToAnotherAcceptedTaxonHandlerE4 implements IPostOperatio
         }
                if(newParentNode!=null){
                   MoveSynonymToAnotherAcceptedTaxonOperationE4 operation = new MoveSynonymToAnotherAcceptedTaxonOperationE4(Messages.MoveSynonymToAnotherAcceptedTaxonHandler_CHANGE_ACC_TAXON, EditorUtil.getUndoContext(),
-                           synonym.getUuid(), newParentNode.getTaxon(),newSecUuid, this, editor);
+                           synonym.getUuid(), newParentNode.getTaxon(),newSecUuid, this);
 
                    AbstractUtility.executeOperation(operation, sync);
                }
@@ -20,7 +20,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.ChangeHomotypicalGroupBasionymOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
  * @since Aug 28, 2017
  *
  */
-public class SetBasionymHandlerE4 {
+public class SetBasionymHandler {
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
@@ -40,7 +40,7 @@ public class SetBasionymHandlerE4 {
             MHandledMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
+        TaxonEditor editor = (TaxonEditor) activePart.getObject();
 
                TaxonBase selectedTaxonBase = (TaxonBase) selection.getFirstElement();
 
@@ -35,7 +35,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester;
 import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
 import eu.etaxonomy.taxeditor.event.EventUtility;
@@ -50,9 +50,9 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
  * @author pplitzner
  * @since Aug 28, 2017
  */
-public class SwapSynonymAndAcceptedHandlerE4 implements IPostOperationEnabled {
+public class SwapSynonymAndAcceptedHandler implements IPostOperationEnabled {
 
-    protected TaxonNameEditorE4 editor;
+    protected TaxonEditor editor;
     protected Taxon taxon;
     protected EPartService partService;
     protected MPart activePart;
@@ -72,7 +72,7 @@ public class SwapSynonymAndAcceptedHandlerE4 implements IPostOperationEnabled {
         this.application = application;
         this.partService = partService;
 
-        editor = (TaxonNameEditorE4) activePart.getObject();
+        editor = (TaxonEditor) activePart.getObject();
 
         Synonym synonym = (Synonym) selection.getFirstElement();
 
index 64636eec9602e07537156b39f0cf02d00d679901..25d27c7352f92c620ddab4eed9745f05abd7c873 100755 (executable)
@@ -30,7 +30,7 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @since Aug 28, 2017
  *
  */
-public class SwapSynonymAndAcceptedSetNameInSourceHandlerE5 extends SwapSynonymAndAcceptedHandlerE4 implements IPostOperationEnabled {
+public class SwapSynonymAndAcceptedSetNameInSourceHandlerE5 extends SwapSynonymAndAcceptedHandler implements IPostOperationEnabled {
 
 
 
@@ -52,7 +52,7 @@ public class SwapSynonymAndAcceptedSetNameInSourceHandlerE5 extends SwapSynonymA
 //        this.application = application;
 //        this.partService = partService;
 //
-//        editor = (TaxonNameEditorE4) activePart.getObject();
+//        editor = (TaxonEditor) activePart.getObject();
 //
 //        Synonym synonym = (Synonym) selection.getFirstElement();
 //
index ca25ea9a502f8976cb8314199845f3a97210a1db..e74b03664d609b38bc42509eac8e9419c5c0a0ec 100644 (file)
@@ -12,7 +12,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
@@ -30,16 +29,15 @@ public class MoveSynonymToAnotherAcceptedTaxonOperationE4 extends
         * The synonym to be moved.
         */
        private final Synonym synonym;
-       private IConversationEnabled conversationEnabled;
        private UUID newSecUuid;
 
     public MoveSynonymToAnotherAcceptedTaxonOperationE4(String label, IUndoContext undoContext, UUID synonymUUID,
-            Taxon taxon, UUID newSecRefUuid, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
+            Taxon taxon, UUID newSecRefUuid, IPostOperationEnabled postOperationEnabled) {
 
                super(label, undoContext, taxon, postOperationEnabled);
                List<String> propertyPaths =  new ArrayList<String>();
                propertyPaths.add("synonymRelations"); //$NON-NLS-1$
-               this.conversationEnabled = conversationEnabled;
+               
                this.element = (Taxon) CdmStore.getService(ITaxonService.class).load(taxon.getUuid(),propertyPaths);
                this.synonym = (Synonym) CdmStore.getService(ITaxonService.class).load(synonymUUID);
                this.newSecUuid = newSecRefUuid;
@@ -59,8 +57,6 @@ public class MoveSynonymToAnotherAcceptedTaxonOperationE4 extends
                monitor.beginTask("Move synonym to another taxon", 40);
                Taxon oldAccepted = synonym.getAcceptedTaxon();
 //             Reference secRef = CdmStore.getService(IReferenceService.class).load(newSecUuid);
-               conversationEnabled.getConversationHolder().commit();
-
                UpdateResult result = null;
                try {
                        result = CdmStore.getService(ITaxonService.class).moveSynonymToAnotherTaxon(synonym,
@@ -74,8 +70,6 @@ public class MoveSynonymToAnotherAcceptedTaxonOperationE4 extends
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
-//             conversationEnabled.getConversationHolder().commit();
-
                monitor.worked(40);
                // Redraw editor if it exists
                Set<Taxon> taxa = new HashSet<>();
@@ -83,8 +77,6 @@ public class MoveSynonymToAnotherAcceptedTaxonOperationE4 extends
         taxa.add(oldAccepted);
 
         EditorUtil.updateNameEditors(taxa);
-//        ((TaxonNameEditorE4)EventUtility.getTaxonEditor()).getConversationHolder().commit();
-
 
                return postExecute(null);
        }
index 74d6307f1abf75015847762e522301cd84f63539..cddc7c952b9fd99302612ae45612996894d761c3 100755 (executable)
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -168,12 +168,12 @@ public class NameEditorMenuPropertyTester extends PropertyTester {
         * @return
         */
        public static boolean hasEmptyNames(Object receiver) {
-               TaxonNameEditorE4 editor = (TaxonNameEditorE4) EventUtility.getTaxonEditor();
+               TaxonEditor editor = (TaxonEditor) EventUtility.getTaxonEditor();
                return editor == null ? false : editor.checkForEmptyNames();
        }
 
        public static boolean isRelatedConcept(Object selectedElement) {
-               if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isRelatedConcept() && !((TaxonNameEditorE4) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
+               if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isRelatedConcept() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
                        return true;
                }
                return false;
@@ -184,14 +184,14 @@ public class NameEditorMenuPropertyTester extends PropertyTester {
        }
 
        public static boolean isMisapplication(Object selectedElement) {
-               if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isMisapplication() && !((TaxonNameEditorE4) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
+               if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isMisapplication() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
                        return true;
                }
                return false;
        }
 
        public static boolean isProparteSynonym(Object selectedElement) {
-        if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isProparteSynonym() && !((TaxonNameEditorE4) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
+        if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isProparteSynonym() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
             return true;
         }
         return false;
@@ -200,7 +200,7 @@ public class NameEditorMenuPropertyTester extends PropertyTester {
            if (selectedElement instanceof Synonym){
                return true;
            }
-        if(((Taxon) selectedElement).isProparteSynonym() && !((TaxonNameEditorE4) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
+        if(((Taxon) selectedElement).isProparteSynonym() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
             return false;
         }
         return true;
@@ -214,7 +214,7 @@ public class NameEditorMenuPropertyTester extends PropertyTester {
     }
 
        public static boolean isAccepted(Object selectedElement) {
-           TaxonNameEditorE4 editor = (TaxonNameEditorE4) EventUtility.getTaxonEditor();
+           TaxonEditor editor = (TaxonEditor) EventUtility.getTaxonEditor();
            Taxon accepted = editor.getTaxon();
                return (selectedElement instanceof Taxon  && accepted.equals(selectedElement)) ? true : false;
        }
index 24675aa196303d202665286f50e38e446dbb219e..baa02c5fd7d1bfbbae3ad3b3248fd2244e0714bc 100644 (file)
@@ -89,11 +89,11 @@ public class ChangeHomotypicGroupOperation extends AbstractPostTaxonOperation {
                newHomotypicalGroup = HibernateProxyHelper.deproxy(newHomotypicalGroup, HomotypicalGroup.class);
                newHomotypicalGroup.addTypifiedName(synonymName);
 
-               
 
-               SynonymType type = SynonymType.HETEROTYPIC_SYNONYM_OF();
+
+               SynonymType type = SynonymType.HETEROTYPIC_SYNONYM_OF;
                if(newHomotypicalGroup.getTypifiedNames().contains(element.getName())){
-                       type = SynonymType.HOMOTYPIC_SYNONYM_OF();
+                       type = SynonymType.HOMOTYPIC_SYNONYM_OF;
                }
 
                element.addSynonym(synonym, type);
index fe5bc189f79dc154ff3e68d4bfdc13ffde63b242..16e75794645ca96a06cdc3c8dd9452c301a5d1c2 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
@@ -59,7 +58,6 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
         * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
         * @param synonymsInHomotypicalGroup an array of {@link eu.etaxonomy.cdm.model.taxon.Synonym} objects.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public ChangeSynonymToAcceptedTaxonOperation(String label,
                IUndoContext undoContext,
@@ -68,10 +66,9 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                        Synonym synonym,
                        UUID newSecUuid,
                SecReferenceHandlingEnum secHandling,
-                       IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
+                       IPostOperationEnabled postOperationEnabled,                     
                        ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
 
                this.element = taxon;
                this.parentNode = parentNode;
index c3841cd9b3499c20508ad72096ce7a8d432acdf1..bf5a8ab283dac287d36c5fe69dddb1892f42898e 100644 (file)
@@ -27,8 +27,6 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>ChangeSynonymToMisapplicationOperation class.</p>
- *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 14.01.2009
@@ -39,15 +37,6 @@ public class ChangeSynonymToMisapplicationOperation extends AbstractPostTaxonOpe
        private Taxon misapplication;
        private Set<SynonymType> synonymTypes;
 
-       /**
-        * <p>Constructor for ChangeSynonymToMisapplicationOperation.</p>
-        *
-        * @param label a {@link java.lang.String} object.
-        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
-        * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
-        * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
-        * @param editor a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        */
        public ChangeSynonymToMisapplicationOperation(String label,
                        IUndoContext undoContext, Taxon taxon, Synonym synonym, IPostOperationEnabled editor) {
                super(label, undoContext, taxon, editor);
index daa6b89dc70c1e6a5e5656a27d946597a0599b53..f8b9021c16b07218ab65f983890bdb046cd5eb7f 100755 (executable)
@@ -16,7 +16,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -38,10 +38,10 @@ public abstract class CreateNewTaxonBaseOperation extends AbstractPostTaxonOpera
     }
 
     protected void addToSaveList(CdmBase newCdmBase) {
-        TaxonNameEditorE4 editor = null;
+        TaxonEditor editor = null;
         Object activePart = AbstractUtility.getActivePart();
-        if (activePart instanceof TaxonNameEditorE4){
-           editor = (TaxonNameEditorE4) activePart;
+        if (activePart instanceof TaxonEditor){
+           editor = (TaxonEditor) activePart;
            if (newCdmBase instanceof Synonym){
                editor.getEditorInput().addToSaveNewSynonym((Synonym)newCdmBase);
            }else if (newCdmBase instanceof Taxon ){
index 5c09f47972fd2cf333a835f1da688bb3bb43b69c..bbc5dd7c16b17d625199678e611904a5ae6ccfe0 100644 (file)
@@ -60,7 +60,7 @@ public class CreateSynonymInExistingHomotypicalGroupOperation extends
 
                // Add name to given homotypic group
 
-//         HomotypicalSynonymGroupE4 groupContainer = ((TaxonNameEditorE4)postOperationEnabled).getHomotypicalGroupContainer(group);
+//         HomotypicalSynonymGroupE4 groupContainer = ((TaxonEditor)postOperationEnabled).getHomotypicalGroupContainer(group);
                group.addTypifiedName(newSynonymName);
 //         groupContainer.add(groupedContainer);
                monitor.worked(20);
@@ -73,10 +73,10 @@ public class CreateSynonymInExistingHomotypicalGroupOperation extends
                        synonym = element.addHeterotypicSynonymName(newSynonymName);
                }
                for (HybridRelationship rel : newSynonymName.getHybridChildRelations()){
-            if (!rel.getHybridName().isPersited()) {
+            if (!rel.getHybridName().isPersisted()) {
                 addToSaveList(rel.getHybridName());
             }
-            if (!rel.getParentName().isPersited()) {
+            if (!rel.getParentName().isPersisted()) {
                 addToSaveList(rel.getParentName());
             }
         }
index 71049fa7d86da8bc96f1e474f5ac8801ce5d4538..22ba75a730e8a89c97d2537a76cdd30bdb8eb4e1 100644 (file)
@@ -65,10 +65,10 @@ public class CreateSynonymInNewGroupOperation extends CreateNewTaxonBaseOperatio
                HibernateProxyHelper.deproxy(element);
                newSynonym = element.addHeterotypicSynonymName(newSynonymName);
                for (HybridRelationship rel : newSynonymName.getHybridChildRelations()){
-            if (!rel.getHybridName().isPersited()) {
+            if (!rel.getHybridName().isPersisted()) {
                 addToSaveList(rel.getHybridName());
             }
-            if (!rel.getParentName().isPersited()) {
+            if (!rel.getParentName().isPersisted()) {
                 addToSaveList(rel.getParentName());
             }
         }
index 942abb4597397da40f5b142fa42468e638124b81..df39092fdf676375c57feb636c16f8080d82b1f6 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
@@ -51,9 +50,9 @@ public class DeleteMisapplicationOperation extends DeleteTaxonBaseOperation {
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         */
        public DeleteMisapplicationOperation(String label, IUndoContext undoContext, TaxonBaseDeletionConfigurator configurator,
-            Taxon taxon, Taxon misapplication, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled,ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               //super(label, undoContext, taxon, postOperationEnabled);
-           super(label, undoContext, configurator, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+            Taxon taxon, Taxon misapplication, IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+
+           super(label, undoContext, configurator, postOperationEnabled, cdmEntitySessionEnabled);
                this.misapplication = misapplication;
                this.element = taxon;
        }
index 662820d042d8b05d5ea055ab874ed2c9b76c61ff..3e6be8751a910e79323aaa574d05d6362a8189af 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
@@ -50,8 +49,8 @@ public class DeleteSynonymOperation extends DeleteTaxonBaseOperation {
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         */
        public DeleteSynonymOperation(String label, IUndoContext undoContext, TaxonBaseDeletionConfigurator configurator,
-                       Taxon taxon, Synonym synonym, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled,ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, configurator, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+                       Taxon taxon, Synonym synonym, IPostOperationEnabled postOperationEnabled,  ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, configurator, postOperationEnabled, cdmEntitySessionEnabled);
                this.synonym = synonym;
                this.element = taxon;
        }
index 997a5b45f86a0f3489b112a43383ae0f143e9886..fa585c7787a585afd6c27870a1942e7ed52665ef 100644 (file)
@@ -6,7 +6,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
 import eu.etaxonomy.cdm.api.service.DeleteResult;\r
 import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;\r
@@ -22,9 +21,8 @@ public class DeleteTaxonBaseOperation extends AbstractPersistentPostOperation {
                IUndoContext undoContext,\r
                TaxonBaseDeletionConfigurator configurator,\r
                IPostOperationEnabled postOperationEnabled,\r
-               IConversationEnabled conversationEnabled,\r
                ICdmEntitySessionEnabled cdmEntitySessionEnabled) {\r
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);\r
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);\r
                this.configurator = configurator;\r
 \r
        }\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorComparator.java
deleted file mode 100755 (executable)
index e65ac19..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.view.checklist;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-
-/**
- * @author a.oppermann
- * @created 30.04.2014
- */
-public class ChecklistEditorComparator extends ViewerComparator {
-
-       private int propertyIndex;
-       private static final int ASCENDING = 0;
-       private static final int DESCENDING = 1;
-       private int direction = ASCENDING;
-
-       public ChecklistEditorComparator() {
-               this.propertyIndex = 1;
-               direction = ASCENDING;
-       }
-
-       public void setColumn(int column) {
-               if (column == this.propertyIndex) {
-                       // Same column as last sort; toggle the direction
-                       direction = 1 - direction;
-               } else {
-                       // New column; do an ascending sort
-                       this.propertyIndex = column;
-                       direction = DESCENDING;
-               }
-       }
-
-       @Override
-       public int compare(Viewer viewer, Object e1, Object e2) {
-         Taxon d1 = (Taxon) e1;
-         Taxon d2 = (Taxon) e2;
-
-               int result = 0;
-
-               switch (propertyIndex) {
-
-                       default:
-                               result = d1.getTitleCache().compareTo(d2.getTitleCache());
-               }
-
-               // If descending order, flip the direction
-               if (direction == DESCENDING) {
-                       result = -result;
-               }
-               return result;
-       }
-}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java
deleted file mode 100644 (file)
index 32aa577..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
-* 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.editor.view.checklist;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.UUID;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistable;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * @author a.oppermann
- * @date 25.04.2014
- */
-public class ChecklistEditorInput extends CdmEntitySessionInput<TaxonNode> implements IPersistable {
-
-    /**
-     * The selected classification
-     */
-    private TaxonNode taxonNode = null;
-
-    private List<TaxonBase> taxa = new ArrayList<>();
-
-    private Classification classification = null;
-
-    private final ConversationHolder conversation;
-
-    private List<TaxonBase> taxaToSave = new ArrayList<>();
-
-
-    /**
-     * Creates an editor input for the {@link ChecklistView} with the currently selected TaxonNode
-     * and its childNodes.
-     * @param taxonNode
-     */
-    public ChecklistEditorInput(TaxonNode taxonNode){
-        super(false);
-        this.conversation = CdmStore.createConversation();
-        initSession();
-        this.taxonNode =CdmStore.getService(ITaxonNodeService.class).load(taxonNode.getUuid(), getTaxonNodePropertyPaths());
-        getChildTaxa(taxonNode);
-        classification = taxonNode.getClassification();
-
-    }
-
-    private void getChildTaxa(TaxonNode taxonNode2) {
-//       taxonNode2.removeNullValueFromChildren();
-       if (taxonNode2.hasChildNodes()){
-           for (TaxonNode node: taxonNode2.getChildNodes()){
-                  node = CdmStore.getService(ITaxonNodeService.class).load(node.getUuid(), getTaxonNodePropertyPaths());
-               taxa.add(HibernateProxyHelper.deproxy(node.getTaxon(), Taxon.class));
-               getChildTaxa(node);
-           }
-       }
-    }
-
-    /**
-     * Creates an editor input for the {@link ChecklistView} with the currently selected classification.
-     * @param classificationUuid
-     */
-    public ChecklistEditorInput(Classification classification) {
-        super(true);
-        this.conversation = CdmStore.createConversation();
-        initSession();
-        this.classification = CdmStore.getCurrentApplicationConfiguration().getClassificationService().load(classification.getUuid());
-        getChildTaxa(classification.getRootNode());
-
-    }
-
-    public List<TaxonBase> getTaxa() {
-               return taxa;
-       }
-
-    public String getName() {
-        if(taxonNode != null && taxonNode.getTaxon()!=null){
-            return taxonNode.getTaxon().getName().getTitleCache();
-        }else{
-            return classification.getTitleCache();
-        }
-    }
-
-    public TaxonNode getTaxonNode() {
-        return taxonNode;
-    }
-
-    public Classification getClassification(){
-       return classification;
-    }
-
-//    public ConversationHolder getConversationHolder() {
-//        return conversationHolder;
-//    }
-
-//    @Override
-//    public int hashCode() {
-//        final int prime = 31;
-//        int result = 1;
-//        result = prime * result + ((classification == null) ? 0 : classification.hashCode());
-//        result = prime * result + ((taxonNode == null) ? 0 : taxonNode.hashCode());
-//        return result;
-//    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        ChecklistEditorInput other = (ChecklistEditorInput) obj;
-        if (classification == null) {
-            if (other.classification != null) {
-                return false;
-            }
-        } else if (!classification.equals(other.classification)) {
-            return false;
-        }
-        if (taxonNode == null) {
-            if (other.taxonNode != null) {
-                return false;
-            }
-        } else if (!taxonNode.equals(other.taxonNode)) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public void saveState(IMemento memento) {
-        UUID uuid = classification.getUuid();
-    }
-
-    @Override
-    public void merge() {
-        if (!getCdmEntitySession().isActive()){
-            getCdmEntitySession().bind();
-        }
-        CdmStore.getService(ITaxonService.class).merge(taxaToSave, true);
-    }
-
-    @Override
-    public List<TaxonNode> getRootEntities() {
-        return Arrays.asList(taxonNode);
-    }
-
-    public ConversationHolder getConversation() {
-        return conversation;
-    }
-
-    private List<String> getTaxonNodePropertyPaths() {
-        List<String> taxonNodePropertyPaths = new ArrayList<String>();
-        for(String propertyPath : getTaxonBasePropertyPaths()) {
-            taxonNodePropertyPaths.add("taxon." + propertyPath); //$NON-NLS-1$
-        }
-        return taxonNodePropertyPaths;
-    }
-
-    private List<String> getTaxonBasePropertyPaths() {
-        List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
-                "sec", //$NON-NLS-1$
-                "rights", //$NON-NLS-1$
-                "sources", //$NON-NLS-1$
-                "descriptions", //$NON-NLS-1$
-                "descriptions.descriptionElements.feature", //$NON-NLS-1$
-                "descriptions.descriptionElements.area", //$NON-NLS-1$
-                "descriptions.descriptionElements.status", //$NON-NLS-1$
-                "descriptions.markers", //$NON-NLS-1$
-
-        });
-
-        return taxonBasePropertyPaths;
-    }
-
-       public void setTaxa(List<TaxonBase> taxonList) {
-               this.taxa = taxonList;
-
-       }
-
-    /**
-     * @param element
-     */
-    public void addTaxonToSave(Taxon element) {
-        this.taxaToSave.add(element);
-
-    }
-
-//    @Override
-//    public void dispose(){
-//     conversation.unbind();
-//     conversation.close();
-//     getCdmEntitySession().dispose();
-//     super.dispose();
-//    }
-
-}
\ No newline at end of file
index 79e86e20e808a0096952a2ca7b28d7663c605d45..e67d890b9c35a144a65fda337985bf097616a2d5 100755 (executable)
@@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.editor.view.checklist.e4;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -23,8 +24,10 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.metadata.DistributionDescription;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * @author k.luther
@@ -129,18 +132,37 @@ public class DistributionColumnAccessor implements IColumnPropertyAccessor<Taxon
                     }
                     dist = Distribution.NewInstance(area, ((StatusHelper)newValue).term);
                     Set<TaxonDescription> descs = taxonWrapper.getDescriptionsWrapper().getDescriptions();
-                    TaxonDescription desc;
+                    TaxonDescription desc = null;
                     if (descs.size() >= 1){
-                        desc = descs.iterator().next();
+                        Iterator<TaxonDescription> itDesc = descs.iterator();
+                        while(itDesc.hasNext()) {
+                            TaxonDescription next = itDesc.next();
+                            if (next.isDefault()) {
+                                desc = next;
+                                break;
+                            }
+                        }
+
+                        if (desc == null) {
+                            if (PreferencesUtil.getDescriptionForChecklistEditor().equals(DistributionDescription.AlwaysDefault)){
+                                desc = TaxonDescription.NewInstance();
+                                desc.setDefault(true);
+                                taxonWrapper.getDescriptionsWrapper().getDescriptions().add(desc);
+                            }else {
+                                desc = descs.iterator().next();
+                            }
+                        }
                     }else {
                         desc = TaxonDescription.NewInstance();
+                        desc.setDefault(true);
+
                         taxonWrapper.getDescriptionsWrapper().getDescriptions().add(desc);
                     }
                     if (editor.getDefaultSource() != null){
                       dist.addSource(DescriptionElementSource.NewPrimarySourceInstance(editor.getDefaultSource(), null));
                     }
                     desc.addElement(dist);
-                    if(desc.isPersited()){
+                    if(desc.isPersisted()){
                         editor.part.getCdmEntitySession().load(desc, true);
                     }
                     distributions.add(dist);
index bcac01e520962f06774b737d386eec32c2895343..00118a0e66075b7b1d9356aee6d4603d36b697cc 100755 (executable)
@@ -19,9 +19,11 @@ import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.UUID;
+import java.util.stream.Collectors;
 
 import org.apache.commons.collections4.map.LinkedMap;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.layout.GridLayoutFactory;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -70,7 +72,8 @@ import org.eclipse.swt.widgets.Text;
 
 import ca.odell.glazedlists.BasicEventList;
 import ca.odell.glazedlists.EventList;
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
+import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.dto.TaxonDescriptionDTO;
 import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO;
 import eu.etaxonomy.cdm.compare.term.OrderedTermComparator;
@@ -87,10 +90,11 @@ import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.TermOrder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
-import eu.etaxonomy.cdm.model.term.OrderedTermBase;
 import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -105,10 +109,10 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.ReferenceSelectionDialog;
  * @author k.luther
  * @since 27.11.2018
  */
-public class DistributionEditor extends Composite implements IDistributionEditor{
+public class DistributionEditor extends Composite implements IDistributionEditor {
 
     @SuppressWarnings("unused")
-    private static final Logger logger = LogManager.getLogger(DistributionEditor.class);
+    private static final Logger logger = LogManager.getLogger();
 
     private static final String DISTRIBUTION_EDITOR = "Distribution Editor"; //$NON-NLS-1$
     private static final String LOADING_TAXA = Messages.ChecklistEditor_LOAD_TAXA;
@@ -120,13 +124,12 @@ public class DistributionEditor extends Composite implements IDistributionEditor
     static final String RANK_COLUMN = "collector_column";//$NON-NLS-1$
     static final String SYNONYM_COLUMN = "synonym_column";//$NON-NLS-1$
 
-
     private NatTable natTable;
     private Label statusLabel;
     private Label statusLabelSourceReference;
     private Reference defaultSource;
 
-    private Map<Integer, NamedArea> areaToColumnIndexMap= new HashMap<>();
+    private Map<Integer, NamedArea> areaToColumnIndexMap = new HashMap<>();
     private int firstDataColumnIndex;
 
     private ListDataProvider<TaxonDistributionDTO> bodyDataProvider;
@@ -140,7 +143,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
 
     protected EventList<TaxonDistributionDTO> taxonList;
     private String actualNameCache;
-    protected Map<UUID,Map<NamedArea,Set<DescriptionElementBase>>> taxonDistributionMap = new HashMap<>();
+    protected Map<UUID, Map<NamedArea, Set<DescriptionElementBase>>> taxonDistributionMap = new HashMap<>();
 
     protected List<TaxonDistributionDTO> descriptionsToSave = new ArrayList<>();
 
@@ -230,7 +233,6 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         composite.setLayoutData(gridData);
         composite.setLayout(gridLayout);
 
-
         gridData = new GridData();
         gridData.horizontalSpan = 1;
         gridData.grabExcessHorizontalSpace = true;
@@ -244,16 +246,18 @@ public class DistributionEditor extends Composite implements IDistributionEditor
 
         statusLabelSourceReference.setLayoutData(gridData);
 
-        if (defaultSource != null){
-            statusLabelSourceReference.setText(Messages.DistributionEditor_defaultSource + (defaultSource.getAbbrevTitle() != null? defaultSource.getAbbrevTitle() : defaultSource.getAbbrevTitleCache()));
+        if (defaultSource != null) {
+            statusLabelSourceReference.setText(Messages.DistributionEditor_defaultSource
+                    + (defaultSource.getAbbrevTitle() != null ? defaultSource.getAbbrevTitle()
+                            : defaultSource.getAbbrevTitleCache()));
         }
 
-        button3 = new Button(composite, SWT.PUSH );
+        button3 = new Button(composite, SWT.PUSH);
         button3.setEnabled(false);
         GridData gridData3 = new GridData();
         gridData3.horizontalAlignment = SWT.RIGHT;
         button3.setLayoutData(gridData3);
-        //button3.setText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE);
+        // button3.setText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE);
         button3.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
         button3.setToolTipText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE_TOOLTIP);
         button3.addSelectionListener(new SelectionAdapter() {
@@ -262,8 +266,9 @@ public class DistributionEditor extends Composite implements IDistributionEditor
             public void widgetSelected(SelectionEvent event) {
                 defaultSource = null;
 
-                String defaultSourceStr = (defaultSource == null) ? "" : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache(); //$NON-NLS-1$
-                if (defaultSourceStr.length()> 100){
+                String defaultSourceStr = (defaultSource == null) ? "" //$NON-NLS-1$
+                        : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache();
+                if (defaultSourceStr.length() > 100) {
                     defaultSourceStr = defaultSourceStr.substring(0, 98) + "..."; //$NON-NLS-1$
                 }
                 statusLabelSourceReference.setText(defaultSourceStr);
@@ -276,10 +281,10 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         });
     }
 
-    private void applyStyles(){
+    private void applyStyles() {
         CdmModernNatTableThemeConfiguration configuration = new CdmModernNatTableThemeConfiguration();
 
-//        configuration.summaryRowHAlign = HorizontalAlignmentEnum.CENTER;
+        // configuration.summaryRowHAlign = HorizontalAlignmentEnum.CENTER;
         // NOTE: Getting the colors and fonts from the GUIHelper ensures that
         // they are disposed properly (required by SWT)
         configuration.cHeaderBgColor = GUIHelper.getColor(211, 211, 211);
@@ -287,17 +292,16 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         natTable.addConfiguration(configuration);
     }
 
-    private void configureNatTable(ConfigRegistry configRegistry,
-            AbstractLayer topMostLayer) {
+    private void configureNatTable(ConfigRegistry configRegistry, AbstractLayer topMostLayer) {
         /**
          * CONFIGURATION
          */
         natTable.setConfigRegistry(configRegistry);
 
-        //add default configuration because autoconfigure is set to false in constructor
+        // add default configuration because autoconfigure is set to false in
+        // constructor
         natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
 
-
         natTable.addConfiguration(new DefaultColumnHeaderStyleConfiguration() {
             {
                 TextPainter painter = new TextPainter();
@@ -308,7 +312,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
 
             }
         });
-//        applyStyles();
+        // applyStyles();
         // override the default sort configuration and change the mouse bindings
         // to sort on a single click
 
@@ -319,14 +323,15 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         // with hide/show actions
         natTable.addConfiguration(new DistributionEditorHeaderMenuConfiguration(natTable));
 
-        // add custom configuration for data conversion and add column labels to viewport layer
+        // add custom configuration for data conversion and add column labels to
+        // viewport layer
         topMostLayer.addConfiguration(new DistributionCellEditorDataConversionConfiguration(this));
 
         applyStyles();
         natTable.configure();
     }
 
-    public void createTable(){
+    public void createTable() {
         /**
          * layers
          */
@@ -335,7 +340,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         /**
          * configuration
          */
-        configureNatTable( configRegistry, topMostLayer);
+        configureNatTable(configRegistry, topMostLayer);
 
         /**
          * handlers and listeners
@@ -344,12 +349,13 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         FreezeHelper.freeze(freezeLayer, bodyLayerStack.getViewPortLayer(),
                 new PositionCoordinate(bodyLayerStack.getViewPortLayer(), 0, 0),
                 new PositionCoordinate(bodyLayerStack.getViewPortLayer(), 0, -1));
-        //grab all space
+        // grab all space
         GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
 
         this.layout();
         natTable.doCommand(new ClientAreaResizeCommand(natTable));
-      //  boolean ok = natTable.doCommand(new ClientAreaResizeCommand(natTable));
+        // boolean ok = natTable.doCommand(new
+        // ClientAreaResizeCommand(natTable));
     }
 
     private void createLayers() {
@@ -357,15 +363,17 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         DistributionColumnAccessor columnPropertyAccessor = new DistributionColumnAccessor(this);
         DistributionEditorConfigLabelAccumulator labelAccumulator = new DistributionEditorConfigLabelAccumulator(this);
 
-//        bodyLayerStack = new BodyLayerStack<>(taxonList, columnPropertyAccessor, new TaxonDistributionDtoComparator(), labelAccumulator);
+        // bodyLayerStack = new BodyLayerStack<>(taxonList,
+        // columnPropertyAccessor, new TaxonDistributionDtoComparator(),
+        // labelAccumulator);
         bodyLayerStack = new BodyLayerStack<>(taxonList, columnPropertyAccessor, null, labelAccumulator);
         bodyDataProvider = bodyLayerStack.getBodyDataProvider();
 
         propertyToLabelMap.put(TAXON_COLUMN, Messages.ChecklistEditor_TAXON);
-        if (isShowRank){
+        if (isShowRank) {
             propertyToLabelMap.put(RANK_COLUMN, Messages.ChecklistEditor_RANK);
             propertyToLabelMap.put(SYNONYM_COLUMN, Messages.ChecklistEditor_SYNONYMS);
-        }else{
+        } else {
             propertyToLabelMap.put(SYNONYM_COLUMN, Messages.ChecklistEditor_SYNONYMS);
         }
         configRegistry = new ConfigRegistry();
@@ -374,56 +382,37 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         this.selectionLayer = bodyLayerStack.getSelectionLayer();
 
         freezeLayer = new FreezeLayer(selectionLayer);
-        final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(
-                freezeLayer,  bodyLayerStack.getViewPortLayer(), selectionLayer);
+        final CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer,
+                bodyLayerStack.getViewPortLayer(), selectionLayer);
 
         // as the selection mouse bindings are registered for the region label
         // GridRegion.BODY
-        // we need to set that region label to the viewport so the selection via mouse
+        // we need to set that region label to the viewport so the selection via
+        // mouse
         // is working correctly
         compositeFreezeLayer.setRegionName(GridRegion.BODY);
 
-        IDataProvider columnHeaderDataProvider =
-                new DefaultColumnHeaderDataProvider(propertyToLabelMap.values().toArray(new String[] {}), propertyToLabelMap);
+        IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(
+                propertyToLabelMap.values().toArray(new String[] {}), propertyToLabelMap);
         DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider);
-        ILayer columnHeaderLayer = new ColumnHeaderLayer(
-            columnHeaderDataLayer,
-            compositeFreezeLayer,
-            selectionLayer);
-
-        FilterRowHeaderComposite<TaxonDistributionDTO> filterRowHeaderLayer =
-                new FilterRowHeaderComposite<>(
-                        new DefaultGlazedListsFilterStrategy<>(
-                                bodyLayerStack.getFilterList(),
-                                columnPropertyAccessor,
-                                configRegistry),
-                        columnHeaderLayer,
-                        columnHeaderDataLayer.getDataProvider(),
-                        configRegistry);
-
-     // build the row header layer stack
+        ILayer columnHeaderLayer = new ColumnHeaderLayer(columnHeaderDataLayer, compositeFreezeLayer, selectionLayer);
+
+        FilterRowHeaderComposite<TaxonDistributionDTO> filterRowHeaderLayer = new FilterRowHeaderComposite<>(
+                new DefaultGlazedListsFilterStrategy<>(bodyLayerStack.getFilterList(), columnPropertyAccessor,
+                        configRegistry),
+                columnHeaderLayer, columnHeaderDataLayer.getDataProvider(), configRegistry);
+
+        // build the row header layer stack
         IDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(bodyDataProvider);
         DataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
-        ILayer rowHeaderLayer = new RowHeaderLayer(
-            rowHeaderDataLayer,
-            compositeFreezeLayer,
-            selectionLayer);
-
-        IDataProvider cornerDataProvider =
-                new DefaultCornerDataProvider(
-                    columnHeaderDataProvider,
-                    rowHeaderDataProvider);
+        ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, compositeFreezeLayer, selectionLayer);
+
+        IDataProvider cornerDataProvider = new DefaultCornerDataProvider(columnHeaderDataProvider,
+                rowHeaderDataProvider);
         DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
-        ILayer cornerLayer = new CornerLayer(
-            cornerDataLayer,
-            rowHeaderLayer,
-            filterRowHeaderLayer);
+        ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, filterRowHeaderLayer);
 
-        GridLayer gridLayer = new GridLayer(
-                compositeFreezeLayer,
-                filterRowHeaderLayer,
-                rowHeaderLayer,
-                cornerLayer);
+        GridLayer gridLayer = new GridLayer(compositeFreezeLayer, filterRowHeaderLayer, rowHeaderLayer, cornerLayer);
 
         natTable.setLayer(gridLayer);
         topMostLayer = compositeFreezeLayer;
@@ -431,7 +420,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
 
     private Text createSearchBar(Composite parent) {
 
-        Button button1 = new Button(parent, SWT.PUSH );
+        Button button1 = new Button(parent, SWT.PUSH);
         GridData gridData2 = new GridData();
         gridData2.horizontalSpan = 1;
         gridData2.horizontalAlignment = SWT.RIGHT;
@@ -444,17 +433,16 @@ public class DistributionEditor extends Composite implements IDistributionEditor
             @Override
             public void widgetSelected(SelectionEvent event) {
                 AvailableDistributionWizard availableDistributionWizard = new AvailableDistributionWizard();
-                WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(),
-                        availableDistributionWizard);
+                WizardDialog dialog = new WizardDialog(AbstractUtility.getShell(), availableDistributionWizard);
 
                 int open = dialog.open();
-                if(open == 0){
+                if (open == 0) {
                     reload();
                 }
             }
         });
 
-        button2 = new Button(parent, SWT.PUSH );
+        button2 = new Button(parent, SWT.PUSH);
         GridData gridData3 = new GridData();
         gridData3.horizontalAlignment = SWT.RIGHT;
 
@@ -468,14 +456,16 @@ public class DistributionEditor extends Composite implements IDistributionEditor
             public void widgetSelected(SelectionEvent event) {
                 defaultSource = ReferenceSelectionDialog.select(AbstractUtility.getShell(), null);
 
-                String defaultSourceStr = (defaultSource == null) ? "" : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache(); //$NON-NLS-1$
-                if (defaultSourceStr.length()> 100){
+                String defaultSourceStr = (defaultSource == null) ? "" //$NON-NLS-1$
+                        : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache();
+                if (defaultSourceStr.length() > 100) {
                     defaultSourceStr = defaultSourceStr.substring(0, 98) + "..."; //$NON-NLS-1$
                 }
                 statusLabelSourceReference.setText(defaultSourceStr);
 
                 button2.setBackground(AbstractUtility.getColor(Resources.COLOR_CONTROL_SELECTED));
-//                EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+                // EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS,
+                // true);
                 button3.setEnabled(true);
                 button2.setText(Messages.ChecklistEditor_SWITCH_DEFAULT_SOURCE);
             }
@@ -484,19 +474,22 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         parent.pack();
         return searchText;
     }
+
     /**
-    * This method should only be called for adding new Distribution columns and reloading the table.<br>
-    * It will hide the old distribution column and load the newly added columns.<br>
-    * <p>
-    * <b>Notice:</b> for data update please use <b>refresh()</b>
-    *
-    */
-   public void reload(){
-       this.areaToColumnIndexMap.clear();
-       this.areas.clear();
-       this.propertyToLabelMap.clear();
-       createTable();
-       natTable.redraw();
+     * This method should only be called for adding new Distribution columns and
+     * reloading the table.<br>
+     * It will hide the old distribution column and load the newly added
+     * columns.<br>
+     * <p>
+     * <b>Notice:</b> for data update please use <b>refresh()</b>
+     *
+     */
+    public void reload() {
+        this.areaToColumnIndexMap.clear();
+        this.areas.clear();
+        this.propertyToLabelMap.clear();
+        createTable();
+        natTable.redraw();
     }
 
     private void createTopComposite(Composite parent) {
@@ -511,38 +504,40 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         parent.setLayout(gridLayout);
         searchText = createSearchBar(parent);
 
-
     }
+
     public void loadDistributions(List<TaxonDistributionDTO> taxonList) {
-        if (this.taxonList == null){
+        if (this.taxonList == null) {
             this.taxonList = new BasicEventList<>();
         }
-       taxonList.stream().forEach(wrapper->DistributionEditor.this.taxonList.add(wrapper));
-       statusLabel.setText(ELEMENT_COUNT + taxonList.size());
-       createTaxonDistributionMap();
+        taxonList.stream().forEach(wrapper -> DistributionEditor.this.taxonList.add(wrapper));
+        statusLabel.setText(ELEMENT_COUNT + taxonList.size());
+        createTaxonDistributionMap();
     }
 
     protected void createTaxonDistributionMap() {
         Iterator<TaxonDistributionDTO> iterator = this.taxonList.iterator();
-        while (iterator.hasNext()){
+        while (iterator.hasNext()) {
             TaxonDistributionDTO dto = iterator.next();
             TaxonDescriptionDTO descriptionDto = dto.getDescriptionsWrapper();
-            for (TaxonDescription desc: descriptionDto.getDescriptions()){
-                if(this.part.getCdmEntitySession()!=null){
+            for (TaxonDescription desc : descriptionDto.getDescriptions()) {
+                if (this.part.getCdmEntitySession() != null) {
                     this.part.getCdmEntitySession().load(desc, true);
                 }
-                for (DescriptionElementBase descElement: desc.getElements()){
-                    if (descElement instanceof Distribution){
-                        Map<NamedArea, Set<DescriptionElementBase>> distributionsMap = taxonDistributionMap.get(dto.getTaxonUuid());
+                for (DescriptionElementBase descElement : desc.getElements()) {
+                    if (descElement instanceof Distribution) {
+                        Map<NamedArea, Set<DescriptionElementBase>> distributionsMap = taxonDistributionMap
+                                .get(dto.getTaxonUuid());
 
-                        if (distributionsMap == null){
+                        if (distributionsMap == null) {
                             distributionsMap = new HashMap<>();
                             taxonDistributionMap.put(dto.getTaxonUuid(), distributionsMap);
                         }
-                        Set<DescriptionElementBase> distributions = distributionsMap.get(((Distribution) descElement).getArea());
-                        if (distributions == null){
+                        Set<DescriptionElementBase> distributions = distributionsMap
+                                .get(((Distribution) descElement).getArea());
+                        if (distributions == null) {
                             distributions = new HashSet<>();
-                            distributionsMap.put(((Distribution)descElement).getArea(), distributions);
+                            distributionsMap.put(((Distribution) descElement).getArea(), distributions);
                         }
                         distributions.add(descElement);
                     }
@@ -554,57 +549,60 @@ public class DistributionEditor extends Composite implements IDistributionEditor
     private void initLabels() {
 
         int index = 2;
-        if (isShowRank){
+        if (isShowRank) {
             index++;
         }
 
         loadNamedAreas();
-        if (areas == null){
+        if (areas == null) {
             areas = new TreeSet<>();
         }
-        for (DefinedTermBase<?> area: areas) {
-            this.areaToColumnIndexMap.put(index++, (NamedArea)area);
+        for (DefinedTermBase<?> area : areas) {
+            this.areaToColumnIndexMap.put(index++, (NamedArea) area);
             String areaLabel;
-            //TODO: adapt to preference
+            // TODO: adapt to preference
             Representation rep = area.getPreferredRepresentation(CdmStore.getDefaultLanguage());
             String label = rep.getLabel();
-            if (label == null){
+            if (label == null) {
                 label = area.getTitleCache();
             }
-            if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
-                if (area.getIdInVocabulary() != null){
+            if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()) {
+                if (area.getIdInVocabulary() != null) {
                     areaLabel = area.getIdInVocabulary();
-                } else{
+                } else {
                     areaLabel = label;
                 }
-            }else if (PreferencesUtil.isShowSymbol1InChecklistEditor()){
-                if (area.getSymbol() != null){
+            } else if (PreferencesUtil.isShowSymbol1InChecklistEditor()) {
+                if (area.getSymbol() != null) {
                     areaLabel = area.getSymbol();
-                } else{
+                } else {
                     areaLabel = label;
                 }
-            }else if (PreferencesUtil.isShowSymbol2InChecklistEditor()){
-                if (area.getSymbol2() != null){
+            } else if (PreferencesUtil.isShowSymbol2InChecklistEditor()) {
+                if (area.getSymbol2() != null) {
                     areaLabel = area.getSymbol2();
-                } else{
+                } else {
                     areaLabel = label;
                 }
-            }else{
+            } else {
                 areaLabel = label;
             }
 
-            //String areaLabel = area.getLabel();
+            // String areaLabel = area.getLabel();
             String property = area.getUuid().toString();
             propertyToLabelMap.put(property, areaLabel);
         }
     }
 
     private SortedSet<NamedArea> loadNamedAreas() {
-        //IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
-
-        String valuesAreas = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaTerms.getKey(), true);
-        String values = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
-        Set<UUID> uuidList = new HashSet<UUID>();
+        // IPreferenceStore preferenceStore =
+        // PreferencesUtil.getPreferenceStore();
+
+        String valuesAreas = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaTerms.getKey(),
+                true);
+        String values = PreferencesUtil
+                .getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+        List<UUID> uuidList = new ArrayList<UUID>();
         String[] split;
         List<String> listValue;
         List<NamedArea> termlist = new ArrayList<>();
@@ -613,53 +611,57 @@ public class DistributionEditor extends Composite implements IDistributionEditor
             listValue = Arrays.asList(split);
 
             UUID uuid;
-            for(String s : listValue){
+            for (String s : listValue) {
                 uuid = UUID.fromString(s);
                 uuidList.add(uuid);
             }
         }
 
-        List<TermVocabulary<NamedArea>> vocs = new ArrayList<>();
-        IVocabularyService service =  CdmStore.getService(IVocabularyService.class);
-        if (uuidList.isEmpty()){
-            List<TermVocabulary<NamedArea>> vocList = CdmStore.getService(IVocabularyService.class).findByTermType(TermType.NamedArea, null);
+        List<TermCollectionDto> vocs = new ArrayList<>();
+        ITermCollectionService service = CdmStore.getService(ITermCollectionService.class);
+        if (uuidList.isEmpty()) {
+            List<TermCollectionDto> vocList = service.findCollectionDtoByTermType(TermType.NamedArea);
             vocs.addAll(vocList);
-        }else{
-            vocs= (List)service.find(uuidList);
+        } else {
+            vocs = service.findTermCollectionDtoByUuids(uuidList);
         }
-        for (TermVocabulary<NamedArea> voc: vocs){
-            termlist.addAll((List)service.getTerms(voc, null, null, null, null).getRecords());
+        Set<UUID> termUuids = new HashSet<UUID>();
+
+        ITermService termService = CdmStore.getService(ITermService.class);
+        for (TermCollectionDto voc : vocs) {
+            termUuids.addAll(voc.getTerms().stream().map(TermDto::getUuid).collect(Collectors.toList()));
         }
+        termlist.addAll((List) termService.find(termUuids));
         List<NamedArea> filteredList = new ArrayList<>();
         if (valuesAreas != null && valuesAreas != "") {
             split = valuesAreas.split(";"); //$NON-NLS-1$
             listValue = Arrays.asList(split);
 
-            for (NamedArea area: termlist){
+            for (NamedArea area : termlist) {
                 if (listValue.contains(area.getUuid().toString())) {
                     filteredList.add(area);
                 }
             }
-        }else{
+        } else {
             filteredList.addAll(termlist);
         }
 
         TermOrder sortOrder = PreferencesUtil.getSortNamedAreasInDistributionEditor();
-        if (sortOrder.equals(TermOrder.Natural)){
-            areas =  getTermsOrderedByVocabularyOrder(filteredList);
-        } else if (sortOrder.equals(TermOrder.IdInVoc)){
+        if (sortOrder.equals(TermOrder.Natural)) {
+            areas = getTermsOrderedByVocabularyOrder(filteredList);
+        } else if (sortOrder.equals(TermOrder.IdInVoc)) {
             areas = getTermsOrderedByIdInVocabulary(filteredList);
-        }else{
-            areas =  getTermsOrderedByLabels(filteredList, CdmStore.getDefaultLanguage());
+        } else {
+            areas = getTermsOrderedByLabels(filteredList, CdmStore.getDefaultLanguage());
         }
 
         return null;
     }
 
-    public <T extends DefinedTermBase<T>> SortedSet<T> getTermsOrderedByLabels(List<T> listTerm,Language language){
+    public <T extends DefinedTermBase<T>> SortedSet<T> getTermsOrderedByLabels(List<T> listTerm, Language language) {
         TermLanguageComparator<T> comp = new TermLanguageComparator<>(Language.DEFAULT(), language);
         SortedSet<T> result = new TreeSet<>(comp);
-        if(listTerm != null){
+        if (listTerm != null) {
             result.addAll(listTerm);
         }
 
@@ -670,7 +672,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         TermIdInVocabularyComparator<T> comp = new TermIdInVocabularyComparator<>();
 
         SortedSet<T> result = new TreeSet<>(comp);
-        if(namedAreas != null){
+        if (namedAreas != null) {
             result.addAll(namedAreas);
         }
         return result;
@@ -680,7 +682,7 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         TermSymbol1Comparator<T> comp = new TermSymbol1Comparator<>();
 
         SortedSet<T> result = new TreeSet<>(comp);
-        if(namedAreas != null){
+        if (namedAreas != null) {
             result.addAll(namedAreas);
         }
         return result;
@@ -690,47 +692,48 @@ public class DistributionEditor extends Composite implements IDistributionEditor
         TermSymbol2Comparator<T> comp = new TermSymbol2Comparator<>();
 
         SortedSet<T> result = new TreeSet<>(comp);
-        if(namedAreas != null){
+        if (namedAreas != null) {
             result.addAll(namedAreas);
         }
         return result;
     }
 
-    public <T extends DefinedTermBase<T>> SortedSet<T> getTermsOrderedByVocabularyOrder(List<T> listAreas){
+    public <T extends DefinedTermBase<T>> SortedSet<T> getTermsOrderedByVocabularyOrder(List<T> listAreas) {
         OrderedTermComparator<T> comp = new OrderedTermComparator<>();
         boolean allOrderedTerms = true;
         List<TermVocabulary<T>> alreadyOrderIndexNull = new ArrayList<>();
-        for (T term: listAreas){
-            if (!(term instanceof OrderedTermBase)){
+        for (T term : listAreas) {
+            if (!(term.isOrderRelevant())) {
                 allOrderedTerms = false;
                 break;
-            }else if (((OrderedTermBase<?>)term).getOrderIndex() == 0){
-                if(alreadyOrderIndexNull.contains(term.getVocabulary())) {
+            } else if (term.getOrderIndex() == 0) {
+                // Note by AM: when does orderIndex == 0 happen?
+                if (alreadyOrderIndexNull.contains(term.getVocabulary())) {
                     allOrderedTerms = false;
                     break;
-                }else{
+                } else {
                     alreadyOrderIndexNull.add(term.getVocabulary());
                 }
             }
         }
-        if (allOrderedTerms){
+        if (allOrderedTerms) {
             SortedSet<T> result = new TreeSet<>(comp);
             result.addAll(listAreas);
             return result;
-        }else{
+        } else {
             return getTermsOrderedByLabels(listAreas, PreferencesUtil.getGlobalLanguage());
         }
     }
 
     private void registerHandlersAndListeners(AbstractLayer topMostLayer) {
-        //selection listener
+        // selection listener
         E4SelectionListener<?> selectionListener = new DistributionCellSelectionListener(part.getSelectionService(),
                 selectionLayer, bodyDataProvider, part);
         selectionLayer.addLayerListener(selectionListener);
         selectionListener.setFullySelectedRowsOnly(false);
 
-        //register handler for view configuration menu
-      //  natTable.registerCommandHandler(toolbar.getDisplayPersistenceDialogCommandHandler());
+        // register handler for view configuration menu
+        // natTable.registerCommandHandler(toolbar.getDisplayPersistenceDialogCommandHandler());
     }
 
     public IRowDataProvider<TaxonDistributionDTO> getBodyDataProvider() {
@@ -742,15 +745,15 @@ public class DistributionEditor extends Composite implements IDistributionEditor
     }
 
     @Override
-    public Reference getDefaultSource(){
+    public Reference getDefaultSource() {
         return defaultSource;
     }
 
-//    /**
-//     * @param result
-//     */
-//    public void reloadDistributions() {
-//       loadDistributions(taxonList);
-//
-//    }
+    // /**
+    // * @param result
+    // */
+    // public void reloadDistributions() {
+    // loadDistributions(taxonList);
+    //
+    // }
 }
\ No newline at end of file
index 86db330609de2321be655fe53dc88f3caa0ca6c0..fc075d02f79f94033c1aa433a448bb561f909d31 100755 (executable)
@@ -34,8 +34,6 @@ import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
 import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
@@ -48,7 +46,6 @@ import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.IDistributionEditorPart;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
@@ -66,7 +63,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @since 28.11.2018
  */
 public class DistributionEditorPart
-        implements IE4SavablePart, IConversationEnabled, IDirtyMarkable,
+        implements IE4SavablePart, IDirtyMarkable,
                        ICdmEntitySessionEnabled<DescriptionBase>, IPartContentHasSupplementalData,
                        IPartContentHasDetails, IDistributionEditorPart {
 
@@ -86,8 +83,6 @@ public class DistributionEditorPart
 
     private Collection<Taxon> rootEntities;
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     @Inject
@@ -111,9 +106,6 @@ public class DistributionEditorPart
 
     @PostConstruct
     public void create(Composite parent, IEclipseContext context) {
-        if(CdmStore.isActive() && conversation==null){
-            conversation = CdmStore.createConversation();
-        }
         if(cdmEntitySession == null){
             cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
         }
@@ -147,7 +139,7 @@ public class DistributionEditorPart
         }else {
             sortMode = TaxonNodeSortMode.RankAndAlphabeticalOrder;
         }
-        this.taxonList = CdmStore.getService(ITaxonNodeService.class).getTaxonDistributionDTO(nodeUuids, TAXONNODE_PROPERTY_PATH,null, true, sortMode);
+        this.taxonList = CdmStore.getService(ITaxonNodeService.class).getTaxonDistributionDTO(nodeUuids, TAXONNODE_PROPERTY_PATH,null, true, sortMode, PreferencesUtil.getDescriptionForChecklistEditor());
         // taxonList.stream().filter(taxonDistribution ->  CdmStore.currentAuthentiationHasPermission(taxonDistribution.getTaxonUuid(), RequiredPermissions.TAXONNODE_EDIT));
 
         if(taxonList!=null){
@@ -165,9 +157,6 @@ public class DistributionEditorPart
 
     @Focus
     public void setFocus(){
-        if(conversation!=null){
-            conversation.bind();
-        }
         if(cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
@@ -179,17 +168,10 @@ public class DistributionEditorPart
         return editor;
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-        // TODO Auto-generated method stub
-    }
+   
 
     @PreDestroy
     public void dispose(){
-        if (conversation != null) {
-            conversation.close();
-            conversation = null;
-        }
         if(cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
@@ -226,12 +208,7 @@ public class DistributionEditorPart
     public void forceDirty() {
         // TODO Auto-generated method stub
     }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
+    
     @Persist
     @Override
     public void save(IProgressMonitor monitor) {
@@ -251,6 +228,7 @@ public class DistributionEditorPart
                         taxon = (Taxon)CdmStore.getService(ITaxonService.class).load(dto.getTaxonUuid());
                     }
                     taxon.addDescription(desc);
+                    removeList.add(dto);
                 }
                 if (taxon != null){
                     MergeResult result = CdmStore.getService(ITaxonService.class).merge(taxon, true);
@@ -264,7 +242,7 @@ public class DistributionEditorPart
             cdmEntitySession.load(editor.getDefaultSource(), true);
         }
         editor.createTaxonDistributionMap();
-        conversation.commit();
+
         this.dirty.setDirty(false);
         editor.getDescriptionsToSave().clear();
     }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/listener/ChecklistModifyListener.java
deleted file mode 100644 (file)
index 0380ffa..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.view.checklist.listener;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Text;
-
-import eu.etaxonomy.taxeditor.editor.view.checklist.filter.ChecklistEditorFilter;
-
-/**
- * @author alex
- * @date 27.06.2014
- *
- */
-public class ChecklistModifyListener implements ModifyListener {
-
-    private final Text searchText;
-    private final Viewer editor;
-    private final ChecklistEditorFilter filter;
-
-    /**
-     *
-     */
-    public ChecklistModifyListener(Viewer editor, ChecklistEditorFilter filter, Text searchText) {
-        this.editor = editor;
-        this.filter = filter;
-        this.searchText = searchText;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
-     */
-    @Override
-    public void modifyText(ModifyEvent e) {
-        filter.setSearchText(searchText.getText());
-
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptRelationViewer.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptRelationViewer.java
new file mode 100644 (file)
index 0000000..dc05be2
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+* Copyright (C) 2022 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.editor.view.concept.e4;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+
+class ConceptRelationViewer extends ListViewer {
+
+    public ConceptRelationViewer(Composite parent) {
+               super(parent);
+       }
+
+       @Override
+       public ISelection getSelection() {
+               ISelection selection = super.getSelection();
+               List<TaxonRelationship> relationships = new ArrayList<>();
+               if(selection instanceof IStructuredSelection && !selection.isEmpty()){
+                   for(Iterator<?> iter = ((IStructuredSelection) selection).iterator();iter.hasNext();){
+                       Object object = iter.next();
+                       relationships.add(((Entry<TaxonRelationship, Taxon>)object).getKey());
+                   }
+                   return new StructuredSelection(relationships);
+               }
+               return selection;
+       }
+
+       @Override
+       public void setSelection(ISelection selection) {
+               super.setSelection(selection);
+       }
+}
\ No newline at end of file
index f34e38b6b37b9585daba5b4548d0482773ab9e98..083b0814024c925df31ceebb69b640a7a74ca82a 100644 (file)
@@ -6,28 +6,17 @@
 * 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.editor.view.concept.e4;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map.Entry;
-
 import javax.annotation.PostConstruct;
 
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 import org.eclipse.e4.ui.services.EMenuService;
-import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditorE4;
+import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.editor.view.concept.ConceptContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.concept.ConceptLabelProvider;
@@ -35,18 +24,16 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
 
 /**
- *
  * @author pplitzner
  * @date 21.08.2017
- *
  */
-public class ConceptViewPartE4 extends AbstractCdmEditorPartE4
-implements IPartContentHasDetails, IPartContentHasSupplementalData{
+public class ConceptViewPartE4 extends AbstractCdmEditorPart<ConceptRelationViewer>
+        implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
     @Override
     public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
@@ -56,7 +43,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
         if (!viewer.getControl().isDisposed()){
             viewer.getControl().setEnabled(true);
         }
-        Object partObject = createPartObject(activePart);
+        Object partObject = getPartObject(activePart);
         IStructuredSelection structuredSelection = createSelection(selection);
 
         if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4
@@ -65,7 +52,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
             // description selected in this view
             return;
         }
-               else if(partObject instanceof AbstractGraphKeyEditorE4){
+               else if(partObject instanceof AbstractGraphKeyEditor){
                        showEmptyPage();
                }
                else if(selection!=null){
@@ -88,7 +75,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
            conceptViewer.setLabelProvider(new ConceptLabelProvider());
 
 
-           conceptViewer.setSorter(new ViewerSorter());
+           conceptViewer.setComparator(new ViewerComparator());
 
                viewer = conceptViewer;
 
@@ -98,7 +85,6 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
 
         //create context menu
         menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.conceptview");
-
        }
 
        @Override
@@ -107,33 +93,6 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
                super.changed(object);
        }
 
-       private class ConceptRelationViewer extends ListViewer {
-
-               public ConceptRelationViewer(Composite parent) {
-                       super(parent);
-               }
-
-               @Override
-               public ISelection getSelection() {
-                       ISelection selection = super.getSelection();
-                       List<TaxonRelationship> relationships = new ArrayList<>();
-                       if(selection instanceof IStructuredSelection && !selection.isEmpty()){
-                           for(Iterator iter = ((IStructuredSelection) selection).iterator();iter.hasNext();){
-                               Object object = iter.next();
-                               relationships.add(((Entry<TaxonRelationship, Taxon>)object).getKey());
-                           }
-                           return new StructuredSelection(relationships);
-                       }
-                       return selection;
-               }
-
-               @Override
-               public void setSelection(ISelection selection) {
-                       super.setSelection(selection);
-               }
-
-       }
-
        @Override
        protected String getViewName() {
                return Messages.ConceptViewPart_VIEWER_NAME;
index a552d4b0257af123984814d3cc23ebe6189203d6..1e66139a59ec13530a157098fa3d4fe8255ab8a2 100644 (file)
@@ -23,12 +23,11 @@ import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
 import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.CreateConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -56,19 +55,19 @@ public class CreateConceptRelationHandlerE4 {
         UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".taxonRelationshipType.uuid");
         TaxonRelationshipType taxonRelationshipType = HibernateProxyHelper.deproxy(CdmStore.getService(ITermService.class).load(uuid), TaxonRelationshipType.class);
 
-        TaxonNameEditorE4 editor = null;
+        TaxonEditor editor = null;
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
 
             IUndoContext undoContext = null;
-            ConversationHolder conversationHolder = null;
+
             Taxon taxon = null;
             taxon = editor.getTaxon();
-            conversationHolder = editor.getConversationHolder();
+
             undoContext = editor.getUndoContext();
 
             //FIXME should this also be enabled for bulk editor
@@ -76,22 +75,18 @@ public class CreateConceptRelationHandlerE4 {
             //             BulkEditor bulkEditor = (BulkEditor)activeEditor;
             //            ISelection selection = bulkEditor.getSelectionProvider().getSelection();
             //             taxon = (Taxon) ((IStructuredSelection)selection).getFirstElement();
-            //             conversationHolder = bulkEditor.getConversationHolder();
             //             undoContext = bulkEditor.getUndoContext();
             //         }
 
-            Taxon relatedConcept = TaxonSelectionDialog.selectTaxon(shell, //conversationHolder,
-                    taxon);
-
+            Taxon relatedConcept = TaxonSelectionDialog.selectTaxon(shell, taxon);
 
             if(relatedConcept == null){
                 return;
             }
             boolean isInverse = taxonRelationshipType.getInverseLabel().isEmpty()?false:true;
-            TaxonRelationshipTypeInverseContainer typeInverseContainer =new TaxonRelationshipTypeInverseContainer(taxonRelationshipType, isInverse) ;
-
+            TaxonRelationshipTypeInverseContainer typeInverseContainer = new TaxonRelationshipTypeInverseContainer(taxonRelationshipType, isInverse) ;
 
-            AbstractPostOperation operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(),
+            AbstractPostOperation<?> operation = new CreateConceptRelationOperation(menuItem.getLocalizedLabel(),
                     undoContext, taxon, relatedConcept, typeInverseContainer, conceptView);
             AbstractUtility.executeOperation(operation, sync);
         }
@@ -104,7 +99,7 @@ public class CreateConceptRelationHandlerE4 {
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        canExecute = e4WrappedPart instanceof TaxonNameEditorE4;
+        canExecute = e4WrappedPart instanceof TaxonEditor;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index a2112c8e3982761a5d8faaf6d6fe413f1a423bbe..c48e33d6871bba0728bd3444374ae29804f0c798 100644 (file)
@@ -26,7 +26,7 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.concept.operation.DeleteConceptRelationOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -47,13 +47,13 @@ public class DeleteConceptRelationHandlerE4 {
             MMenuItem menuItem,
             UISynchronize sync) {
 
-        TaxonNameEditorE4 editor = null;
+        TaxonEditor editor = null;
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
 
             Set<TaxonRelationship> relations = new HashSet<TaxonRelationship>();
 
index 478c2d62082a2ece941f9a29d3a158cf90f67c96..6bf35170d4d2979cb62540c0cfd55febb1655f82 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
@@ -46,15 +46,15 @@ public class OpenRelatedConceptHandlerE4  {
             @Optional@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
             EModelService modelService, EPartService partService, MApplication application) {
 
-        TaxonNameEditorE4 editor = null;
+        TaxonEditor editor = null;
         BulkEditor bulkEditor = null;
         TaxonRelationship taxonRelationship = (TaxonRelationship) selection.getFirstElement();
 
         ConceptViewPartE4 conceptView = (ConceptViewPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(conceptView.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
         }
         else if(e4WrappedPart instanceof BulkEditor){
             bulkEditor = (BulkEditor) e4WrappedPart;
index 041cecf5d8f7b9e029fed159323542bce56940fc..465237487da7d88f3b2f9b257f35fdad19c9a9f7 100644 (file)
@@ -12,7 +12,7 @@ import org.eclipse.zest.core.viewers.IGraphContentProvider;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 
 /**
  * @author andreas
@@ -59,8 +59,8 @@ public class ConceptGraphContentProvider implements IGraphContentProvider {
         */
        @Override
        public Object[] getElements(Object inputElement) {
-               if(inputElement instanceof TaxonEditorInputE4){
-                       Taxon taxon = ((TaxonEditorInputE4) inputElement).getTaxon();
+               if(inputElement instanceof TaxonEditorInput){
+                       Taxon taxon = ((TaxonEditorInput) inputElement).getTaxon();
 
                        Map<String, TaxonRelationship> filteredTaxonRelations = new HashMap<String, TaxonRelationship>();
                        getTaxonRelationshipsRecursive(filteredTaxonRelations, taxon);
index 91ec0ca06b6f3d240718e7d460363614a0cc6638..8939e982d2557f564662eb5f0f9d99bb6d0b0c29 100644 (file)
@@ -8,7 +8,6 @@ import javax.annotation.PostConstruct;
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 import org.eclipse.e4.ui.services.EMenuService;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.zest.core.viewers.GraphViewer;
@@ -18,40 +17,35 @@ import org.eclipse.zest.layouts.LayoutStyles;
 import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
 
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.concept.graph.ConceptGraphLabelProvider;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
 
 /**
- *
  * @author pplitzner
  * @since Sep 27, 2017
- *
  */
-public class ConceptGraphViewE4 extends AbstractCdmEditorPartE4 {
+public class ConceptGraphViewE4 extends AbstractCdmEditorPart<GraphViewer> {
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept.graph"; //$NON-NLS-1$
 
        private LayoutAlgorithm layoutAlgoritm;
 
-    /**
-     * {@inheritDoc}
-     */
        @Override
        public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
            if(activePart==thisPart){
                return;
            }
 
-           Object partObject = createPartObject(activePart);
+           Object partObject = getPartObject(activePart);
 
            if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4
                    || partObject instanceof FactualDataPartE4|| partObject instanceof MediaViewPartE4) {
@@ -69,15 +63,13 @@ public class ConceptGraphViewE4 extends AbstractCdmEditorPartE4 {
                        return;
                }
 
-
-               if(partObject instanceof TaxonNameEditorE4){
+               if(partObject instanceof TaxonEditor){
                    if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                 viewer.getControl().setEnabled(true);
             }
-                   TaxonEditorInputE4 input = ((TaxonNameEditorE4) partObject).getEditorInput();
+                   TaxonEditorInput input = ((TaxonEditor) partObject).getEditorInput();
                    showViewer(new StructuredSelection(input), activePart, viewer);
                }
-
        }
 
        @Override
@@ -86,7 +78,7 @@ public class ConceptGraphViewE4 extends AbstractCdmEditorPartE4 {
        }
 
        @Override
-       public Viewer getViewer() {
+       public GraphViewer getViewer() {
                return viewer;
        }
 
index 6e6b5f6b045ee00eb71ac1354ce6d3060e5eedfe..b8205922851a1a6f5e2890fd7ed21a50eaa1fae8 100644 (file)
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -62,8 +63,7 @@ import org.eclipse.swt.widgets.Tree;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.filter.TaxonOccurrenceRelationType;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
@@ -74,10 +74,9 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.searchFilter.DerivateSearchCompositeController;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -102,7 +101,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 /**
  * Displays the derivate hierarchy of the specimen specified in the editor input.
  */
-public class DerivateView implements IPartContentHasFactualData, IConversationEnabled,
+public class DerivateView implements IPartContentHasFactualData,
         ICdmEntitySessionEnabled<SpecimenOrObservationBase<?>>, IDirtyMarkable, IPostOperationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IPartContentHasMedia,
         IContextListener, IE4SavablePart, ICollapsableExpandable {
 
@@ -132,9 +131,6 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
 
        private static final int WARN_THRESHOLD = 200;
 
-
-       private ConversationHolder conversation;
-
        private TreeViewer viewer;
 
     private final int dndOperations = DND.DROP_MOVE;
@@ -207,9 +203,6 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
     public void createPartControl(Composite parent, EMenuService menuService,
             IEclipseContext context) {
         if (CdmStore.isActive()){
-            if(conversation == null){
-                conversation = CdmStore.createConversation();
-            }
             if(cdmEntitySession == null){
                 cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
             }
@@ -241,7 +234,7 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
         contentProvider = new DerivateContentProvider();
         viewer.setContentProvider(contentProvider);
         labelProvider = new DerivateLabelProvider();
-        labelProvider.setConversation(conversation);
+
         viewer.setLabelProvider(labelProvider);
         viewer.getTree().setEnabled(CdmStore.isActive());
 
@@ -265,35 +258,32 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
     }
 
     public void updateRootEntities(Collection<UUID> derivativeUuids) {
-        if(conversation!=null){
-            if (!conversation.isBound()) {
-                conversation.bind();
-            }
-            /*
-             * If the active session is not the session of the Derivative Editor
-             * then we will save the active session for later, bind temporarily
-             * to our session and rebind to the original session when we are
-             * done. This happens e.g. if a selection change happens in the
-             * taxon editor and "Link with editor" is enabled. The selection
-             * change event and thus the loading in updateRootEntities() happens
-             * in the session of the taxon editor.
-             */
-            ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
-            if(cdmEntitySession != null) {
-                cdmEntitySession.bind();
-            }
-            eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, null);
-            List<SpecimenOrObservationBase> derivates = null;
-            if(derivativeUuids!=null){
-                this.derivateToRootEntityMap = new HashMap<>();
-                this.rootElements = new HashSet<>();
-                derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
-            }
-            updateRootEntities(derivates);
-            if(previousCdmEntitySession!=null){
-                previousCdmEntitySession.bind();
-            }
+
+        /*
+         * If the active session is not the session of the Derivative Editor
+         * then we will save the active session for later, bind temporarily
+         * to our session and rebind to the original session when we are
+         * done. This happens e.g. if a selection change happens in the
+         * taxon editor and "Link with editor" is enabled. The selection
+         * change event and thus the loading in updateRootEntities() happens
+         * in the session of the taxon editor.
+         */
+        ICdmEntitySession previousCdmEntitySession = CdmStore.getCurrentSessionManager().getActiveSession();
+        if(cdmEntitySession != null) {
+            cdmEntitySession.bind();
+        }
+        eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, null);
+        List<SpecimenOrObservationBase> derivates = null;
+        if(derivativeUuids!=null){
+            this.derivateToRootEntityMap = new HashMap<>();
+            this.rootElements = new HashSet<>();
+            derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
+        }
+        updateRootEntities(derivates);
+        if(previousCdmEntitySession!=null){
+            previousCdmEntitySession.bind();
         }
+
     }
 
     public void updateRootEntities(List<SpecimenOrObservationBase> derivates) {
@@ -366,16 +356,12 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
     public void save(IProgressMonitor monitor) {
         String taskName = Messages.DerivateView_SAVING_HIERARCHY;
         monitor.beginTask(taskName, 3);
-        if (!conversation.isBound()) {
-            conversation.bind();
-            if (!cdmEntitySession.isActive()){
-                cdmEntitySession.bind();
-            }
+
+        if (!cdmEntitySession.isActive()){
+               cdmEntitySession.bind();
         }
-        monitor.worked(1);
 
-        // commit the conversation and start a new transaction immediately
-        conversation.commit(true);
+        monitor.worked(1);
 
         for(AbstractPostOperation entry:operations){
             IStatus status = Status.CANCEL_STATUS;
@@ -433,10 +419,8 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
 
     @Focus
     public void setFocus() {
-        //make sure to bind again if maybe in another view the conversation was unbound
-        if(conversation!=null && !conversation.isBound()){
-            conversation.bind();
-        }
+        //make sure to bind again if maybe in another view the session was unbound
+
         if(cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
@@ -446,15 +430,6 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
         }
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     @Override
     public void changed(Object element) {
         setDirty(true);
@@ -565,11 +540,7 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
 
     @PreDestroy
     public void dispose() {
-        if(conversation!=null){
-            conversation.close();
-            conversation = null;
-        }
-        if(cdmEntitySession != null) {
+       if(cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
         }
@@ -589,8 +560,8 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
         }
         if(listenToSelectionChange){
             selectedTaxon = null;
-            if(activePart.getObject() instanceof TaxonNameEditorE4){
-                selectedTaxon = ((TaxonNameEditorE4) activePart.getObject()).getTaxon();
+            if(activePart.getObject() instanceof TaxonEditor){
+                selectedTaxon = ((TaxonEditor) activePart.getObject()).getTaxon();
             }
             else if(selection != null){
                 Object selectedElement = selection.getFirstElement();
@@ -608,7 +579,10 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
                 }
             }
             if(selectedTaxon!=null){
-                Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).listRootUnitsByAssociatedTaxon(FieldUnit.class, selectedTaxon, null, null);
+               boolean includeUnpublished = true;
+               EnumSet<TaxonOccurrenceRelationType> associationFilter = TaxonOccurrenceRelationType.All();
+                Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class)
+                       .listRootUnitsByAssociatedTaxon(FieldUnit.class, selectedTaxon, includeUnpublished, associationFilter, null, null);       
                 Collection<UUID> uuids = new HashSet<>();
                 for (SpecimenOrObservationBase<?> specimenOrObservationBase : fieldUnits) {
                     uuids.add(specimenOrObservationBase.getUuid());
@@ -651,7 +625,7 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
             part.setLabel(SPECIMEN_EDITOR+Messages.DerivateView_NO_TAXON_SELECTED);
         }
     }
-    
+
     public DerivateSearchCompositeController getSearchController() {
        return derivateSearchCompositeController;
     }
index a33ef5b97035f17a33284bcbf6d0d50c31e7a949..02012818865563cc53516cca6c2a27bae25932db 100644 (file)
@@ -1,4 +1,11 @@
-
+/**
+* Copyright (C) 2019 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.editor.view.derivate.handler;
 
 import javax.inject.Named;
@@ -11,8 +18,8 @@ import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeCacheStrategy;
 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
 import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
@@ -49,8 +56,7 @@ public abstract class AbstractAddDerivativeHandler {
 
     private void refreshView(DerivateView derivateView, Object createdElement) {
         if(derivateView!=null){
-            derivateView.getConversationHolder().commit();
-            derivateView.refreshTree(createdElement);
+               derivateView.refreshTree(createdElement);
         }
     }
 
index 66df9123f5a0c3d687980125cd23050d4efdc0e5..fadd15b4160c72c0190c2b41d4c4abd66e981cd3 100644 (file)
@@ -59,7 +59,6 @@ public class CreateFieldUnitHandler {
                 CdmStore.getService(ITaxonService.class).merge(taxon);
 
 
-                derivateView.getConversationHolder().commit();
                 derivateView.addFieldUnit(fieldUnit);
                 derivateView.updateRootEntities();
                 derivateView.refreshTree(fieldUnit);
@@ -73,7 +72,6 @@ public class CreateFieldUnitHandler {
             FieldUnit fieldUnit = FieldUnit.NewInstance();
             fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
 
-            derivateView.getConversationHolder().commit();
             derivateView.addFieldUnit(fieldUnit);
             derivateView.updateRootEntities();
             derivateView.refreshTree(fieldUnit);
index 707765445aa348abb24c4c40f119206b55e216b9..2f7e6a4d213a218be2ffdf037673b9d7c58a2ba2 100644 (file)
@@ -47,7 +47,6 @@ public class SingleReadReuseHandler {
             sequence.addSingleRead(singleRead);
             CdmStore.getService(ISequenceService.class).merge(sequence);
 
-            derivateView.getConversationHolder().commit();
             derivateView.refreshTree();
             LocalSelectionTransfer.getTransfer().setSelection(null);
         }
index fe4de88ffb8cc9ed70b74bf26cc91c26cde7fbf8..541924edfbb908670644c6db3d57c974bdcc5f75 100644 (file)
@@ -77,7 +77,6 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
                 derivateView.remove(draggedNode.getValue());
             }
             //update DerivateView
-            derivateView.getConversationHolder().commit();
             LocalSelectionTransfer.getTransfer().setSelection(null);
             return postExecute(null);
         }
index 7082e5a74f5ef9c85892cd4cd72239bb58762981..dbdc5098495a71a4e27d18dadf95259cbf3c1e26 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Widget;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.config.FindOccurrencesConfigurator;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
@@ -34,7 +33,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.SearchManager;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
 import eu.etaxonomy.taxeditor.ui.mvc.combo.EnumTermComboController;
-import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 
 /**
  * Controller class for the {@link DerivateSearchComposite}.<br>
@@ -46,7 +44,6 @@ public class DerivateSearchCompositeController implements Listener{
 
     private final DerivateSearchComposite derivateSearchComposite;
     private EnumTermComboController<SpecimenOrObservationType> comboSpecimenTypeController;
-       private DerivateLabelProvider labelProvider;
        private Taxon selectedTaxon;
     private DerivateView derivativeEditor;
 
@@ -68,7 +65,6 @@ public class DerivateSearchCompositeController implements Listener{
         derivateSearchComposite.getButtonSearch().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnBrowseTaxa().addListener(SWT.Selection, this);
         derivateSearchComposite.getBtnClearTaxon().addListener(SWT.Selection, this);
-
     }
 
     private void searchDerivates(){
@@ -123,8 +119,7 @@ public class DerivateSearchCompositeController implements Listener{
             searchDerivates();
         }
         else if(eventSource==derivateSearchComposite.getBtnBrowseTaxa()){
-            selectedTaxon = SelectionDialogFactory.getSelectionFromDialog(Taxon.class, this.derivateSearchComposite.getShell(), //derivativeEditor.getConversationHolder(),
-                    null);
+            selectedTaxon = SelectionDialogFactory.getSelectionFromDialog(Taxon.class, this.derivateSearchComposite.getShell(), null);
             if(selectedTaxon!=null){
                 derivateSearchComposite.getTextTaxonName().setText(selectedTaxon.getTitleCache());
             }
@@ -138,7 +133,7 @@ public class DerivateSearchCompositeController implements Listener{
             derivateSearchComposite.getComboTaxonAssignment().select(DerivateSearchComposite.ALL_SPECIMENS);
             derivateSearchComposite.getComboTaxonAssignment().setEnabled(true);
             derivateSearchComposite.getLbltaxonAssignment().setEnabled(true);
-            
+
         }
     }
 
@@ -187,9 +182,7 @@ public class DerivateSearchCompositeController implements Listener{
         selectedTaxon = null;
     }
 
-    public void setConversation(ConversationHolder conversationHolder) {
-        labelProvider.setConversation(conversationHolder);
-    }
+
 
     public void setTaxonFilter(UUID taxonUuid) {
         TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(taxonUuid);
index cf1ee03e7d4a75575ac66ec6ad4b390d94a62ec8..90b156d7ac3da5f7d736e4fa5919b3aea6c03a25 100644 (file)
@@ -18,12 +18,10 @@ import org.eclipse.swt.dnd.TransferData;
 
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
-import eu.etaxonomy.cdm.model.description.TaxonDescription;
-import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -52,6 +50,7 @@ public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
 
                boolean isCopy = getCurrentOperation() == DND.DROP_COPY ? true : false;
                DescriptionBase<?> description = null;
+               boolean containsSpecimen = false;
                // cannot drop a feature node onto itself
                if (droppedElements != null){
                        for (Object droppedElement : droppedElements) {
@@ -69,7 +68,7 @@ public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
                                        }
                                        for (Object element : target.getElements()){
                                            if (element instanceof DescriptionElementBase){
-                                              if( !((DescriptionElementBase)element).isPersited()){
+                                              if( !((DescriptionElementBase)element).isPersisted()){
                                                   MessagingUtils.warningDialog(OPERATION_NOT_SUPPORTED_YET, this, Messages.DescriptionElementDropAdapter_NOT_SUPPORTED_NEW_ELEMENT_IN_DESCRIPTION);
                                            return false;
                                               }
@@ -78,7 +77,7 @@ public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
                                        }
                                        for (Object element : descriptionElement.getInDescription().getElements()){
                         if (element instanceof DescriptionElementBase){
-                           if( !((DescriptionElementBase)element).isPersited()){
+                           if( !((DescriptionElementBase)element).isPersisted()){
                                MessagingUtils.warningDialog(OPERATION_NOT_SUPPORTED_YET, this, Messages.DescriptionElementDropAdapter_NOT_SUPPORTED_NEW_ELEMENT_IN_DESCRIPTION);
                                 return false;
                            }
@@ -88,20 +87,26 @@ public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
                                        description = descriptionElement.getInDescription();
                                        description.removeElement(descriptionElement);
                                        target.addElement(descriptionElement);
-
+                                       if (descriptionElement instanceof IndividualsAssociation && PreferencesUtil.getBooleanValue("AskForNewCurrentDetermination")) {
+                                           if (((IndividualsAssociation)descriptionElement).getAssociatedSpecimenOrObservation() != null && !((IndividualsAssociation)descriptionElement).getAssociatedSpecimenOrObservation().getDeterminations().isEmpty()) {
+                            containsSpecimen = true;
+                        }
+                                       }
                                        descriptionElements.add(descriptionElement);
                                }
                        }
-                       TaxonNameEditorE4 editor = null;
+                       TaxonEditor editor = null;
                        Object activePart = EditorUtil.getActivePart();
                        if (activePart instanceof FactualDataPartE4){
                            MPart selectionProvidingPart =((FactualDataPartE4)activePart).getSelectionProvidingPart();
                            Object obj = selectionProvidingPart.getObject();
-                           if (obj instanceof TaxonNameEditorE4){
-                               editor = (TaxonNameEditorE4) obj;
+                           if (obj instanceof TaxonEditor){
+                               editor = (TaxonEditor) obj;
                            }
                        }
-                       AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(Messages.DescriptionElementDropAdapter_MOVE_DESC, EditorUtil.getUndoContext(), target, description, descriptionElements, isCopy, null, sync, false);
+
+
+                       AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(Messages.DescriptionElementDropAdapter_MOVE_DESC, EditorUtil.getUndoContext(), target, description, descriptionElements, isCopy, null, sync, false, containsSpecimen);
 
                        editor.getEditorInput().addOperation(operation);
                        editor.setDirty();
index d19c41fe0d19da048c34ecf1ec0e945bd8b30759..dfdbbd20e0f9acb86a63e1f65b5bd0239ef2e1ae 100644 (file)
@@ -9,10 +9,10 @@
 package eu.etaxonomy.taxeditor.editor.view.descriptive;
 
 import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
-import org.eclipse.jface.viewers.StyledString;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 
@@ -28,8 +28,7 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 /**
  * @author p.ciardelli
  */
-public class DescriptiveLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider  {
-
+public class DescriptiveLabelProvider extends ColumnLabelProvider   {
     private static final String TRUNCATE_SIGN = "..."; //$NON-NLS-1$
     private static final int MAX_LENGTH = 150;
 
@@ -44,14 +43,27 @@ public class DescriptiveLabelProvider extends ColumnLabelProvider implements ISt
        }
 
        @Override
-    public StyledString getStyledText(Object element) {
-           return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);
+    public Font getFont(Object element) {
+
+           Font result = super.getFont(element);
+           if (element instanceof DescriptionBase && ((DescriptionBase)element).isDefault()) {
+              FontData fontData = new FontData("Bold", 9, SWT.BOLD);
+              Font font = new Font(null, fontData);
+              return font;
+           }
+           return result;
+
+
+
        }
 
        @Override
        public Image getImage(Object element) {
            if(element instanceof DescriptionBase){
                DescriptionBase<?> description = (DescriptionBase<?>)element;
+               if (!description.isPublish()) {
+                   return ImageResources.getImage(ImageResources.PROHIBITED);
+               }
                if(description.isComputed()){
                    return MatrixUtility.getAggregatedDescriptionIcon();
                }
@@ -1,16 +1,17 @@
 /**
 * 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.editor.view.descriptive;
 
 import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
 
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.taxeditor.model.DescriptionHelper;
 
@@ -18,12 +19,19 @@ import eu.etaxonomy.taxeditor.model.DescriptionHelper;
  * @author n.hoffmann
  * @created Dec 2, 2010
  */
-public class DescriptiveViewerSorter extends ViewerSorter {
+public class DescriptiveViewerComparator extends ViewerComparator {
 
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
                if((e1 instanceof DescriptionElementBase) && (e2 instanceof DescriptionElementBase)){
-                       return DescriptionHelper.getLabel((DescriptionElementBase)e1).compareTo(DescriptionHelper.getLabel((DescriptionElementBase)e2));
+                       return DescriptionHelper.getLabel(e1).compareTo(DescriptionHelper.getLabel(e2));
+               }
+               if ((e1 instanceof DescriptionBase) && (e2 instanceof DescriptionBase) && (((DescriptionBase)e1).isDefault() || ((DescriptionBase)e2).isDefault())) {
+                   if (((DescriptionBase) e1).isDefault()){
+                       return -1;
+                   }else {
+                       return 1;
+                   }
                }
                return super.compare(viewer, e1, e2);
        }
index 4baea928aa69807b7527f22125ae1ea87e0a2e37..bbd8f6b491be5c78c67feef054c13654baaff6f2 100644 (file)
@@ -45,14 +45,14 @@ import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveLabelProvider;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewerSorter;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewerComparator;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.NameDescriptionFilter;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -63,7 +63,7 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
 import eu.etaxonomy.taxeditor.workbench.part.ICollapsableExpandable;
@@ -72,7 +72,7 @@ import eu.etaxonomy.taxeditor.workbench.part.ICollapsableExpandable;
  * @author pplitzner
  * @date 15.08.2017
  */
-public class FactualDataPartE4 extends AbstractCdmEditorPartE4
+public class FactualDataPartE4 extends AbstractCdmEditorPart<TreeViewer>
         implements IPartContentHasDetails, IPartContentHasSupplementalData,
                ICdmEntitySessionEnabled<CdmBase>, ICollapsableExpandable {
 
@@ -97,14 +97,13 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
         provider = new DescriptiveContentProvider(featureNodeContainerCache);
         treeViewer.setContentProvider(provider);
         treeViewer.setLabelProvider(new DescriptiveLabelProvider());
-        treeViewer.setSorter(new DescriptiveViewerSorter());
+        treeViewer.setComparator(new DescriptiveViewerComparator());
         treeViewer.setFilters(new NameDescriptionFilter());
         treeViewer.setAutoExpandLevel(2);
         Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };
         treeViewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(
                 this));
 
-
         viewer = treeViewer;
 
         // Propagate selection from viewer
@@ -122,14 +121,17 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
 
     @Override
     public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
-        if(activePart==thisPart){
+        if(activePart == thisPart){
             return;
         }
 
-        Object partObject = createPartObject(activePart);
+        Object partObject = getPartObject(activePart);
 
-        if ((partObject instanceof DetailsPartE4 && !(selection instanceof TaxonName))|| partObject instanceof SupplementalDataPartE4
-                || partObject instanceof MediaViewPartE4 || partObject instanceof ConceptViewPartE4 || ((partObject instanceof AbstractCdmEditorPartE4) &&(((AbstractCdmEditorPartE4)partObject).getViewer().getInput() instanceof DescriptionElementBase))) {
+        if ((partObject instanceof DetailsPartE4 && !(selection instanceof TaxonName) )
+              || partObject instanceof SupplementalDataPartE4
+              || partObject instanceof MediaViewPartE4
+              || partObject instanceof ConceptViewPartE4
+              || ((partObject instanceof AbstractCdmEditorPart) &&(((AbstractCdmEditorPart<?>)partObject).getViewer().getInput() instanceof DescriptionElementBase))) {
             // do not show empty page as these views are also used to edit the
             // description selected in this view
             return;
@@ -147,8 +149,8 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
             }
 
             Object firstElement = structuredSelection.getFirstElement();
-            if (partObject instanceof TaxonNameEditorE4){
-                if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
+            if (partObject instanceof TaxonEditor){
+                if (firstElement != ((TaxonEditor)partObject).getTaxon()){
                     showEmptyPage();
                     return;
                 }
@@ -161,7 +163,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
                 && partObject instanceof IPartContentHasFactualData
                     && !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
                    // && !(firstElement instanceof TaxonName && partObject instanceof BulkEditor)){
-                if (firstElement instanceof TaxonName ){
+                if (firstElement instanceof TaxonName){
                     thisPart.setLabel(Messages.NameFactsDataView_Lable);
                 }else if (firstElement instanceof TaxonBase){
                        thisPart.setLabel(Messages.TaxaFactsDataView_Lable);
@@ -192,7 +194,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
     public void changed(Object object) {
         Object[] expandedObjects = null;
         if (!viewer.getControl().isDisposed()){
-            expandedObjects = ((TreeViewer)viewer).getExpandedElements();
+            expandedObjects = viewer.getExpandedElements();
         }else{
             return;
         }
@@ -202,7 +204,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
 
         viewer.refresh();
         super.changed(object);
-        ((TreeViewer) viewer).setExpandedElements(expandedObjects);
+        viewer.setExpandedElements(expandedObjects);
         if(object instanceof DescriptionElementBase){
             DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
             DescriptionBase<?> description = descriptionElement.getInDescription();
@@ -216,31 +218,24 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
                 }
                 ((AbstractTreeViewer) viewer).expandToLevel(featureNodeContainer, 2);
             }
-            if (object != null){
-               StructuredSelection selection = new StructuredSelection(object);
-               viewer.setSelection(selection, true);
-            }
-            
+               StructuredSelection selection = new StructuredSelection(object);
+               viewer.setSelection(selection, true);
         }
-
-
-
     }
 
     @Inject
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.SAVE_TAXON)boolean refresh){
         if(refresh){
-            Object[] expandedObjects = ((TreeViewer)viewer).getExpandedElements();
+            Object[] expandedObjects = viewer.getExpandedElements();
             viewer.refresh();
-            ((TreeViewer)viewer).collapseAll();
+            viewer.collapseAll();
             if (expandedObjects.length>0){
-                ((TreeViewer)viewer).setExpandedElements(expandedObjects);
+                viewer.setExpandedElements(expandedObjects);
             }
         }
     }
 
-
     @Inject
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR)ITaxonEditor editor){
@@ -249,24 +244,14 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void collapse() {
-        if(viewer instanceof TreeViewer) {
-            ((TreeViewer) viewer).collapseAll();
-        }
+        viewer.collapseAll();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void expand() {
-        if(viewer instanceof TreeViewer) {
-            ((TreeViewer) viewer).expandAll();
-        }
+        viewer.expandAll();
     }
 
     public void toggleShowOnlyIndividualAssociations(){
@@ -286,6 +271,7 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
     public  List<CdmBase> getRootEntities() {
         return Arrays.asList((CdmBase)getViewer().getInput());
     }
+
     @Override
     public Map<Object, List<String>> getPropertyPathsMap() {
         return null;
@@ -294,14 +280,14 @@ public class FactualDataPartE4 extends AbstractCdmEditorPartE4
     @Override
     protected void showViewer(IStructuredSelection selection, MPart activePart, Viewer viewer){
         Object[] expandedObjects = null;
-        if (!((TreeViewer)this.getViewer()).getControl().isDisposed()){
-            expandedObjects = ((TreeViewer)this.getViewer()).getExpandedElements();
+        if (!this.getViewer().getControl().isDisposed()){
+            expandedObjects = this.getViewer().getExpandedElements();
         }
         super.showViewer(selection, activePart, viewer);
         if (expandedObjects == null || expandedObjects.length == 0){
-            ((TreeViewer)this.viewer).expandToLevel(2);
+            this.viewer.expandToLevel(2);
         }else{
-            ((TreeViewer)this.viewer).setExpandedElements(expandedObjects);
+            this.viewer.setExpandedElements(expandedObjects);
         }
     }
 }
\ No newline at end of file
index 684a53d537a5f0c4c77516daf06930b265dad2c1..c254e5cd9b49942073cb56809c76a57e5cbf57b6 100644 (file)
@@ -27,9 +27,13 @@ import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 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.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -55,11 +59,19 @@ public class CreateDescriptionElementHandlerE4 {
         String commandId = menuItem.getCommand().getElementId();
         UUID uuid = (UUID) menuItem.getTransientData().get(commandId+".feature.uuid");
         Feature feature = HibernateProxyHelper.deproxy(CdmStore.getService(ITermService.class).load(uuid), Feature.class);
-
-        FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
-
-        DescriptionBase description = null;
         Object object = selection.getFirstElement();
+        if (activePart.getObject() instanceof TaxonEditor && object == null) {
+            object = ((TaxonEditor)activePart.getObject()).getTaxon();
+        }
+        FactualDataPartE4 factualDataPart = null;
+        if (activePart.getObject() instanceof FactualDataPartE4 ) {
+            factualDataPart = (FactualDataPartE4) activePart.getObject();
+            if(factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonEditor && object == null) {
+                object = ((TaxonEditor)factualDataPart.getSelectionProvidingPart().getObject()).getTaxon();
+            }
+        }
+        DescriptionBase description = null;
+
         if(object instanceof FeatureNodeContainer){
             description = ((FeatureNodeContainer) object).getDescription();
         }
@@ -69,7 +81,16 @@ public class CreateDescriptionElementHandlerE4 {
         }
         else if (object instanceof DescriptionBase) {
             description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
-        } else {
+        }
+        else if (object instanceof Taxon) {
+            Taxon taxon = (Taxon)object;
+            description = taxon.getDefaultDescription();
+            if (description == null) {
+                description = TaxonDescription.NewInstance(taxon);
+                description.setDefault(true);
+            }
+        } 
+        else {
             MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description")); //$NON-NLS-1$
             return;
         }
@@ -85,6 +106,21 @@ public class CreateDescriptionElementHandlerE4 {
         boolean canExecute = false;
         DescriptionBase description = null;
         Object object = selection.getFirstElement();
+        if (object == null) {
+            MPart activePart = EventUtility.getActivePart();
+            Object o = activePart.getObject();
+            if (o instanceof FactualDataPartE4) {
+                FactualDataPartE4 part = (FactualDataPartE4)o;
+                MPart selectionProvidingPart = part.getSelectionProvidingPart();
+                if (selectionProvidingPart.getObject() instanceof TaxonEditor) {
+                    TaxonEditor editor = (TaxonEditor)selectionProvidingPart.getObject();
+                    object = editor.getTaxon();
+                }                
+            }else if (o instanceof TaxonEditor) {
+                TaxonEditor editor = (TaxonEditor)AbstractUtility.getActiveEditor();
+                object = editor.getTaxon();
+            }
+        }
         if(object instanceof FeatureNodeContainer){
             description = ((FeatureNodeContainer) object).getDescription();
         }
@@ -94,17 +130,23 @@ public class CreateDescriptionElementHandlerE4 {
         }
         else if (object instanceof DescriptionBase) {
             description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
-        }
+        }else if (object instanceof Taxon){
+            Taxon taxon = (Taxon) object;
+            description =taxon.getDefaultDescription();
+            
+        } 
 
-        if ((description.isComputed() || description.isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+        if (description != null &&((description.isComputed() || description.isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled())){
             canExecute = false;
             menuItem.getParent().setVisible(false);
         }else{
-            canExecute = selection.size()==1
+            canExecute = (selection.size()==1
                     &&
                     (selection.getFirstElement() instanceof DescriptionBase
                     || selection.getFirstElement() instanceof DescriptionElementBase
-                    || selection.getFirstElement() instanceof FeatureNodeContainer);
+                    || selection.getFirstElement() instanceof FeatureNodeContainer
+                    || object instanceof Taxon))
+                    || (selection.size() == 0 && object instanceof Taxon);
         }
         menuItem.setVisible(canExecute);
         return canExecute;
index 7d1fcc70c66b621b45d09094b021f83884a45768..1bdfb0b3c5779db76babff40801a64936e6478d4 100644 (file)
@@ -41,7 +41,7 @@ import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation;
@@ -143,10 +143,10 @@ public class DeleteHandlerE4 {
                 }
 
 
-                if (factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
-                    ((TaxonNameEditorE4)factualDataPart.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
-                    ((TaxonNameEditorE4)factualDataPart.getSelectionProvidingPart().getObject()).setDirty();
-                    ((TaxonNameEditorE4)factualDataPart.getSelectionProvidingPart().getObject()).redraw();
+                if (factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonEditor){
+                    ((TaxonEditor)factualDataPart.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
+                    ((TaxonEditor)factualDataPart.getSelectionProvidingPart().getObject()).setDirty();
+                    ((TaxonEditor)factualDataPart.getSelectionProvidingPart().getObject()).redraw();
                 }
                 if (factualDataPart.getSelectionProvidingPart().getObject() instanceof DerivateView){
                     ((DerivateView)factualDataPart.getSelectionProvidingPart().getObject()).addOperation(operation);
index 9cedc4174d2eea3302ac430a75ebdde233d8750c..bf016d1e2058d5e9e1ea01019c10fae146009dc1 100644 (file)
@@ -11,7 +11,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -155,7 +155,7 @@ public class DescriptionsMenuPropertyTesterE4 extends PropertyTester {
        }
 
        private boolean isTaxonEditor() {
-           if(AbstractUtility.getActiveEditor() instanceof TaxonNameEditorE4){
+           if(AbstractUtility.getActiveEditor() instanceof TaxonEditor){
                return true;
            }
            return false;
index 158f91938b9d8408de3d83bc0265965fa3b9515e..716530c0a4d7e79e4dc416862b13186be1cda600 100644 (file)
@@ -9,13 +9,21 @@
 
 package eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
 
 import javax.inject.Named;
 
 import org.eclipse.e4.ui.di.AboutToShow;
 import org.eclipse.e4.ui.model.application.commands.MCommand;
 import org.eclipse.e4.ui.model.application.commands.MCommandsFactory;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
 import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
 import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement;
@@ -29,12 +37,17 @@ 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.TaxonNameDescription;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
@@ -51,53 +64,119 @@ public class DynamicFeatureMenuE4 {
         MMenu menu = MMenuFactory.INSTANCE.createMenu();
         menu.setLabel(Messages.DynamicFeatureMenuE4_new);
         items.add(menu);
-
+        List<MMenuElement> menuItems = new ArrayList<>();
         Object selectedElement = selection.getFirstElement();
+        if (selectedElement == null) {
+            MPart activePart = EventUtility.getActivePart();
+            Object o = activePart.getObject();
+            if (o instanceof FactualDataPartE4) {
+                FactualDataPartE4 part = (FactualDataPartE4)o;
+                MPart selectionProvidingPart = part.getSelectionProvidingPart();
+                if (selectionProvidingPart.getObject() instanceof TaxonEditor) {
+                    TaxonEditor editor = (TaxonEditor)selectionProvidingPart.getObject();
+                    selectedElement = editor.getTaxon();
+                }
+            }else if (o instanceof TaxonEditor) {
+                TaxonEditor editor = (TaxonEditor)AbstractUtility.getActiveEditor();
+                selectedElement = editor.getTaxon();
+            }
+        }
 
+        DescriptionBase<?> description;
         if (selectedElement instanceof DescriptionBase<?>) {
-            if ((((DescriptionBase<?>) selectedElement).isComputed() || ((DescriptionBase<?>) selectedElement).isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled()){
-                items.remove(menu);
-                return;
-            }
-            TermTree<?> featureTree = getFeatureTree((DescriptionBase<?>) selectedElement);
+            description = (DescriptionBase<?>) selectedElement;
+        } else if (selectedElement instanceof FeatureNodeContainer){
+            description = ((FeatureNodeContainer) selectedElement).getDescription();
+        } else if (selectedElement instanceof DescriptionElementBase){
+            description = ((DescriptionElementBase) selectedElement).getInDescription();
+        } else if (selectedElement instanceof Taxon){
+            Taxon taxon = (Taxon) selectedElement;
+            description = taxon.getDefaultDescription();
+        } else {
+            //TODO or should we throw exception instead?
+            return;
+        }
+        //check computed or cloned
+        //TODO AM: in the originally code the isCloneForSource was only implemented for the DescriptionBase case
+        //         Was this on purpose or was it just forgotten in the other cases?
+        if ( description != null && (description.isComputed() || description.isCloneForSource())
+                && PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+            items.remove(menu);
+            return;
+        }
 
-            for (TermNode<?> childNode : featureTree.getRootChildren()) {
-                createMenuItem(menu, childNode.getTerm(), globalLanguage);
-            }
-        } else if (selectedElement instanceof FeatureNodeContainer) {
-            if (((FeatureNodeContainer) selectedElement).getDescription().isComputed()){
-                items.remove(menu);
-                return;
+        //compute menu to show
+        List<Feature> featureList = new ArrayList<>();
+        if (selectedElement instanceof DescriptionBase<?> || selectedElement instanceof Taxon) {
+            TermTree<Feature> featureTree = (TermTree)getFeatureTree(description);
+            for (TermNode<Feature> childNode : featureTree.getRootChildren()) {
+                Feature feature = childNode.getTerm();
+                //TODO duplicate check needed? But a feature tree should not have duplicates
+                featureList.add(feature);
             }
-            TermNode<?> featureNode = ((FeatureNodeContainer) selectedElement)
-                    .getFeatureNode();
-
-            // add the feature to the menu
-            createMenuItem(menu, featureNode.getTerm(), globalLanguage);
+        } else if (selectedElement instanceof FeatureNodeContainer){
+            //add feature
+            TermNode<Feature> featureNode = ((FeatureNodeContainer) selectedElement).getFeatureNode();
+            featureList.add(featureNode.getTerm());
 
             // add possible children to the menu
-            for (TermNode<?> childNode : featureNode.getChildNodes()) {
-                TermTree<?> featureTree = getFeatureTree(((FeatureNodeContainer) selectedElement).getDescription());
-                featureTree = PreferencesUtil.getPreferredFeatureTreeForNameDescription(false);
+            //TODO AM: does this really work and what is it for?
+            for (TermNode<Feature> childNode : featureNode.getChildNodes()) {
+                Feature feature = childNode.getTerm();
+                TermTree<Feature> featureTree = (TermTree)getFeatureTree(description);
 
-                if (featureTree != null && featureTree.getRootChildren().contains(childNode.getTerm() )){
-                        createMenuItem(menu, childNode.getTerm(), globalLanguage);
+                if (featureTree != null && featureTree.getRootChildren().contains(feature)){
+                    featureList.add(feature);
                 }
             }
+        } else if (selectedElement instanceof DescriptionElementBase){
+            Feature feature = ((DescriptionElementBase) selectedElement).getFeature();
+            featureList.add(feature);
+        } else {
+            //TODO or should we throw exception instead?
+            return;
+        }
+
+        Map<UUID, Integer> feature_count_map = getElementCounts(description);
+
+        for (Feature feature : featureList){
+            Integer count = null;
+            if (feature_count_map != null) {
+                count = feature_count_map.get(feature.getUuid());
+            }
+            if(feature.getMaxPerDataset() == null || count == null || count < feature.getMaxPerDataset())  {
+                createMenuItem(menuItems, feature, globalLanguage);
+            }
+        }
 
-        } else if (selectedElement instanceof DescriptionElementBase) {
-            if (((DescriptionElementBase) selectedElement).getInDescription().isComputed() && PreferencesUtil.isComputedDesciptionHandlingDisabled()){
-                items.remove(menu);
-                return;
+        Collections.sort(menuItems, new MenuItemComparator());
+        menu.getChildren().clear();
+        for (MMenuElement element: menuItems) {
+            menu.getChildren().add(element);
+        }
+
+    }
+
+    protected Map<UUID, Integer> getElementCounts(DescriptionBase<?> selectedElement) {
+        if (selectedElement == null) {
+            return null;
+        }
+        Set<DescriptionElementBase> elements = selectedElement.getElements();
+        Map<UUID, Integer> feature_count_map = new HashMap<>();
+        for (DescriptionElementBase el: elements) {
+            Integer count = feature_count_map.get(el.getFeature().getUuid());
+            if (count == null) {
+                count = 1;
+            }else {
+                count++;
             }
-            Feature feature = ((DescriptionElementBase) selectedElement)
-                    .getFeature();
-            createMenuItem(menu, feature, globalLanguage);
+            feature_count_map.put(el.getFeature().getUuid(), count);
         }
+        return feature_count_map;
     }
 
-    private void createMenuItem(MMenu menu, final DefinedTermBase feature, Language globalLanguage) {
-        final DefinedTermBase<?> deproxiedFeature = HibernateProxyHelper.deproxy(feature, DefinedTermBase.class);
+    private void createMenuItem(List<MMenuElement> menuItems, final DefinedTermBase feature, Language globalLanguage) {
+        final DefinedTermBase<?> deproxiedFeature = HibernateProxyHelper.deproxy(feature);
 
         String label = deproxiedFeature.getLabel(globalLanguage);
         if (label == null){
@@ -111,19 +190,25 @@ public class DynamicFeatureMenuE4 {
         }
         MHandledMenuItem menuItem = MMenuFactory.INSTANCE.createHandledMenuItem();
         menuItem.setLabel(label);
+        if (deproxiedFeature.getDescription() != null) {
+            if (deproxiedFeature.getDescription(globalLanguage) != null) {
+                menuItem.setTooltip(deproxiedFeature.getDescription(globalLanguage));
+            }else {
+                menuItem.setTooltip(deproxiedFeature.getDescription());
+            }
+        }else {
+            menuItem.setTooltip(label);
+        }
         MCommand mCommand = MCommandsFactory.INSTANCE.createCommand();
         mCommand.setElementId(CreateDescriptionElementOperation.ID);
         mCommand.setCommandName(label);
-        //             try {
-        //                 mCommand.setCommandName(command.getName());
-        //             } catch (NotDefinedException e) {
-        //                 e.printStackTrace();
-        //             }
+
+
         //set params
         menuItem.getTransientData().put(CreateDescriptionElementOperation.ID+".feature.uuid", deproxiedFeature.getUuid());
 
         menuItem.setCommand(mCommand);
-        menu.getChildren().add(menuItem);
+        menuItems.add(menuItem);
     }
 
        /**
@@ -131,31 +216,56 @@ public class DynamicFeatureMenuE4 {
         *
         * TODO as of now this is always the same thing because feature trees may
         * not be associated to descriptions yet.
-        *
-        * @param description
-        * @return
         */
-       private TermTree<?> getFeatureTree(DescriptionBase description) {
-               TermTree<?> featureTree = null;
-
-               // TODO change this to the feature tree associated with this taxon
-               // description
-               if (description.hasStructuredData()) {
-                       featureTree = PreferencesUtil
-                                       .getDefaultFeatureTreeForStructuredDescription();
-               } else {
-                       featureTree = PreferencesUtil
-                                       .getDefaultFeatureTreeForTextualDescription();
-               }
-
-               if (featureTree == null) {
-                   featureTree = TermEditorInput.getPreferredTaxonFeatureTree(false);
-               }
-               if (description instanceof TaxonNameDescription){
-                   featureTree = TermEditorInput.getPreferredNameFeatureTree(false);
-
-               }
+       private TermTree<?> getFeatureTree(DescriptionBase<?> description) {
+
+           TermTree<?> featureTree = null;
+
+           if (description instanceof TaxonNameDescription){
+            featureTree = TermEditorInput.getPreferredNameFeatureTree(false);
+
+        }else if(description != null){
+            // TODO change this to the feature tree associated with this taxon
+            // description
+            if (description.hasStructuredData()) {
+                featureTree = PreferencesUtil
+                        .getDefaultFeatureTreeForStructuredDescription();
+            } else {
+                featureTree = PreferencesUtil
+                        .getDefaultFeatureTreeForTextualDescription();
+            }
+            if (featureTree == null) {
+                featureTree = TermEditorInput.getPreferredTaxonFeatureTree(false);
+            }
+        }else {
+            featureTree = TermEditorInput.getPreferredTaxonFeatureTree(false);
+        }
 
                return featureTree;
        }
+
+       private class MenuItemComparator implements Comparator<MMenuElement>{
+        @Override
+        public int compare(MMenuElement o1, MMenuElement o2) {
+            if (o1 == o2) {
+                return 0;
+            }
+            if (o1 == null) {
+                return -1;
+            }
+            if (o2 == null) {
+                return 1;
+            }
+            if (o1.getLabel() == null && o2.getLabel() != null) {
+                return -1;
+            }
+            if (o2.getLabel() == null) {
+                return 1;
+            }
+            if (o1.getLabel().equals(o2.getLabel())) {
+                return 0;
+            }
+            return o1.getLabel().compareTo(o2.getLabel());
+        }
+       }
 }
index 056573c58e6e0ecc30c38344e4c2cd8337b14844..ad8870e15a51c2ac7eac86f33012d8148e59d2d2 100644 (file)
@@ -41,14 +41,16 @@ import eu.etaxonomy.cdm.api.service.IDescriptionElementService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -56,6 +58,7 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeAndBoolean;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
@@ -68,7 +71,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
     private UUID newAcceptedTaxonNodeUuid;
     private UUID oldAcceptedTaxonNodeUuid;
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
     private MApplication application;
     private EModelService modelService;
     private EPartService partService;
@@ -86,13 +89,14 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
         IStructuredSelection viewselection = (IStructuredSelection) factualDataPart.getViewer().getSelection();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
         }
         Taxon actualTaxon= null;
 
         List<DescriptionElementBase> elements = new ArrayList<DescriptionElementBase>();
         DescriptionBase<?> description = null;
+        boolean containsDeterminedSpecimen = false;
         for (Iterator<?> iter = viewselection.iterator(); iter.hasNext();) {
             Object object = iter.next();
             if (object instanceof DescriptionElementBase) {
@@ -104,7 +108,13 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
                 }else{
                     element = ((DescriptionElementBase) object);
                 }
-
+                if (element instanceof IndividualsAssociation) {
+                    IndividualsAssociation indAss = (IndividualsAssociation)element;
+                    SpecimenOrObservationBase specimen = HibernateProxyHelper.deproxy(indAss.getAssociatedSpecimenOrObservation());
+                    if (!specimen.getDeterminations().isEmpty()) {
+                        containsDeterminedSpecimen = true;
+                    }
+                }
                 elements.add(element);
             } else if (object instanceof FeatureNodeContainer) {
                 for (DescriptionElementBase de : ((FeatureNodeContainer) object).getDescriptionElements()) {
@@ -114,6 +124,12 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
                     }else{
                         element = (de);
                     }
+                    if (element instanceof IndividualsAssociation) {
+                        IndividualsAssociation indAss = (IndividualsAssociation)element;
+                        if (!indAss.getAssociatedSpecimenOrObservation().getDeterminations().isEmpty()) {
+                            containsDeterminedSpecimen = true;
+                        }
+                    }
                     description = de.getInDescription();
                     elements.add(element);
                 }
@@ -148,19 +164,26 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
         if (classification != null){
             classificationUuid = classification.getUuid();
         }
-        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
+        TaxonNodeAndBoolean newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
                 Messages.MoveDescriptionElementsHandler_CHOOSE_ACC_TAXON,
                 excludeTaxa,
-                null, classificationUuid
-                );
-        if (newAcceptedTaxonNode != null){
-            Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
+                null, classificationUuid,
+                true, true);
+        boolean createNewCurrentDeterminations = false;
+        if (containsDeterminedSpecimen) {
+            if(MessageDialog.openQuestion(null,"Create new current determinations?", "There are specimen with determination(s) involved, do you want to create new current determinations with the target taxon?")){
+                createNewCurrentDeterminations = true;
+            }
+        }
+
+        if (newAcceptedTaxonNode != null && newAcceptedTaxonNode.getNode() != null){
+            Taxon targetTaxon = newAcceptedTaxonNode.getNode().getTaxon();
 
             if(targetTaxon == null){
                 // canceled
                 return;
             }
-            newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();
+            newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getNode().getUuid();
 
             Collection<IE4SavablePart> targetEditors = EditorUtil.checkForTaxonChanges(targetTaxon.getUuid(), partService);
 
@@ -176,10 +199,10 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
             }
 
             String moveMessage = String.format(Messages.MoveDescriptionElementsHandler_ELEMENTS_MOVED, editor.getTaxon());
-
+            boolean useDefaultDescription =  newAcceptedTaxonNode.getBool();
             AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(
                     menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(),
-                    targetTaxon.getUuid(), moveMessage, elements, false, this, null, false);
+                    targetTaxon.getUuid(), moveMessage, elements, false, this, null, false,!useDefaultDescription, createNewCurrentDeterminations);
             editor.getEditorInput().addOperation(operation);
             for (DescriptionElementBase element: elements)
             {
@@ -195,8 +218,6 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
     @Override
     public boolean postOperation(Object objectAffectedByOperation) {
 
-        editor.getConversationHolder().bind();
-        editor.getConversationHolder().commit(true);
         Display.getDefault().asyncExec(new Runnable(){
 
             @Override
@@ -230,10 +251,10 @@ public class MoveDescriptionElementsHandlerE4 implements IPostOperationEnabled{
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         boolean isComputedDisabled = PreferencesUtil.isComputedDesciptionHandlingDisabled();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
+        if(e4WrappedPart instanceof TaxonEditor){
             ISelection selection = factualDataPart.getViewer().getSelection();
             if(selection instanceof IStructuredSelection){
-                boolean selectionProviding = factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4;
+                boolean selectionProviding = factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonEditor;
                 Object firstElement = ((IStructuredSelection) selection).getFirstElement();
 
                 canExecute = ((firstElement instanceof FeatureNodeContainer && !(((FeatureNodeContainer)firstElement).getContainerTree().getDescription() instanceof TaxonNameDescription))
index b9d086078dc3be4e85ff485958e2e9db3aa96cbd..b56d1ba168f12578fed599a19f07098d597e6323 100755 (executable)
@@ -41,6 +41,7 @@ import eu.etaxonomy.cdm.api.service.IDescriptionElementService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
 import eu.etaxonomy.cdm.model.taxon.Classification;
@@ -48,7 +49,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -56,6 +57,7 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeAndBoolean;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
@@ -68,7 +70,7 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOperationEnabled{
     private UUID newAcceptedTaxonNodeUuid;
     private UUID oldAcceptedTaxonNodeUuid;
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
     private MApplication application;
     private EModelService modelService;
     private EPartService partService;
@@ -86,13 +88,14 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
         IStructuredSelection viewselection = (IStructuredSelection) factualDataPart.getViewer().getSelection();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
         }
         Taxon actualTaxon= null;
 
         List<DescriptionElementBase> elements = new ArrayList<DescriptionElementBase>();
         DescriptionBase<?> description = null;
+        boolean containsDeterminedSpecimen = false;
         for (Iterator<?> iter = viewselection.iterator(); iter.hasNext();) {
             Object object = iter.next();
             if (object instanceof DescriptionElementBase) {
@@ -104,6 +107,12 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
                 }else{
                     element = ((DescriptionElementBase) object);
                 }
+                if (element instanceof IndividualsAssociation) {
+                    IndividualsAssociation indAss = (IndividualsAssociation)element;
+                    if (!indAss.getAssociatedSpecimenOrObservation().getDeterminations().isEmpty()) {
+                        containsDeterminedSpecimen = true;
+                    }
+                }
 
                 elements.add(element);
             } else if (object instanceof FeatureNodeContainer) {
@@ -115,6 +124,12 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
                         element = (de);
                     }
                     description = de.getInDescription();
+                    if (element instanceof IndividualsAssociation) {
+                        IndividualsAssociation indAss = (IndividualsAssociation)element;
+                        if (!indAss.getAssociatedSpecimenOrObservation().getDeterminations().isEmpty()) {
+                            containsDeterminedSpecimen = true;
+                        }
+                    }
                     elements.add(element);
                 }
             }
@@ -148,19 +163,19 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
         if (classification != null){
             classificationUuid = classification.getUuid();
         }
-        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
+        TaxonNodeAndBoolean newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
                 Messages.MoveDescriptionElementsHandler_CHOOSE_ACC_TAXON,
                 excludeTaxa,
-                null, classificationUuid
+                null, classificationUuid, true, true
                 );
         if (newAcceptedTaxonNode != null){
-            Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
+            Taxon targetTaxon = newAcceptedTaxonNode.getNode().getTaxon();
 
             if(targetTaxon == null){
                 // canceled
                 return;
             }
-            newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();
+            newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getNode().getUuid();
 
             Collection<IE4SavablePart> targetEditors = EditorUtil.checkForTaxonChanges(targetTaxon.getUuid(), partService);
 
@@ -174,12 +189,18 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
                     return;
                 }
             }
+            boolean createNewCurrentDeterminations = false;
+            if (containsDeterminedSpecimen) {
+                if(MessageDialog.openQuestion(null,"Create new current determinations?", "There are specimen with determination(s) involved, do you want to create new current determinations with the target taxon?")){
+                    createNewCurrentDeterminations = true;
+                }
+            }
 
             String moveMessage = String.format(Messages.MoveDescriptionElementsHandler_ELEMENTS_MOVED, editor.getTaxon());
-
+            boolean useDefaultDescription = newAcceptedTaxonNode.getBool();
             AbstractPostTaxonOperation operation = new MoveDescriptionElementsOperation(
                     menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(),
-                    targetTaxon.getUuid(), moveMessage, elements, false, this, null, true);
+                    targetTaxon.getUuid(), moveMessage, elements, false, this, null, true, !useDefaultDescription, createNewCurrentDeterminations);
             editor.getEditorInput().addOperation(operation);
             for (DescriptionElementBase element: elements)
             {
@@ -195,8 +216,6 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
     @Override
     public boolean postOperation(Object objectAffectedByOperation) {
 
-        editor.getConversationHolder().bind();
-        editor.getConversationHolder().commit(true);
         Display.getDefault().asyncExec(new Runnable(){
 
             @Override
@@ -230,10 +249,10 @@ public class MoveDescriptionElementsSetNameInSourceHandlerE5 implements IPostOpe
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         boolean isComputedDisabled = PreferencesUtil.isComputedDesciptionHandlingDisabled();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
+        if(e4WrappedPart instanceof TaxonEditor){
             ISelection selection = factualDataPart.getViewer().getSelection();
             if(selection instanceof IStructuredSelection){
-                boolean selectionProviding = factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4;
+                boolean selectionProviding = factualDataPart.getSelectionProvidingPart().getObject() instanceof TaxonEditor;
                 Object firstElement = ((IStructuredSelection) selection).getFirstElement();
                 canExecute = ((firstElement instanceof FeatureNodeContainer && !(((FeatureNodeContainer)firstElement).getContainerTree().getDescription() instanceof TaxonNameDescription))
                                     || (firstElement instanceof DescriptionElementBase && !(((DescriptionElementBase)firstElement).getInDescription() instanceof TaxonNameDescription)))
index c1467c0e2c9a11422184a350d4a9d9979259908d..04c789fd6cd12f4b0ba4f128e50411a933154346 100644 (file)
@@ -37,7 +37,7 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -59,7 +59,7 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
     private UUID oldAcceptedTaxonNodeUuid;
     private UUID newAcceptedTaxonUuid;
     private UUID oldAcceptedTaxonUuid;
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
     private MApplication application;
     private EModelService modelService;
     private EPartService partService;
@@ -76,8 +76,8 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
 
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
 
         }
 
@@ -108,7 +108,6 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
         Set<UUID> excludeTaxa = new HashSet<>();
         excludeTaxa.add(oldAcceptedTaxonNodeUuid);
         TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
-//                editor.getConversationHolder(),
                 Messages.MoveDescriptionToOtherTaxonHandler_CHOOSE_ACC_TAXON,
                 excludeTaxa,
                 node,
@@ -139,7 +138,6 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
                     taxonDescription,
                     newAcceptedTaxonNode,
                     this,
-                    editor,
                     editor.getEditorInput(),
                     false);
             editor.getEditorInput().addOperation(operation);
@@ -179,7 +177,7 @@ public class MoveDescriptionToOtherTaxonHandlerE4 implements IPostOperationEnabl
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
+        if(e4WrappedPart instanceof TaxonEditor){
             ISelection selection = factualDataPart.getViewer().getSelection();
             if(selection instanceof IStructuredSelection){
                 Object firstElement = ((IStructuredSelection) selection).getFirstElement();
index 97c4a56a2a19a9d03d213a035d5f2161256dfcc5..425646b1c6d37b97263e100068f3de25edb0e1a1 100755 (executable)
@@ -37,7 +37,7 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -59,7 +59,7 @@ public class MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5 implements IPos
     private UUID oldAcceptedTaxonNodeUuid;
     private UUID newAcceptedTaxonUuid;
     private UUID oldAcceptedTaxonUuid;
-    private TaxonNameEditorE4 editor;
+    private TaxonEditor editor;
     private MApplication application;
     private EModelService modelService;
     private EPartService partService;
@@ -76,8 +76,8 @@ public class MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5 implements IPos
 
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
-            editor = (TaxonNameEditorE4) e4WrappedPart;
+        if(e4WrappedPart instanceof TaxonEditor){
+            editor = (TaxonEditor) e4WrappedPart;
 
         }
 
@@ -108,7 +108,6 @@ public class MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5 implements IPos
         Set<UUID> excludeTaxa = new HashSet<>();
         excludeTaxa.add(oldAcceptedTaxonNodeUuid);
         TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
-//                editor.getConversationHolder(),
                 Messages.MoveDescriptionToOtherTaxonHandler_CHOOSE_ACC_TAXON,
                 excludeTaxa,
                 node,
@@ -139,7 +138,6 @@ public class MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5 implements IPos
                     taxonDescription,
                     newAcceptedTaxonNode,
                     this,
-                    editor,
                     editor.getEditorInput(),
                     true);
             editor.getEditorInput().addOperation(operation);
@@ -181,7 +179,7 @@ public class MoveDescriptionToOtherTaxonSetNameInSourceHandlerE5 implements IPos
         FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
 
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart());
-        if(e4WrappedPart instanceof TaxonNameEditorE4){
+        if(e4WrappedPart instanceof TaxonEditor){
             ISelection selection = factualDataPart.getViewer().getSelection();
             if(selection instanceof IStructuredSelection){
                 Object firstElement = ((IStructuredSelection) selection).getFirstElement();
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/SetDefaultDescriptionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/SetDefaultDescriptionHandler.java
new file mode 100644 (file)
index 0000000..a469803
--- /dev/null
@@ -0,0 +1,103 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.editor.view.descriptive.e4.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.SetDefaultDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ *
+ * @author pplitzner
+ * @date 15.08.2017
+ *
+ */
+public class SetDefaultDescriptionHandler {
+
+    @Execute
+    public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
+            @Optional@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
+            MHandledMenuItem menuItem,
+            UISynchronize sync) {
+
+        String commandId = menuItem.getCommand().getElementId();
+        FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject();
+
+        DescriptionBase description = null;
+        Object object = selection.getFirstElement();
+      if (object instanceof DescriptionBase) {
+            description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
+        } else {
+            MessagingUtils.error(getClass(), new IllegalArgumentException("Could not determine the taxon description")); //$NON-NLS-1$
+            return;
+        }
+        AbstractPostOperation operation = operationCreationInstance(menuItem.getLocalizedLabel(),  description, true,
+                factualDataPart);
+        // TODO use undo context specific to editor
+        AbstractUtility.executeOperation(operation, sync);
+    }
+
+    @CanExecute
+    public boolean canExecute(MHandledMenuItem menuItem,
+            @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection){
+        boolean canExecute = false;
+        DescriptionBase description = null;
+        Object object = selection.getFirstElement();
+       
+        if (object instanceof DescriptionBase) {
+            description = HibernateProxyHelper.deproxy(object, DescriptionBase.class);
+        }
+
+        if ((description.isComputed() || description.isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+            canExecute = false;
+            
+        }else{
+            canExecute = selection.size()==1
+                    &&
+                    (selection.getFirstElement() instanceof DescriptionBase)&& !((DescriptionBase)selection.getFirstElement()).isDefault();;
+                    
+        }
+        menuItem.setVisible(canExecute);
+        return canExecute;
+
+    }
+
+    /**
+        * Added to make the Class more generic and limit the amount of code changes required
+        * @param label
+        * @param event
+        * @param description
+        * @param postOperationEnabled
+        * @return
+        */
+    protected AbstractPostOperation operationCreationInstance(String label, 
+            DescriptionBase<?> description, boolean isDefault, IPostOperationEnabled postOperationEnabled) {
+        return new SetDefaultDescriptionOperation(label, EditorUtil.getUndoContext(), description, isDefault, postOperationEnabled);
+    }
+
+}
index 97a7daf059f67a221f9f24da4474810ec0dd0a14..4afe8f547c29aecb473013c974ecc4a5a2cf4b39 100644 (file)
@@ -15,8 +15,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
@@ -50,7 +50,7 @@ public class AddDerivedUnitFacadeMediaOperation extends AbstractPostTaxonOperati
 
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-               DerivedUnitFacade facade;
+           DerivedUnitFacade facade;
                try {
                    if(specimen instanceof FieldUnit){
                        facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) specimen);
index 63142dc47de4cf98036957b5fb24a82bbb556f85..582d75f979fab20b4722384493532122544dd2a5 100644 (file)
@@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
 import org.eclipse.core.commands.operations.IUndoContext;
 
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.operation.AbstractDescriptionPostOperation;
@@ -34,6 +35,19 @@ public class CreateTaxonDescriptionOperation extends AbstractDescriptionPostOper
 
     @Override
     protected void initDescription(){
+        boolean isFirst = false;
+        boolean defaultExists = false;
+        if (element.getDescriptions() == null || element.getDescriptions().isEmpty()) {
+            isFirst = true;
+        }else {
+            for (DescriptionBase desc:element.getDescriptions()) {
+                if (desc.isDefault()) {
+                    defaultExists = true;
+                    break;
+                }
+            }
+        }
         description = TaxonDescription.NewInstance(element);
+        description.setDefault(isFirst || !defaultExists);
     }
 }
index ddfa372d31fd6f432e42945cbb5aa0bfa9878d38..eff3e67b0ee4953b3e80bd8268416768a904c5b8 100644 (file)
@@ -58,11 +58,11 @@ public class DeleteTaxonDescriptionOperation extends AbstractPostTaxonOperation
            if (monitor != null){
                monitor.worked(20);
            }
-               if (description != null && description.isPersited()){
+               if (description != null && description.isPersisted()){
 //                 element.removeDescription(description);
                    CdmStore.getService(IDescriptionService.class).deleteDescription(description.getUuid());
                        return postExecute(element);
-               }else if (description != null && !description.isPersited()){
+               }else if (description != null && !description.isPersisted()){
                    element.removeDescription(description);
                    return Status.OK_STATUS;
                }
index 1d87533501313927c3e79bece732501eb1f883a9..4b677e7e1acdf432cc43cd7d9d4fd6413b4e2f43 100755 (executable)
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since 4 Mar 2019
  */
 public class DeleteTaxonNameDescriptionOperation extends AbstractPostOperation<TaxonName> {
-    
+
        private final TaxonNameDescription description;
 
     public DeleteTaxonNameDescriptionOperation(String label, IUndoContext undoContext, TaxonNameDescription description,
@@ -41,12 +41,12 @@ public class DeleteTaxonNameDescriptionOperation extends AbstractPostOperation<T
     public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
 
         monitor.worked(20);
-        if (description != null && description.isPersited()){
+        if (description != null && description.isPersisted()){
 //          element.removeDescription(description);
             CdmStore.getService(IDescriptionService.class).deleteDescription(description.getUuid());
             element.removeDescription(description);
             return postExecute(element);
-        }else if (description != null && !description.isPersited()){
+        }else if (description != null && !description.isPersisted()){
             element.removeDescription(description);
             return Status.OK_STATUS;
         }
index 98803f235aad0d6e1e388170c2b2b9ba942b4f84..76a4895cbb2307c56b92515ec81e170694bd8ba0 100644 (file)
@@ -44,25 +44,28 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
        private boolean isCopy;
        private UISynchronize sync;
        private boolean setNameInSource;
-
+       private boolean useDefaultDescription;
+       private boolean addNewCurrentDetermination;
        public MoveDescriptionElementsOperation(String label,
                        IUndoContext undoContext, DescriptionBase targetDescription, DescriptionBase sourceDescription,
                        Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
-                       IPostOperationEnabled postOperationEnabled, UISynchronize sync, boolean setNameInSource) {
+                       IPostOperationEnabled postOperationEnabled, UISynchronize sync, boolean setNameInSource, boolean addNewCurrentDetermination) {
                super(label, undoContext, postOperationEnabled);
                this.targetDescription = targetDescription;
                this.sourceDescription = sourceDescription;
                this.descriptionElements = descriptionElements;
+//             this.useDefaultDescription = useDefaultDescription;
                this.isCopy = isCopy;
                this.sync = sync;
                this.setNameInSource = setNameInSource;
+               this.addNewCurrentDetermination = addNewCurrentDetermination;
                service = CdmStore.getService(IDescriptionService.class);
        }
 
        public MoveDescriptionElementsOperation(String label,
                IUndoContext undoContext, UUID targetTaxonUuid, String moveMessage,
                Collection<DescriptionElementBase> descriptionElements, boolean isCopy,
-               IPostOperationEnabled postOperationEnabled, UISynchronize sync, boolean setNameInSource) {
+               IPostOperationEnabled postOperationEnabled, UISynchronize sync, boolean setNameInSource, boolean useDefaultDescription, boolean addNewCurrentDetermination) {
            super(label, undoContext, postOperationEnabled);
            this.targetTaxonUuid = targetTaxonUuid;
            this.descriptionElements = descriptionElements;
@@ -70,6 +73,8 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
            this.isCopy = isCopy;
            this.sync = sync;
            this.setNameInSource = setNameInSource;
+           this.useDefaultDescription = useDefaultDescription;
+           this.addNewCurrentDetermination = addNewCurrentDetermination;
            service = CdmStore.getService(IDescriptionService.class);
        }
 
@@ -83,12 +88,12 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
                }
                UpdateResult result;
                if(targetDescription == null){
-                       result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetTaxonUuid, moveMessage, isCopy, setNameInSource);
+                       result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetTaxonUuid, moveMessage, isCopy, setNameInSource, useDefaultDescription, addNewCurrentDetermination);
 
                } else {
                    UUID targetDescriptionUuid = targetDescription.getUuid();
                    UUID sourceDescriptionUuid = sourceDescription.getUuid();
-                   if (!targetDescription.isPersited()){
+                   if (!targetDescription.isPersisted()){
                        result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetDescription, isCopy, setNameInSource);
                    }else{
                        result = service.moveDescriptionElementsToDescription(descriptionElementsUuid, targetDescriptionUuid, isCopy, setNameInSource);
index 864c2ff654de5846e894736c09d09819cd9eb91e..be45ffbba64d943c5c01436a2e6be76e46ce809d 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
@@ -47,17 +46,15 @@ public class MoveDescriptionToOtherTaxonOperation extends
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param description a {@link TaxonDescription} object.
         * @param targetTaxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public MoveDescriptionToOtherTaxonOperation(String label,
                        IUndoContext undoContext,
                        TaxonDescription description,
                        TaxonNode targetTaxonNode,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
-            ICdmEntitySessionEnabled cdmEntitySessionEnabled,
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled,
                boolean setNameInSource) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled); // FIXME is this the right constructor ???
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled); // FIXME is this the right constructor ???
                this.description = description;
                this.setNameInSource = setNameInSource;
                this.newAcceptedTaxonNode = targetTaxonNode;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/SetDefaultDescriptionOperation.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/SetDefaultDescriptionOperation.java
new file mode 100644 (file)
index 0000000..fb744e2
--- /dev/null
@@ -0,0 +1,96 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ * <p>SetDefaultDescriptionOperation class.</p>
+ *
+ * @author p.ciardelli
+ * @author k.luther
+ * @created 05.10.2023
+ */
+public class SetDefaultDescriptionOperation extends AbstractPostTaxonOperation {
+
+       /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.descripti"{trunked}</code> */
+       public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive.e4.command.SetDefaultDescription"; //$NON-NLS-1$
+
+       private final DescriptionBase<?> description;
+       private boolean isDefault;
+
+       /**
+        * <p>Constructor for CreateDescriptionElementOperation.</p>
+        *
+        * @param label a {@link java.lang.String} object.
+        * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+        * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+        * @param description a {@link DescriptionBase} object.
+        * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.
+        * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+        */
+       public SetDefaultDescriptionOperation(String label, IUndoContext undoContext,
+               DescriptionBase<?> description, boolean isDefault, IPostOperationEnabled postOperationEnabled) {
+               super(label, undoContext, (Taxon)null, postOperationEnabled);
+
+               this.description = description;
+               this.isDefault = isDefault;
+       }
+
+       
+
+       @Override
+       public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+
+               monitor.worked(20);     
+               if (description instanceof TaxonDescription) {
+                   TaxonDescription taxDescription = (TaxonDescription)description;
+                   Taxon taxon = taxDescription.getTaxon();
+                   for (TaxonDescription desc :taxon.getDescriptions()) {
+                       if (desc.isDefault() && !desc.getUuid().equals(taxDescription.getUuid()) && !taxDescription.isImageGallery()) {
+                           desc.setDefault(false);
+                       }
+                   }
+               }
+               description.setDefault(isDefault);
+               monitor.worked(40);
+
+               return postExecute(description);
+       }
+
+       @Override
+       public IStatus redo(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+
+               description.setDefault(isDefault);
+
+               return postExecute(description);
+       }
+
+       @Override
+       public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+                       throws ExecutionException {
+
+               description.setDefault(!isDefault);
+
+               return postExecute(null);
+       }
+}
index f3875df2b12bce7bb3295d18aea0e8caff94e364..f33427e2e8dad4639647ea4ea70bc1d102ca3343 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
@@ -38,11 +38,11 @@ public class MediaContentProvider implements ITreeContentProvider{
        @Override
     public Object[] getChildren(Object parentElement) {
 
-               if (parentElement instanceof TaxonEditorInputE4 || parentElement instanceof Taxon) {
+               if (parentElement instanceof TaxonEditorInput || parentElement instanceof Taxon) {
 
                        Taxon taxon = null;
-                       if (parentElement instanceof TaxonEditorInputE4){
-                               taxon = ((TaxonEditorInputE4) parentElement).getTaxon();
+                       if (parentElement instanceof TaxonEditorInput){
+                               taxon = ((TaxonEditorInput) parentElement).getTaxon();
                        } else{
                                taxon = HibernateProxyHelper.deproxy(parentElement, Taxon.class);
                        }
index 7592b1764e82495303a1f0d12e609fbb8987d510..4c15100b9e2f95d6da610ad6e4d78551278b0316 100644 (file)
@@ -6,7 +6,6 @@
 * 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.editor.view.media.e4;
 
 import javax.annotation.PostConstruct;
@@ -27,7 +26,7 @@ import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.concept.e4.ConceptViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.media.MediaContentProvider;
@@ -35,17 +34,15 @@ import eu.etaxonomy.taxeditor.editor.view.media.MediaViewLabelProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
 
 /**
- *
  * @author pplitzner
  * @since Aug 14, 2017
- *
  */
-public class MediaViewPartE4 extends AbstractCdmEditorPartE4
+public class MediaViewPartE4 extends AbstractCdmEditorPart<TreeViewer>
         implements IPartContentHasDetails, IPartContentHasSupplementalData {
 
     @PostConstruct
@@ -71,16 +68,15 @@ public class MediaViewPartE4 extends AbstractCdmEditorPartE4
 
         //create context menu
         menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.editor.popupmenu.mediaview");
-
        }
 
     @Override
     public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
-           if(activePart==thisPart){
+           if(activePart == thisPart){
                return;
            }
 
-           Object partObject = createPartObject(activePart);
+           Object partObject = getPartObject(activePart);
 
            if (partObject instanceof DetailsPartE4 || partObject instanceof SupplementalDataPartE4
                    || partObject instanceof FactualDataPartE4 || partObject instanceof ConceptViewPartE4) {
@@ -100,8 +96,8 @@ public class MediaViewPartE4 extends AbstractCdmEditorPartE4
                }
 
                Object firstElement = structuredSelection.getFirstElement();
-               if (partObject instanceof TaxonNameEditorE4){
-                   if (firstElement != ((TaxonNameEditorE4)partObject).getTaxon()){
+               if (partObject instanceof TaxonEditor){
+                   if (firstElement != ((TaxonEditor)partObject).getTaxon()){
                        showEmptyPage();
                        return;
                    }
@@ -120,7 +116,6 @@ public class MediaViewPartE4 extends AbstractCdmEditorPartE4
            return;
        }
 
-       /** {@inheritDoc} */
        @Override
        public void changed(Object object) {
            ((AbstractTreeViewer) viewer).expandToLevel(2);
@@ -136,7 +131,4 @@ public class MediaViewPartE4 extends AbstractCdmEditorPartE4
        protected String getViewName() {
                return Messages.MediaViewPart_MEDIA;
        }
-
-
-
-}
+}
\ No newline at end of file
index f3e2793f8c768fed87cdae969ac24a10df356ecf..3f91e8406b6b9cbc0cf9c4401ab62a776f57e1e4 100644 (file)
@@ -25,8 +25,8 @@ import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
 import eu.etaxonomy.taxeditor.editor.view.media.operation.MoveMediaInListOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -46,11 +46,11 @@ public abstract class AbstractMoveImageHandler {
 
         MediaViewPartE4 mediaView = (MediaViewPartE4) activePart.getObject();
 
-        TaxonNameEditorE4 editor = null;
+        TaxonEditor editor = null;
         Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(mediaView.getSelectionProvidingPart());
-        if (e4WrappedPart instanceof TaxonNameEditorE4) {
-            editor = (TaxonNameEditorE4) e4WrappedPart;
-            TaxonEditorInputE4 input = editor.getEditorInput();
+        if (e4WrappedPart instanceof TaxonEditor) {
+            editor = (TaxonEditor) e4WrappedPart;
+            TaxonEditorInput input = editor.getEditorInput();
             Taxon taxon =input.getTaxon();
 
             TreeSelection selection = (TreeSelection) mediaView.getViewer().getSelection();
index 938439dba9f0fd30803b1c4575ade344319eacf0..8c1ee2e4a633bbf7637cc2352a0c7467f4500441 100644 (file)
@@ -40,7 +40,7 @@ import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteSpecimenDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteTaxonDescriptionOperation;
 import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
@@ -78,13 +78,13 @@ public class DeleteMediaHandler  {
 
             if(object instanceof Media){
                 // TODO use undo context specific to editor
-                if (!((Media)object).isPersited()){
+                if (!((Media)object).isPersisted()){
                     Set<DescriptionElementBase> elements = description.getElements();
                     if (elements.size() == 1){
                           DescriptionElementBase element = elements.iterator().next();
                           Set<Media> toDelete = new HashSet<>();
                           element.removeMedia((Media)object);
-                          ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+                          ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).redraw();
                           return;
 
                     }
@@ -110,8 +110,8 @@ public class DeleteMediaHandler  {
 //                        containsPersistedMedia = element.getMedia().isEmpty();
                         if (element.getMedia() != null && !element.getMedia().isEmpty()){
                             for (Media media: element.getMedia()){
-                                containsPersistedMedia |= media.isPersited();
-                                if (media.isPersited()){
+                                containsPersistedMedia |= media.isPersisted();
+                                if (media.isPersisted()){
                                     mediaList.add(media);
                                 }
                             }
@@ -133,11 +133,11 @@ public class DeleteMediaHandler  {
                 if(object instanceof TaxonDescription){
 
                     DeleteTaxonDescriptionOperation deleteTaxonDescriptionOperation = new DeleteTaxonDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (TaxonDescription)object, mediaView, null);
-                    if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getTaxon().removeDescription((TaxonDescription)description);
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(deleteTaxonDescriptionOperation);
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+                    if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonEditor){
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).getTaxon().removeDescription((TaxonDescription)description);
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(deleteTaxonDescriptionOperation);
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).setDirty();
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).redraw();
 
                      }else{
                          AbstractUtility.executeOperation(deleteTaxonDescriptionOperation, sync);
@@ -145,10 +145,10 @@ public class DeleteMediaHandler  {
                 }
                 else if(object instanceof SpecimenDescription){
                     DeleteSpecimenDescriptionOperation deleteTaxonDescriptionOperation = new DeleteSpecimenDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (SpecimenDescription)object, mediaView, null);
-                    if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(deleteTaxonDescriptionOperation);
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
-                        ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+                    if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonEditor){
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(deleteTaxonDescriptionOperation);
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).setDirty();
+                        ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).redraw();
                      }else{
                          AbstractUtility.executeOperation(deleteTaxonDescriptionOperation, sync);
                      }
@@ -160,9 +160,9 @@ public class DeleteMediaHandler  {
     public void createMediaDeleteOperation(String menuLabel, UISynchronize sync, MediaViewPartE4 mediaView,
             List<Media> media, DescriptionBase<?> description, MediaDeletionConfigurator config) {
         AbstractPostOperation<?> operation = new DeleteMediaOperation(menuLabel, EditorUtil.getUndoContext(), description, media, config, mediaView);
-        if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonNameEditorE4){
+        if (mediaView.getSelectionProvidingPart().getObject() instanceof TaxonEditor){
             if (!config.isOnlyRemoveFromGallery()){
-                ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
+                ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).getEditorInput().addOperation(operation);
             }
 
             if (description.isImageGallery()){
@@ -179,8 +179,8 @@ public class DeleteMediaHandler  {
                 }
             }
 
-          ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).setDirty();
-          ((TaxonNameEditorE4)mediaView.getSelectionProvidingPart().getObject()).redraw();
+          ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).setDirty();
+          ((TaxonEditor)mediaView.getSelectionProvidingPart().getObject()).redraw();
         }else{
             AbstractUtility.executeOperation(operation, sync);
         }
index 4076b6ba2b852ffb4ca8183c86ef499a6351423b..149599aaec99f75e037f1a7cb3803ce1c6297aa7 100644 (file)
@@ -28,7 +28,6 @@ import eu.etaxonomy.taxeditor.editor.view.descriptive.e4.FactualDataPartE4;
 import eu.etaxonomy.taxeditor.editor.view.uses.UsesContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.uses.UsesLabelProvider;
 
-
 /**
  * @author pplitzner
  * @since Sep 8, 2017
index acce05b0a03247443637ac2ada1b19357f9a4ed7..8754e2d7a00167ec35339604cf6ee02a17764215 100644 (file)
@@ -1,29 +1,25 @@
 /**
 * 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.editor.name.operation;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
-import eu.etaxonomy.cdm.model.name.INonViralName;
-import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
@@ -32,76 +28,59 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
  * @created 07.04.2009
  */
 public class ChangeConceptToSynonymOperationTest extends AbstractTaxeditorOperationTestBase {
-       private static final Logger logger = LogManager.getLogger(ChangeConceptToSynonymOperationTest.class);
-       
+
+    private static final Logger logger = LogManager.getLogger();
+
        private static Taxon taxon;
-       
+
        private static Taxon concept;
 
-       private static AbstractPostOperation operation;
+       private static AbstractPostOperation<?> operation;
 
        private static HomotypicalGroup homotypicalGroup;
-       
+
        private Synonym[] synonymType = new Synonym[0];
        private Taxon[] taxonType = new Taxon[0];
-       
-       /**
-        * @throws java.lang.Exception
-        */
+
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
                taxon = Taxon.NewInstance(null, null);
                concept = Taxon.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
                homotypicalGroup = HomotypicalGroup.NewInstance();
-               
+
                concept.addTaxonRelation(taxon, TaxonRelationshipType.MISAPPLIED_NAME_FOR(), null, null);
-               
+
                operation = new ChangeConceptToSynonymOperation("Change misapplication to synonym", null, taxon, concept, homotypicalGroup, postOperation);
        }
 
-       /**
-        * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
-        */
        @Test
        public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
                operation.execute(null, null);
-               
+
                Assert.assertTrue(taxon.getSynonyms().size() == 1);
                Assert.assertTrue(concept.getRelationsFromThisTaxon().size() == 0);
                Assert.assertEquals(concept.getName(), taxon.getSynonyms().toArray(synonymType)[0].getName());
-               
+
        }
 
-       /**
-        * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
-        */
        @Test
        public void testUndoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.undo(null, null);
-               
+
                Assert.assertTrue("There shouldn't be synonyms after undo operations", taxon.getSynonyms().size() == 0);
                Assert.assertTrue(concept.getRelationsFromThisTaxon().size() > 0);
                Assert.assertEquals(taxon, concept.getRelationsFromThisTaxon().toArray(taxonType)[0]);
        }
-       
-       /**
-        * Test method for {@link eu.etaxonomy.taxeditor.editor.name.operation.ChangeConceptToSynonymOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)}.
-        * @throws ExecutionException 
-        */
+
        @Test
        public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.redo(null, null);
-               
+
                Assert.assertTrue(taxon.getSynonyms().size() == 1);
                Assert.assertTrue(concept.getRelationsFromThisTaxon().size() == 0);
                Assert.assertEquals(concept.getName(), taxon.getSynonyms().toArray(synonymType)[0].getName());
        }
 
-       /**
-        * Test method for {@link eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation#postExecute(ICdmBase)}.
-        */
        @Test
        public void testPostExecute() {
                // TODO there is not post operation functionality for this class
index efcda00fb37b47b55b74b7b58acc798a7e8b7b28..c587a369ec43fdd21f7d153e5401bde02838e43e 100644 (file)
@@ -1,27 +1,26 @@
 /**
 * 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.editor.name.operation;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToConceptOperation;
 import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBase;
 
 /**
@@ -29,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
  * @created 07.04.2009
  */
 public class ChangeSynonymToConceptOperationTest extends AbstractTaxeditorOperationTestBase{
-       
+
        private static final Logger logger = LogManager.getLogger(ChangeSynonymToConceptOperationTest.class);
 
        private static TaxonRelationshipType taxonRelationshipType;
@@ -37,20 +36,20 @@ public class ChangeSynonymToConceptOperationTest extends AbstractTaxeditorOperat
 
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
-               
+
                taxon = Taxon.NewInstance(null, null);
                synonym = Synonym.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
                taxonRelationshipType = TaxonRelationshipType.CONTRADICTION();
-               
-               taxon.addSynonym(synonym, SynonymType.SYNONYM_OF());
-               
+
+               taxon.addSynonym(synonym, SynonymType.SYNONYM_OF);
+
                operation = new ChangeSynonymToConceptOperation("Change Synonym To Concept", null, taxon, synonym, taxonRelationshipType, postOperation);
        }
 
        @Test
        public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
                operation.execute(monitor, info);
-               
+
                Assert.assertTrue("Synonym should be deleted from taxon.", taxon.getSynonyms().size() == 0);
                Assert.assertTrue("Taxon should have taxon relationships now.", taxon.getRelationsToThisTaxon().size() > 0);
                Assert.assertEquals("Relationship is not the expected", taxonRelationshipType, taxon.getTaxonRelations().toArray(new TaxonRelationship[0])[0].getType());
@@ -60,16 +59,16 @@ public class ChangeSynonymToConceptOperationTest extends AbstractTaxeditorOperat
        @Test
        public void testUndoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.undo(monitor, info);
-               
+
                Assert.assertTrue("There should be synonyms now.", taxon.getSynonyms().size() > 0);
                Assert.assertEquals("Synonym is not the expected.", synonym, taxon.getSynonyms().toArray(new Synonym[0]));
                Assert.assertTrue("There should not be taxon relationships.", taxon.getRelationsToThisTaxon().size() == 0);
        }
-       
+
        @Test
        public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.redo(monitor, info);
-                               
+
                Assert.assertTrue("Synonym should be deleted from taxon.", taxon.getSynonyms().size() == 0);
                Assert.assertTrue("Taxon should have taxon relationships now.", taxon.getRelationsToThisTaxon().size() > 0);
                Assert.assertEquals("Relationship is not the expected", taxonRelationshipType, taxon.getTaxonRelations().toArray(new TaxonRelationship[0])[0].getType());
index 35753478f8a72d58437650fd8f7281bf91c0c532..e24d6dc0f78dae870293e4a1643fdcca637b134a 100644 (file)
@@ -1,20 +1,20 @@
 /**
 * 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.editor.name.operation;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymType;
@@ -27,29 +27,29 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
  * @created 07.04.2009
  */
 public class ChangeSynonymToMisapplicationOperationTest extends AbstractTaxeditorOperationTestBase {
-       
+
        private static final Logger logger = LogManager.getLogger(ChangeSynonymToMisapplicationOperationTest.class);
 
        private static AbstractPostOperation<Taxon> operation;
-       
+
        private static Synonym synonym;
        private static Taxon taxon;
        private static SynonymType synonymType;
-       
+
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
                taxon = Taxon.NewInstance(null, null);
                synonym = Synonym.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
-               synonymType = SynonymType.SYNONYM_OF();
+               synonymType = SynonymType.SYNONYM_OF;
                taxon.addSynonym(synonym, synonymType);
-               
+
                operation = new ChangeSynonymToMisapplicationOperation("Change Synonym To Misapplication", null, taxon, synonym, postOperation);
        }
 
        @Test
        public void testExecuteIProgressMonitorIAdaptable() throws ExecutionException {
                operation.execute(null, null);
-               
+
                Assert.assertTrue("Synonym should be deleted from taxon", taxon.getSynonyms().size() == 0);
                Assert.assertTrue("Taxon should have misapplications", taxon.getMisappliedNames(false).size() > 0);
                Assert.assertEquals("The name of synonym and misapplication should be equal", synonym.getName(), taxon.getMisappliedNames(false).toArray(new Taxon[0])[0].getName());
@@ -58,13 +58,13 @@ public class ChangeSynonymToMisapplicationOperationTest extends AbstractTaxedito
        @Test
        public void testUndoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.undo(null, null);
-               
+
                Assert.assertTrue("Taxon should have synonyms.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should not have taxon relationship.", taxon.getTaxonRelations().size() == 0);
                Assert.assertEquals("Not the expected synonym.", synonym, taxon.getSynonyms().toArray(new Synonym[0])[0]);
                Assert.assertEquals("SynonymType is not the expected.", synonymType, taxon.getSynonyms().iterator().next().getType());
        }
-       
+
        @Test
        public void testRedoIProgressMonitorIAdaptable() throws ExecutionException {
                operation.redo(null, null);
index bccb64ed8168a5641ad3e893aed80ccc9cc8c9a8..a5c80dd864121f22b3a5e760a7d4fbc739e5e90f 100644 (file)
@@ -80,7 +80,7 @@ public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends Abstr
 
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic group", taxon.getHomotypicSynonymyGroups().size() > 0);
-               Assert.assertEquals("Synonym relationship should be heterotypic", SynonymType.HETEROTYPIC_SYNONYM_OF(), taxon.getSynonyms().iterator().next().getType());
+               Assert.assertEquals("Synonym relationship should be heterotypic", SynonymType.HETEROTYPIC_SYNONYM_OF, taxon.getSynonyms().iterator().next().getType());
        }
 
 
@@ -138,7 +138,7 @@ public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends Abstr
 
                Assert.assertTrue("Taxon should have a synonym now.", taxon.getSynonyms().size() > 0);
                Assert.assertTrue("Taxon should have a homotypic group", taxon.getHomotypicSynonymyGroups().size() > 0);
-               Assert.assertEquals("Synonym relationship should be heterotypic", SynonymType.HETEROTYPIC_SYNONYM_OF(), taxon.getSynonyms().iterator().next().getType());
+               Assert.assertEquals("Synonym relationship should be heterotypic", SynonymType.HETEROTYPIC_SYNONYM_OF, taxon.getSynonyms().iterator().next().getType());
 
        }
 }
index d5b26cd1c3488c25e743f815b2a004e02b09c369..e6a8dcc21bea66a7662d4a89566b070f8db446b6 100644 (file)
@@ -37,7 +37,7 @@ public class DeleteMisapplicationOperationTest extends AbstractTaxeditorOperatio
 
                taxon.addMisappliedName(misapplication, null, null);
 
-               operation = new DeleteMisapplicationOperation("", undoContext, null, taxon, misapplication, postOperation,  null, null);
+               operation = new DeleteMisapplicationOperation("", undoContext, null, taxon, misapplication, postOperation,  null);
 
        }
 
index d46fe5849eccbc703df385e56870de73f3f5bc5a..0eb1b8248fe4c66aa4675c16af23247af9c84c07 100644 (file)
@@ -29,18 +29,15 @@ public class DeleteSynonymOperationTest extends AbstractTaxeditorOperationTestBa
 
        private static SynonymType synonymType;
 
-       /**
-        * @throws java.lang.Exception
-        */
        @BeforeClass
        public static void setUpBeforeClass() throws Exception {
                taxon = Taxon.NewInstance(null, null);
                synonym = Synonym.NewInstance(null, null);
-               synonymType = SynonymType.SYNONYM_OF();
+               synonymType = SynonymType.SYNONYM_OF;
 
                taxon.addSynonym(synonym, synonymType);
 
-               operation = new DeleteSynonymOperation("", undoContext, new SynonymDeletionConfigurator(), taxon,synonym, postOperation, null, null);
+               operation = new DeleteSynonymOperation("", undoContext, new SynonymDeletionConfigurator(), taxon,synonym, postOperation, null);
 
        }
 
index 0c5d45831f76d7cafceeb84ccd073801218df6bd..6f4dfdbbd068076e907ae6e80000b12fb4bb24ca 100644 (file)
@@ -35,7 +35,7 @@ import eu.etaxonomy.taxeditor.store.operations.AbstractTaxeditorOperationTestBas
  */
 public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperationTestBase {
 
-    private static final Logger logger = LogManager.getLogger(SwapSynonymAndAcceptedOperationTest.class);
+    private static final Logger logger = LogManager.getLogger();
 
        private static SwapSynonymAndAcceptedOperation operation;
 
@@ -97,7 +97,7 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
 //             oldTaxon.addS .addHeterotypicSynonym(oldHeterotypicSynonym, null, null);
                heteroypicalGroup = HomotypicalGroup.NewInstance();
                heteroypicalGroup.addTypifiedName(oldHeterotypicSynonym.getName());
-               taxon.addSynonym(oldHeterotypicSynonym, SynonymType.HETEROTYPIC_SYNONYM_OF());
+               taxon.addSynonym(oldHeterotypicSynonym, SynonymType.HETEROTYPIC_SYNONYM_OF);
 
                // Create a misapplication
                misapplication = Taxon.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
index a1836808a9e1d6928ac2208b2075f62009fd96a1..878760c7f3849eabd1792476ba622bbc8ad82ccf 100644 (file)
@@ -2,7 +2,7 @@
 <feature\r
       id="eu.etaxonomy.taxeditor.feature.platform"\r
       label="Taxeditor Dependencies"\r
-      version="5.33.0"\r
+      version="5.42.0"\r
       os="linux,macosx,win32"\r
       ws="cocoa,gtk,win32"\r
       arch="x86,x86_64">\r
index d5b32aa2b30fa9f9b732243207798fee30c476d9..5909db0ec6ff4eb6668a1c1cb17255df87b1c507 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>5.33.0</version>
+               <version>5.42.0</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
index e9e4db7776d8023ad816078690c7dd3a8e34b4f4..aeed40ddbcb9162f5f8858ab711cb776829cbaff 100644 (file)
@@ -2,7 +2,7 @@
 <feature\r
       id="eu.etaxonomy.taxeditor.feature"\r
       label="Taxonomic Editor"\r
-      version="5.33.0"\r
+      version="5.42.0"\r
       provider-name="EDIT"\r
       plugin="eu.etaxonomy.taxeditor.application"\r
       os="linux,macosx,win32"\r
index 8a6b7ec13fa9dd695e9da7333fe6d785dbb69d6f..ce99e556cd9c340bfce529c750cb8123c67803ba 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
index f12f1d3d900a0492618b845b5f1410d448e2e425..e3f1b7ec6e910ce7f5f52b3cb546e1c7587ee917 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Help
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
 Bundle-Vendor: EDIT
 Require-Bundle: org.eclipse.ui,
index 6ac45c75f47addca0966ac54c2a8312457759cc1..adcfa6640fea1d1146195c40b5de65d147a4ee28 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>5.33.0</version>
+               <version>5.42.0</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index ff0b393b56865f3ffdefb285606c6bd7eb06a924..2324c191fb2f553a0e1999edf32cdc4ab9a00ba2 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Local
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.local;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.jface,
  org.eclipse.ui.ide,
@@ -24,7 +24,7 @@ Bundle-ClassPath: .,
  lib/c3p0-0.9.5.2.jar,
  lib/h2-1.4.190.jar,
  lib/mchange-commons-java-0.2.11.jar,
- lib/postgresql-42.3.6.jar,
+ lib/postgresql-42.5.1.jar,
  lib/mssql-jdbc-9.4.1.jre8.jar,
  lib/jtds-1.3.1.jar,
  lib/mysql-connector-java-8.0.29.jar,
@@ -40,6 +40,7 @@ Bundle-Vendor: EDIT
 Import-Package: javax.annotation;version="1.2.0",
  eu.etaxonomy.cdm.api.application,
  eu.etaxonomy.cdm.api.service,
+ eu.etaxonomy.cdm.api.service.geo,
  eu.etaxonomy.cdm.cache,
  eu.etaxonomy.cdm.common,
  eu.etaxonomy.cdm.common.monitor,
index 41b9c06b5a25b8f2393fdf6cae5d334435f8c9ae..011efa7f535802ba1bdd397f71c39e64efb87a2a 100644 (file)
@@ -5,7 +5,7 @@ bin.includes = META-INF/,\
                lib/,\
                lib/h2-1.4.190.jar,\
                lib/mchange-commons-java-0.2.11.jar,\
-               lib/postgresql-42.3.6.jar,\
+               lib/postgresql-42.5.1.jar,\
                lib/mssql-jdbc-9.4.1.jre8.jar,\
                lib/jtds-1.3.1.jar,\
                lib/mysql-connector-java-8.0.29.jar,\
old mode 100755 (executable)
new mode 100644 (file)
index 36a7ec5..5779763
@@ -32,7 +32,7 @@
     <elements xsi:type="application:Addon" xmi:id="_q4JBkJFJEeeDJpjGQES7gw" elementId="eu.etaxonomy.taxeditor.event.EventUtility" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.event.EventUtility"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_mNW70LMnEeeMU61m8yqdaA" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.referencing">
-    <elements xsi:type="menu:HandledMenuItem" xmi:id="_mNW72bMnEeeMU61m8yqdaA" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.datasource" label="Datasource" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/system-file-manager.png" tooltip="%command.label.2" command="_bnVKsCZxEeeQLpuomSmVoQ">
+    <elements xsi:type="menu:HandledMenuItem" xmi:id="_mNW72bMnEeeMU61m8yqdaA" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.datasource" visible="false" label="Datasource Test" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/system-file-manager.png" tooltip="%command.label.2" enabled="false" command="_bnVKsCZxEeeQLpuomSmVoQ">
       <parameters xmi:id="_mNW72rMnEeeMU61m8yqdaA" elementId="eu.etaxonomy.taxeditor.webapp.showView.parameter.dataSourceView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.datasource"/>
     </elements>
   </fragments>
index 78bb7d2a56d1fcbfd88ac8986eb40cf9847c49ab..c013d739cfb7e8b70dea1785fe260aa36a1bb6c3 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>eu.etaxonomy.taxeditor.local</artifactId>
index bc5d4691ac89777b30ed4f29be5c5218b2557134..d77f333502cf126aff94e4333fa801c4d8b002c4 100755 (executable)
@@ -42,7 +42,6 @@ public class SwitchUserHandlerE4 {
         String partId = "eu.etaxonomy.taxeditor.navigation.navigator";
         for (MPart part : parts) {
             partService.hidePart(part);
-
         }
 
                RemotingLoginDialogLocal loginDialog = new RemotingLoginDialogLocal(shell,
index 8db6f2638099a77c53fbfe0e85a2b98db9c25cba..2a5131ab8c9ac69d7305ec501b959dc971f896c0 100755 (executable)
@@ -6,7 +6,6 @@
  * 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.local.server;
 
 import java.lang.reflect.InvocationTargetException;
@@ -21,13 +20,11 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.Resource;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.config.CdmSourceException;
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
-import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
@@ -45,7 +42,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.LoginManager;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
-
 /**
  * @author n.hoffmann
  * @created Dec 8, 2010
@@ -60,6 +56,7 @@ public class CdmStoreConnectorLocal extends Job {
             ICdmSource cdmSource,
             DbSchemaValidation dbSchemaValidation,
             Resource applicationContextBean) {
+
         super(String.format(Messages.CdmStoreConnector_CREATING_DATAMODEL, cdmSource));
         this.display = display;
         this.cdmSource = cdmSource;
@@ -135,6 +132,7 @@ public class CdmStoreConnectorLocal extends Job {
 
         try {
             dialog.run(true, true, new IRunnableWithProgress() {
+
                 @Override
                 public void run(final IProgressMonitor monitor) {
                     try {
@@ -163,18 +161,18 @@ public class CdmStoreConnectorLocal extends Job {
                             }
                         });
 
-                        ICdmRepository applicationController = null;
+                        CdmApplicationRemoteController applicationController = null;
 
                         if (!monitor.isCanceled()) {
                             CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
                                     .CreateSubMonitor(monitor, 3);
                             // genrerate new application controller
-                            applicationController = getApplicationController(cdmSource,subprogressMonitor);
+                            applicationController = getApplicationController(cdmSource, subprogressMonitor);
                         }
 
                         if (!monitor.isCanceled()) {
-                            CdmStoreLocal.setInstance(applicationController, cdmSource);
-                            CdmStoreLocal.getTermManager().reset();
+                            CdmStore.setInstance(applicationController, cdmSource);
+                            CdmStore.getTermManager().reset();
                             monitor.subTask(Messages.CdmStoreConnector_AUTHENTICATING_USER);
                             display.syncExec(()-> {
                                 try {
@@ -210,14 +208,8 @@ public class CdmStoreConnectorLocal extends Job {
         }
     }
 
-    private ICdmRepository getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
-        if(cdmSource instanceof ICdmDataSource) {
-            return  CdmApplicationController.NewInstance(applicationContextBean,
-                    (ICdmDataSource)cdmSource,
-                    dbSchemaValidation,
-                    false,
-                    subprogressMonitor);
-        } else if(cdmSource instanceof ICdmRemoteSource) {
+    private CdmApplicationRemoteController getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
+        if(cdmSource instanceof ICdmRemoteSource) {
             return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
                     subprogressMonitor,
                     null);
index 0226656f2e55cac27552eaf274e0baa87921b192..79e6b07c3a3e3f1db9d1facd520db6d9e349320c 100755 (executable)
@@ -12,7 +12,7 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.Resource;
 
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.cache.CdmRemoteCacheManager;
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
@@ -20,7 +20,6 @@ import eu.etaxonomy.taxeditor.local.CdmServer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
-
 /**
  * @author k.luther
  * @since Sep 18, 2020
@@ -29,21 +28,13 @@ public class CdmStoreLocal extends CdmStore {
 
     protected static CdmStoreConnectorLocal job;
     private static CdmServer managedServer;
-    /**
-     * @param repository
-     * @param cdmSource
-     */
-    protected CdmStoreLocal(ICdmRepository repository, ICdmSource cdmSource) {
+
+    protected CdmStoreLocal(CdmApplicationRemoteController repository, ICdmSource cdmSource) {
         super(repository, cdmSource);
-        // TODO Auto-generated constructor stub
     }
 
-
     /**
      * Initialize with a specific datasource
-     *
-     * @param datasource
-     *            a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
      */
     public static void connect(ICdmSource cdmSource) {
         connect(cdmSource, DEFAULT_DB_SCHEMA_VALIDATION,
@@ -59,10 +50,6 @@ public class CdmStoreLocal extends CdmStore {
 
     /**
      * Initialize and provide
-     *
-     * @param datasource
-     * @param dbSchemaValidation
-     * @param applicationContextBean
      */
     private static void connect(final ICdmSource cdmSource,
             final DbSchemaValidation dbSchemaValidation,
index 30badca514d35cc9951d074678c3d583499b6f3e..a106c3a4eea77f77630b4564585d8914e939a372 100755 (executable)
@@ -10,22 +10,16 @@ package eu.etaxonomy.taxeditor.local.server;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.SocketTimeoutException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
@@ -34,8 +28,6 @@ import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -51,16 +43,7 @@ import org.eclipse.ui.forms.events.IExpansionListener;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.progress.IProgressConstants;
 import org.eclipse.wb.swt.SWTResourceManager;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.LockedException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
-import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.service.IUserService;
-import eu.etaxonomy.cdm.common.CdmUtils;
+
 import eu.etaxonomy.cdm.config.CdmSourceException;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.persistence.permission.Role;
@@ -70,14 +53,10 @@ import eu.etaxonomy.taxeditor.local.CdmServer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.remoting.server.CdmServerException;
 import eu.etaxonomy.taxeditor.remoting.server.CdmServerUtils;
-import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteLocalhostSource;
 import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
 import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo.CdmInstanceInfo;
-import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.LoginManager;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
 
@@ -89,58 +68,6 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
 
     private Logger logger = LogManager.getLogger(getClass());
 
-//    protected Shell shlConnect;
-//    private Text txtCdmServerStatus;
-//    private Text txtCdmInstanceStatus;
-//
-//    private Button btnConnect;
-//
-//    private Composite remotingComposite;
-//    private Button btnCdmServerRefresh;
-//    private Button btnCdmInstanceRefresh;
-//    private Button btnStopServer;
-//    private Composite loginComposite;
-//    private Label lblLogin;
-//    private Text txtLogin;
-//    private Label lblPassword;
-//    private Text txtPassword;
-//    private Button btnRememberMe;
-//    private Label lblDefaultLogin;
-//    private Composite compAdvanced;
-//    private Label lblPort;
-//    private Text txtPort;
-//    private Label lblServerCdmlibVersion;
-//    private Text txtServerCdmlibVersion;
-//    private ExpandableComposite expandableCompositeAdvanced;
-//    private StyledText styledTxtMessage;
-//
-//    private Label lblEditorCdmlibVersion;
-//    private Text txtEditorCdmlibVersion;
-//    private Label lblServerSchemaVersion;
-//    private Text txtServerSchemaVersion;
-//    private Label lblEditorCdmVersion;
-//    private Text txtEditorCdmVersion;
-//
-//    private final int MESSAGE_HEIGHT = 50;
-//    private final int COMBO_MIN_WIDTH =200;
-//    private final int CONTROLS_MIN_HEIGHT = 23; //does not seem to work yet
-////  private final int MIN_EXP_HEIGHT = 380;
-//
-//    private boolean autoConnect = false;
-//    private boolean loadLoginPrefs = true;
-//    private boolean isDevRemoteSource = false;
-
-//    private Job serverJob;
-//    protected Object result;
-//
-//    private final Map<String, CdmServerInfo> serverInfoMap = new HashMap<>();
-
-//    private String serverName;
-//    private String instanceName;
-//    private CdmServerInfo selectedServerInfo;
-//    private CdmInstanceInfo selectedCdmInstance;
-//    private String login;
-//    private String password;
 
     /**
      * Create the dialog.
@@ -149,66 +76,10 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
      */
     public RemotingLoginDialogLocal(Shell parent, int style) {
         super(parent, style);
-        setText(Messages.RemotingLoginDialog_LABEL_LOGIN);
+        //setText(Messages.RemotingLoginDialog_LABEL_LOGIN);
         this.isLocal = true;
     }
 
-
-    @Override
-    public Object open(ICdmRemoteSource source, boolean loadLoginPrefs, boolean autoConnect) {
-        this.loadLoginPrefs = loadLoginPrefs;
-        this.serverName = source.getName();
-        if (source instanceof CdmRemoteLocalhostSource){
-            this.instanceName = ((CdmRemoteLocalhostSource)source).getDatasourceName();
-        }else{
-            String contextPath = source.getContext();
-            this.instanceName = contextPath == null? "" : contextPath.substring(contextPath.lastIndexOf("/") + 1); //$NON-NLS-1$
-        }
-        return open(serverName, instanceName, loadLoginPrefs, autoConnect);
-    }
-
-
-    @Override
-    public Object open(String serverName, String instanceName, boolean loadLoginPrefs, boolean autoConnect) {
-        this.serverName = serverName;
-        this.instanceName = instanceName;
-        this.loadLoginPrefs = loadLoginPrefs;
-        this.autoConnect = autoConnect;
-        return open();
-    }
-
-    /**
-     * Open the dialog.
-     * @return the dialog result
-     */
-
-    @Override
-    public Object open() {
-
-        createContents();
-        if(serverName == null && instanceName == null) {
-            readPrefLastServerInstance();
-        }
-        expandableCompositeAdvanced.setExpanded(false);
-
-        setEditorInfo();
-        populateCdmServerCombo();
-        shlConnect.pack(true);
-
-        setCenterPoint();
-        shlConnect.open();
-
-        Display display = getParent().getDisplay();
-        while (!shlConnect.isDisposed()) {
-            if (!display.isDisposed()){
-                if (!display.readAndDispatch()) {
-                    display.sleep();
-                }
-            }
-        }
-        return result;
-    }
-
     /**
      * Create contents of the dialog.
      */
@@ -451,31 +322,16 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
         txtEditorCdmVersion = new Text(compAdvanced, SWT.BORDER);
         txtEditorCdmVersion.setEditable(false);
         txtEditorCdmVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-    }
-
 
-    @Override
-    public void setCenterPoint() {
-        Rectangle parentSize = getParent().getBounds();
-        Rectangle shellSize = shlConnect.getBounds();
-        int locationX = (parentSize.width - shellSize.width)/2+parentSize.x;
-        int locationY = (parentSize.height - shellSize.height)/2+parentSize.y;
-        shlConnect.setLocation(new Point(locationX, locationY));
 
+        this.comboCdmServer.setEnabled(this.allowServerChange);
+        this.comboCdmInstance.setEnabled(this.allowInstanceChange);
     }
 
 
 
 
 
-
-    @SuppressWarnings("unused")
-    private void addEmptyCells(int cnt) {
-        for (int i = 0; i < cnt; i++) {
-            new Label(compAdvanced, SWT.NONE);
-        }
-    }
-
        @Override
     protected void onConnectButtonPressed() {
                if(selectedServerInfo.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
@@ -488,238 +344,7 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
                }
        }
 
-//    private void populateCdmServerCombo() {
-//        Job job = new Job(Messages.RemotingLoginDialog_RETRIEVE_SERVER_INSTANCES) {
-//            @Override
-//            protected IStatus run(IProgressMonitor monitor) {
-//                Display.getDefault().syncExec(new Runnable() {
-//                    @Override
-//                    public void run() {
-//                        //TODO performance
-//                        for(CdmServerInfo csii : CdmServerInfo.getCdmServers(true)) {
-//                            serverInfoMap.put(csii.getName(), csii);
-//                            comboCdmServer.add(csii.getName());
-//                        }
-//                        int serverIndex = -1;
-//                        if(serverName != null) {
-//                            serverIndex = comboCdmServer.indexOf(serverName);
-//                        }
-//                        if(serverIndex == -1) {
-//                            comboCdmServer.select(0);
-//                            autoConnect = false;
-//                        } else {
-//                            comboCdmServer.select(serverIndex);
-//                        }
-//                        ICdmSource devRemoteSource = CdmServerInfo.getDevServerRemoteSource();
-//                        if(devRemoteSource != null) {
-//                            isDevRemoteSource = true;
-//                            String username = System.getProperty("cdm.server.dev.username"); //$NON-NLS-1$
-//                            String password = System.getProperty("cdm.server.dev.password"); //$NON-NLS-1$
-//                            if(username != null && !username.isEmpty() && password != null && !password.isEmpty()) {
-//                                txtLogin.setText(username);
-//                                txtPassword.setText(password);
-//                                CdmStoreLocal.connect(devRemoteSource, RemotingLoginDialogLocal.this);
-//                            }
-//                        } else {
-//                            onRefreshCdmServer();
-//                        }
-//                    }
-//                });
-//                return Status.OK_STATUS;
-//            }
-//        };
-//        job.schedule();
-//    }
-
-    @Override
-    public void onRefreshCdmServer() {
-        try{
-            txtCdmServerStatus.setText(STATUS_CHECKING_AVAILABILITY);
-            clearOnServerChange();
-            emptyCredentials();
-            updateSelectedCdmServer();
-            Display.getDefault().asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    checkSelectedCdmServer();
-                }
-            });
-        }
-        catch(SWTException e){
-            //catch widget is disposed exception which may occur if
-            //dialog is closed but the runnable tries to update
-        }
-    }
-
-    @Override
-    protected void updateSelectedCdmServer() {
-        int selIndex = comboCdmServer.getSelectionIndex();
-        if(selIndex != -1) {
-            selectedServerInfo = serverInfoMap.get(comboCdmServer.getItem(selIndex));
-        }
-    }
-
-    @Override
-    protected void updatePort() {
-        txtPort.setText(""); //$NON-NLS-1$
-        if(selectedServerInfo != null) {
-            int port = selectedServerInfo.getPort();
-            if(port == CdmServerInfo.NULL_PORT) {
-                txtPort.setText(CdmServerInfo.NULL_PORT_STRING);
-            } else {
-                txtPort.setText(String.valueOf(port));
-            }
-        }
-    }
-
-    @Override
-    protected int getPort() {
-        int port = CdmServerInfo.NULL_PORT;
-        try {
-            port = Integer.valueOf(txtPort.getText());
-        } catch (NumberFormatException nfe) {
-            if(!CdmServerInfo.NULL_PORT_STRING.equals(txtPort.getText())) {
-                setMessage(Messages.RemotingLoginDialog_MESSAGE_PORT_SHOULD_BE_INTEGER);
-            }
-        }
-        return port;
-    }
-
-    private void checkSelectedCdmServer() {
-        try{
-            if(selectedServerInfo != null) {
-                if(selectedServerInfo.isLocalhost()) {
-                    txtPort.setEditable(true);
-                    txtPort.setEnabled(true);
-                }
-                try {
-                    if(selectedServerInfo.pingServer()) {
-                        txtCdmServerStatus.setText(STATUS_AVAILABLE);
-                        populateCdmInstanceCombo(true);
-                        if(selectedServerInfo.isLocalhost()){
-                            setCdmlibVersion(txtServerCdmlibVersion);
-                        }else{
-                            String serverVersionTimestamp = generateLastModifiedTooltip(selectedServerInfo.getCdmlibLastModified());
-                            txtServerCdmlibVersion.setText(selectedServerInfo.getCdmlibServicesVersion() + ":" + serverVersionTimestamp); //$NON-NLS-1$
-                        }
-                    } else {
-                        txtCdmServerStatus.setText(STATUS_NOT_AVAILABLE);
-                        comboCdmInstance.removeAll();
-                        disableCdmInstanceControls("", ""); //$NON-NLS-1$ //$NON-NLS-2$
-                    }
-                } catch (CdmServerException | IOException e) {
-                    txtCdmServerStatus.setText(STATUS_NOT_AVAILABLE);
-                    // TODO distinguish java.net.ConnectException: Connection refused, java.net.SocketTimeoutException: Read timed out
-                    Throwable cause = e;
-                    if(e instanceof CdmServerException && e.getCause() != null){
-                        cause = e.getCause();
-                    }
-                    String message = Messages.RemotingLoginDialog_CONNECTION_FAILED_MESSAGE;
-                    if(cause instanceof SocketTimeoutException){
-                        message = Messages.RemotingLoginDialog_CONNECTION_TIMEOUT_MESSAGE;
-                    }
-                    MessagingUtils.warningDialog(Messages.RemotingLoginDialog_CONNECTION_FAILED_TITLE, this,
-                            message);
-                    logger.warn(Messages.RemotingLoginDialog_CONNECTION_FAILED_TITLE, e);
-                }
-            }
-            updatePort();
-        }
-        catch(SWTException e){
-            //catch widget is disposed exception which may occur if
-            //dialog is closed but the runnable tries to update
-        }
-    }
-
-    @Override
-    protected void populateCdmInstanceCombo(final boolean forceRefresh) {
-        comboCdmInstance.removeAll();
-        comboCdmInstance.setEnabled(false);
-        btnConnect.setEnabled(false);
-        txtCdmInstanceStatus.setText(STATUS_RETRIEVING);
-        txtCdmInstanceStatus.setToolTipText(""); //$NON-NLS-1$
-
-        serverJob = new Job(Messages.RemotingLoginDialog_RETRIEVE_SERVER_INSTANCES) {
-            @Override
-            protected IStatus run(IProgressMonitor monitor) {
-                try {
-                    if(selectedServerInfo != null) {
-                        if(forceRefresh) {
-                            selectedServerInfo.refreshInstances();
-                        }
-                        final List<CdmInstanceInfo> instances = selectedServerInfo.getInstances();
-                        Display.getDefault().asyncExec(()->{
-                            if(!instances.isEmpty()) {
-                                for(CdmInstanceInfo cdmInstance : instances) {
-                                    comboCdmInstance.add(cdmInstance.getName());
-                                }
-                                int instanceIndex = -1;
-                                if(instanceName != null) {
-                                    instanceIndex = comboCdmInstance.indexOf(instanceName);
-                                }
-                                if(instanceIndex == -1) {
-                                    comboCdmInstance.select(0);
-                                    autoConnect = false;
-                                } else {
-                                    comboCdmInstance.select(instanceIndex);
-                                }
-                                onRefreshCdmInstance();
-                                comboCdmInstance.setEnabled(true);
-                                if(autoConnect) {
-                                    connect();
-                                }
-                            } else {
-                                txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES);
-                                btnConnect.setEnabled(false);
-                            }
-                        });
-                    }
-                } catch (final CdmServerException e) {
-                    MessagingUtils.warn(getClass(), e);
-                    Display.getDefault().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            disableCdmInstanceControls(STATUS_NOT_AVAILABLE, e.getMessage());
-                        }
-                    });
-                }
-                return Status.OK_STATUS;
-            }
-        };
-
-        if(txtCdmServerStatus.getText().equals(STATUS_AVAILABLE) && !isDevRemoteSource) {
-            // Start the Job
-            serverJob.schedule();
-        }
-    }
-
-    @Override
-    public void disableCdmInstanceControls(String cdmInstanceStatus, String tooltip) {
-        txtCdmInstanceStatus.setText(cdmInstanceStatus);
-        txtCdmInstanceStatus.setToolTipText(tooltip);
-        comboCdmInstance.setEnabled(false);
-        btnConnect.setEnabled(false);
-    }
 
-    @Override
-    public void onRefreshCdmInstance() {
-        txtCdmInstanceStatus.setText(STATUS_CHECKING_AVAILABILITY);
-        clearOnInstanceChange();
-        updateSelectedCdmInstance();
-        checkSelectedCdmInstance();
-        updateManagedServerControls();
-    }
-
-    @Override
-    protected void updateSelectedCdmInstance() {
-        int selIndex = comboCdmInstance.getSelectionIndex();
-        if(selIndex != -1) {
-            selectedCdmInstance = selectedServerInfo.getInstanceFromName(comboCdmInstance.getItem(selIndex));
-            if(loadLoginPrefs) {
-                readPrefCredentials();
-            }
-        }
-    }
 
     private void updateManagedServerControls() {
         if(selectedServerInfo.isLocalhostMgd()) {
@@ -867,24 +492,6 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
     }
 
 
-    @Override
-    public void handleError(final Throwable t) {
-
-        Display.getDefault().syncExec(()-> {
-            serverJob.cancel();
-
-            String title = Messages.RemotingLoginDialog_SERVER_LAUNCH_ERROR;
-            String  message = t.getMessage();
-
-            MessagingUtils.errorDialog(title,
-                    this,
-                    message,
-                    TaxeditorStorePlugin.PLUGIN_ID,
-                    t,
-                    true);
-        });
-    }
-
     private void onStopManagedServer() {
         try {
             CdmStoreLocal.getManagedServer().stop();
@@ -910,7 +517,7 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
         if (selectedServerInfo.isLocalhostMgd()){
             checkManagedSelectedInstance();
         }else if (txtCdmServerStatus.getText().equals(STATUS_AVAILABLE)) {
-
+            compAdvanced.setEnabled(false);
             boolean available = false;
             String instanceStatus = STATUS_NOT_AVAILABLE;
             String message = null;
@@ -1020,309 +627,5 @@ public class RemotingLoginDialogLocal extends RemotingLoginDialog {
          });
     }
 
-    @Override
-    public void connect() {
-        checkSelectedCdmInstance();
-
-        if(!txtCdmInstanceStatus.getText().equals(STATUS_AVAILABLE)) {
-            return;
-        }
-
-        ICdmRemoteSource source = selectedServerInfo.getCdmRemoteSource(selectedCdmInstance, getPort());
-
-        if(!validateLogin(source)) {
-            return;
-        }
-
-        try {
-            CdmStoreLocal.connect(source, RemotingLoginDialogLocal.this);
-        } catch (Exception e) {
-            // Do not expect anything to go wrong at this point, so we throw a runtime exception
-            // if any problems
-            throw new RuntimeException(e);
-        }
-    }
-
-
-    @Override
-    public boolean isRememberMe() {
-        return btnRememberMe.getSelection();
-    }
-
-    private void persistPrefLastServerInstance() {
-        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
-        Preferences lastServerInstancePrefs = preferences.node(LAST_SERVER_INSTANCE_NODE);
-
-        lastServerInstancePrefs.put(LAST_SERVER_KEY, selectedServerInfo.getName());
-        lastServerInstancePrefs.put(LAST_INSTANCE_KEY, selectedCdmInstance.getName());
-
-        flushPreferences(lastServerInstancePrefs);
-    }
-
-    private void persistPrefCredentials() {
-         IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
-         Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
-         credentialsPrefs.put(getUsernamePrefKey(), txtLogin.getText());
-         credentialsPrefs.put(getPasswordPrefKey(), txtPassword.getText());
-         flushPreferences(credentialsPrefs);
-    }
-
-    private void removePrefCredentials() {
-        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
-        Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
-        credentialsPrefs.put(getUsernamePrefKey(), txtLogin.getText());
-        credentialsPrefs.put(getPasswordPrefKey(), txtPassword.getText());
-        removePreferences(credentialsPrefs);
-    }
-
-    private void removePreferences(Preferences prefs) {
-        try {
-            prefs.removeNode();
-        } catch (BackingStoreException bse) {
-            setMessage(bse.getMessage());
-        }
-    }
-
-    private void flushPreferences(Preferences prefs) {
-        try {
-            prefs.flush();
-        } catch (BackingStoreException bse) {
-            setMessage(bse.getMessage());
-        }
-    }
-
-    @Override
-    protected void readPrefCredentials() {
-        String username, password;
-        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
-        Preferences credentialsPrefs = preferences.node(LOGIN_NODE);
-        username = credentialsPrefs.get(getUsernamePrefKey(), ""); //$NON-NLS-1$
-        txtLogin.setText(username);
-        password = credentialsPrefs.get(getPasswordPrefKey(),""); //$NON-NLS-1$
-        txtPassword.setText(password);
-        if(username.isEmpty() || password.isEmpty()) {
-            autoConnect = false;
-        }
-    }
-
-    private void readPrefLastServerInstance() {
-        IEclipsePreferences preferences = ConfigurationScope.INSTANCE.getNode(STORE_PREFERENCES_NODE);
-        Preferences lastServerInstancePrefs = preferences.node(LAST_SERVER_INSTANCE_NODE);
-
-        serverName = lastServerInstancePrefs.get(LAST_SERVER_KEY, null);
-        instanceName = lastServerInstancePrefs.get(LAST_INSTANCE_KEY, null);
-    }
-
-    private void emptyCredentials() {
-        txtLogin.setText(""); //$NON-NLS-1$
-        txtPassword.setText(""); //$NON-NLS-1$
-    }
-
-    private String getUsernamePrefKey() {
-        return selectedServerInfo.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + USERNAME_SUFFIX;
-    }
-
-    private String getPasswordPrefKey() {
-        return selectedServerInfo.toString(selectedCdmInstance.getName(), isDevRemoteSource?getPort():-1) + PASSWORD_SUFFIX;
-    }
-
-    private boolean validateLogin(ICdmRemoteSource remoteSource) {
-        if(getUsername() == null || getUsername().isEmpty()) {
-            setMessage(Messages.RemotingLoginDialog_LOGIN_CANNOT_BE_EMPTY);
-            return false;
-        }
-        if(getPassword() == null || getPassword().isEmpty()) {
-            setMessage(Messages.RemotingLoginDialog_PASSWORD_CANNOT_BE_EMPTY);
-            return false;
-        }
-
-        try {
-            IUserService userService = CdmApplicationRemoteConfiguration.getUserService(remoteSource);
-            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(getUsername(), getPassword());
-            CdmApplicationRemoteConfiguration.getAuthenticationManager(userService).authenticate(token);
-        } catch(BadCredentialsException e){
-            setMessage(LoginManager.INCORRECT_CREDENTIALS_MESSAGE);
-            return false;
-        } catch(LockedException e){
-            setMessage(LoginManager.ACCOUNT_LOCKED_MESSAGE);
-            return false;
-        } catch(IllegalArgumentException e){
-            setMessage(LoginManager.INCORRECT_CREDENTIALS_MESSAGE);
-            return false;
-        }
-        return true;
-    }
-
-
-    @Override
-    public String getUsername() {
-        return txtLogin.getText();
-    }
-
-
-    @Override
-    public String getPassword() {
-        return txtPassword.getText();
-    }
-
-
-    @Override
-    public void setMessage(String message) {
-        if(CdmUtils.isNotBlank(message)) {
-//            if(message.length() > 50) {
-//                styledTxtMessage.setToolTipText(message);
-//                message = message.substring(0,50) + "..."; //$NON-NLS-1$
-//            }
-            styledTxtMessage.setText(message);
-            styledTxtMessage.setVisible(true);
-            ((GridData)styledTxtMessage.getLayoutData()).exclude = false;
-//            shlConnect.setMinimumSize(MIN_WIDTH, getHeightWithoutMessage() + MESSAGE_HEIGHT);
-            shlConnect.pack(true);
-        } else {
-            if (!styledTxtMessage.isDisposed()){
-                styledTxtMessage.setText(""); //$NON-NLS-1$
-                styledTxtMessage.setVisible(false);
-                ((GridData)styledTxtMessage.getLayoutData()).exclude = true;
-            }
-            if(!shlConnect.isDisposed()){
-                shlConnect.pack(true);
-            }
-        }
-        if (!remotingComposite.isDisposed()){
-            remotingComposite.layout();
-        }
-    }
-
-//    private int getHeightWithoutMessage() {
-//        if(xpndblcmpstAdvanced.isExpanded()) {
-//            return MIN_EXP_HEIGHT;
-//        } else {
-//            return MIN_HEIGHT;
-//        }
-//    }
-
-    @Override
-    public void hide(boolean isHidden) {
-        if (!shlConnect.isDisposed()){
-            if(shlConnect != null && shlConnect.getDisplay() != null) {
-                shlConnect.setVisible(!isHidden);
-            }
-        }
-    }
-
-
-    @Override
-    public void dispose() {
-        if (!shlConnect.isDisposed()){
-            if(shlConnect != null && shlConnect.getDisplay() != null) {
-                shlConnect.dispose();
-            }
-        }
-    }
-
-
-    @Override
-    public void onComplete() {
-        Display.getDefault().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                if(selectedCdmInstance!=null){
-                    if(isRememberMe()) {
-                        persistPrefCredentials();
-                    }else{
-                        removePrefCredentials();
-                    }
-                    persistPrefLastServerInstance();
-                }
-                dispose();
-            }
-        });
-    }
-
-    private String generateLastModifiedTooltip(String cdmlibLastModified) {
-        if(StringUtils.isBlank(cdmlibLastModified)) {
-            return ""; //$NON-NLS-1$
-        }
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm.z"); //$NON-NLS-1$
-        Date cdmlibLastModifiedDate;
-        String cdmlibLastModifiedTimestamp = ""; //$NON-NLS-1$
-
-        cdmlibLastModifiedDate = new Date(Long.valueOf(cdmlibLastModified));
-        cdmlibLastModifiedTimestamp = sdf.format(cdmlibLastModifiedDate);
-
-        return cdmlibLastModifiedTimestamp;
-    }
-
-    private void setEditorInfo() {
-        txtEditorCdmVersion.setText(CdmMetaData.getDbSchemaVersion());
-        setCdmlibVersion(txtEditorCdmlibVersion);
-    }
-
-    private void setCdmlibVersion(Text txt) {
-        String editorVersionTimestamp = generateLastModifiedTooltip(CdmApplicationState.getCdmlibLastModified());
-        txt.setText(CdmApplicationState.getCdmlibVersion() + ":" + editorVersionTimestamp); //$NON-NLS-1$
-    }
-
-    private void clearOnServerChange() {
-        setMessage(""); //$NON-NLS-1$
-        txtServerSchemaVersion.setText(""); //$NON-NLS-1$
-        txtServerCdmlibVersion.setText(""); //$NON-NLS-1$
-        txtServerCdmlibVersion.setToolTipText(""); //$NON-NLS-1$
-        txtServerSchemaVersion.setText(""); //$NON-NLS-1$
-        comboCdmInstance.removeAll();
-        txtCdmInstanceStatus.setText(""); //$NON-NLS-1$
-        txtPort.setEditable(false);
-        txtPort.setEnabled(false);
-    }
-
-    private void clearOnInstanceChange() {
-        setMessage(""); //$NON-NLS-1$
-        txtServerSchemaVersion.setText(""); //$NON-NLS-1$
-        btnConnect.setText(LABEL_CONNECT);
-        btnConnect.setBackground(null);
-        btnConnect.requestLayout();
-    }
-
-    @SuppressWarnings("unused")  //in work, for future centralized handling of control's status
-    private void updateControls(){
-
-        //server
-//      comboCdmServer; //nothing to change
-        String strServerStatus = this.selectedServerInfo != null? STATUS_NOT_AVAILABLE : STATUS_AVAILABLE;
-        txtCdmServerStatus.setText(strServerStatus);
-//      btnCdmServerRefresh;  //nothing to change
-
-        //database
-//        comboCdmInstance
-        String strInstanceStatus = this.selectedCdmInstance != null? STATUS_NOT_AVAILABLE : STATUS_AVAILABLE;
-        txtCdmInstanceStatus.setText(strInstanceStatus);
-//        btnCdmInstanceRefresh;  //nothing to change
-
-        //login + connect
-        txtLogin.setText(Nz(login));
-        txtPassword.setText(Nz(password));
-        btnConnect.setText(LABEL_CONNECT);  //TODO
-        btnConnect.setEnabled(true);
-
-        //rememberMe + defaultValues
-//        btnRememberMe;
-//        lblDefaultLogin;
-
-        //message
-//        styledTxtMessage;
-
-        //Advanced
-//        txtPort
-//        btnStopServer;
-
-//        txtServerCdmlibVersion;
-//        txtEditorCdmlibVersion;
-//        txtServerSchemaVersion;
-//        txtEditorCdmVersion;
-    }
-
-    private String Nz(String value) {
-        return CdmUtils.Nz(value);
-    }
 
 }
@@ -6,7 +6,6 @@
 * 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.local.view.datasource.e4.handler;
 
 import javax.inject.Named;
@@ -25,12 +24,10 @@ import eu.etaxonomy.taxeditor.local.view.datasource.CdmMetaDataAwareDataSourceCo
 import eu.etaxonomy.taxeditor.local.view.datasource.e4.CdmDataSourceViewPartE4;
 
 /**
- *
  * @author pplitzner
  * @date 22.08.2017
- *
  */
-public abstract class AbstractDataSourceHandlerE4 {
+public abstract class AbstractDataSourceHandler {
 
     protected UISynchronize sync;
 
index 773cf4ade94c6efb61146bf6429918cf540c715e..3f5bda9417b3a867cf89ac3561e27f9e8593ab9c 100644 (file)
@@ -6,7 +6,6 @@
 * 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.local.view.datasource.e4.handler;
 
 import org.eclipse.core.runtime.IStatus;
@@ -21,14 +20,11 @@ import eu.etaxonomy.taxeditor.local.view.datasource.CdmMetaDataAwareDataSourceCo
 import eu.etaxonomy.taxeditor.local.view.datasource.e4.CdmDataSourceViewPartE4;
 
 /**
- *
  * @author pplitzner
  * @date 22.08.2017
- *
  */
-public class CloneDataSourceHandlerE4 extends AbstractDataSourceHandlerE4 {
+public class CloneDataSourceHandlerE4 extends AbstractDataSourceHandler {
 
-       /** {@inheritDoc} */
        @Override
        public boolean specificExecute(CdmDataSourceViewPartE4 dataSourceViewPart, CdmMetaDataAwareDataSourceContainer container, Shell shell) {
                ICdmSource cdmSource = container.getCdmSource();
@@ -48,5 +44,4 @@ public class CloneDataSourceHandlerE4 extends AbstractDataSourceHandlerE4 {
                }
                return true;
        }
-
-}
+}
\ No newline at end of file
index f7cb156ba934ebf82c02d0876215d3af9a851381..0c9695dfc7cedb1c70b51df6afe94a04224a7111 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.taxeditor.local.view.datasource.e4.CdmDataSourceViewPartE4;
  * @date 22.08.2017
  *
  */
-public class DeleteDataSourceHandlerE4 extends AbstractDataSourceHandlerE4 {
+public class DeleteDataSourceHandlerE4 extends AbstractDataSourceHandler {
 
 
 
index 3f134a7637c8c73dfc3ffb9a4e323964cd22c4ec..dc0fb038092e4e80d2e4f1223b135bc291d5a607 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.taxeditor.local.view.datasource.e4.CdmDataSourceViewPartE4;
  * @author pplitzner
  * @date 22.08.2017
  */
-public class EditDataSourceHandlerE4 extends AbstractDataSourceHandlerE4 {
+public class EditDataSourceHandlerE4 extends AbstractDataSourceHandler {
 
     @Override
     public boolean specificExecute(CdmDataSourceViewPartE4 dataSourceViewPart, CdmMetaDataAwareDataSourceContainer container, Shell shell) {
index 60ed5d1ee836ed767760b2ebbdf7772de7403b69..c0e17c55b2704c07a345efa79c2ca019133b7391 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: eu.etaxonomy.taxeditor.molecular.lib
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular.lib;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-ClassPath: .,
  lib/owlapi-xmlutils-4.1.4.jar,
  lib/commons-collections4-4.1.jar,
index 3cd0c224b002920d0390a2be1a6bfaa4dfef7e58..444829f4cd6708c9504f38e63a636fe3bc3088cb 100644 (file)
@@ -7,7 +7,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
   
   <name>Molecular Library Dependencies Bundle</name>
index 83ac6c3c070fd74fcbfdd80a63ffc49bdede3ca1..243845f380a3988f4054735c672819ba948c1b06 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Molecular Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
index 3b0746167e70ced1e9e4d5cd2983193872f0a4f6..b21133da376d6ed643195c7dc69c904a2fa08b28 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index 6ff0bc374f80a42871accb1dc203ea7b16b27bf6..ca9d5b67189d0d1e77d5989796924cf265917f04 100644 (file)
@@ -37,7 +37,6 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.commands.ICommandService;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
 import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.model.media.MediaUtils;
@@ -106,8 +105,7 @@ public class AlignmentEditorE4 {
        public static final String CONSENSUS_NAME = "Consensus"; //$NON-NLS-1$
 
 
-    private ConversationHolder conversationHolder;
-       private final AlignmentModelChangeListener DIRTY_LISTENER = new AlignmentModelChangeListener() {
+    private final AlignmentModelChangeListener DIRTY_LISTENER = new AlignmentModelChangeListener() {
                                @Override
                                public <T> void afterTokenChange(TokenChangeEvent<T> e) {
                                        setDirty();
@@ -318,7 +316,7 @@ public class AlignmentEditorE4 {
                for (SingleReadAlignment singleReadAlignment : sequenceNode.getSingleReadAlignments()) {
                        try {
                                SingleRead pherogramInfo = singleReadAlignment.getSingleRead();
-                               String id = addRead(DerivateLabelProvider.getDerivateText(pherogramInfo, conversationHolder),
+                               String id = addRead(DerivateLabelProvider.getDerivateText(pherogramInfo),
                                                getPherogramURI(pherogramInfo),
                                                singleReadAlignment.isReverseComplement(),
                                                singleReadAlignment.getEditedSequence(),
@@ -344,15 +342,7 @@ public class AlignmentEditorE4 {
 
     @PostConstruct
     public void createPartControl(Composite parent) {
-        if (CdmStore.isActive()){
-            if(conversationHolder == null){
-                conversationHolder = CdmStore.createConversation();
-            }
-        }
-        else{
-            return;
-        }
-        SWTComponentFactory.getInstance().getSWTComponent(getAlignmentsContainer(), parent, SWT.NONE);
+       SWTComponentFactory.getInstance().getSWTComponent(getAlignmentsContainer(), parent, SWT.NONE);
         Display.getCurrent().addFilter(SWT.FocusIn, ACTION_UPDATER);
         Display.getCurrent().addFilter(SWT.FocusOut, ACTION_UPDATER);
        }
@@ -365,10 +355,6 @@ public class AlignmentEditorE4 {
         CLIPBOARD.dispose();
         input.dispose();
 
-        if(conversationHolder!=null){
-            conversationHolder.close();
-            conversationHolder = null;
-        }
         if(input!=null){
             input.dispose();
         }
@@ -444,14 +430,9 @@ public class AlignmentEditorE4 {
             }
         }
 
-        if (!conversationHolder.isBound()) {
-            conversationHolder.bind();
-        }
         monitor.worked(1);
 
         input.merge();
-        // Commit the conversation and start a new transaction immediately:
-        conversationHolder.commit(true);
         monitor.worked(1);
 
         dirty.setDirty(false);
@@ -491,9 +472,6 @@ public class AlignmentEditorE4 {
 
     @Focus
     public void setFocus() {
-        if(conversationHolder != null){
-            conversationHolder.bind();
-        }
         if(input!=null){
             input.bind();
         }
index 6c7a2ec523bba0ee1e47ab3bea9d2cd55f6c8e3c..3cfa86413462d851ee2121c632e78acf0ee691cf 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Navigation Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.navigation,
index a63073f9dc211b33ed5e6a54a7cfe048b72c08c5..0a4be8f42fe3203832c18e385c2af38ba562c59e 100644 (file)
@@ -71,7 +71,6 @@ wizard.name = TCS
 wizard.name.2 = Excel Normal Explicit\r
 wizard.name.3 = ABCD file\r
 wizard.name.4 = SDD\r
-wizard.name.5 = Specimen CDM Excel\r
 wizard.name.6 = JAXB\r
 wizard.name.8 = SDD\r
 wizard.name.9 = DwC-A\r
@@ -80,6 +79,8 @@ wizard.name.18 = CSV
 wizard.name.19 = CSV_NAME\r
 wizard.name.20 = CSV_PRINT\r
 wizard.name.22 = CDM light (csv)\r
+wizard.name.122 = Col DP\r
+wizard.name.123 = WFO Backbone\r
 wizard.name.14 = Specimen\r
 wizard.name.23 = Excel Distribution Data Update\r
 wizard.name.24 = RIS\r
index 9fc2e8d7bfa2549e3aaf5bfa1f70887654ab7dc3..c47ae5a24b144de589c6aa8f209498296f351c14 100644 (file)
@@ -71,7 +71,6 @@ wizard.name = TCS
 wizard.name.2 = Excel Normal Explicit\r
 wizard.name.3 = ABCD Datei\r
 wizard.name.4 = SDD\r
-wizard.name.5 = Beleg CDM Excel\r
 wizard.name.6 = JAXB\r
 wizard.name.8 = SDD\r
 wizard.name.9 = DwC-A\r
@@ -80,6 +79,8 @@ wizard.name.18 = CSV
 wizard.name.19 = CSV_NAME\r
 wizard.name.20 = CSV_PRINT\r
 wizard.name.22 = CDM light (csv)\r
+wizard.name.122 = Col DP\r
+wizard.name.123 = WFO Backbone\r
 wizard.name.14 = Beleg\r
 wizard.name.23 = Excel Verbreitungsdaten Update\r
 wizard.name.24 = RIS\r
index 584a0616cbe6f233e229d531ac38faa1804edbed..6417c6c00058812016da0c563d8099b19193f333 100644 (file)
@@ -8,7 +8,6 @@
   <imports xsi:type="commands:Command" xmi:id="_AqZK8KnKEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importExcelTaxa"/>
   <imports xsi:type="commands:Command" xmi:id="_AsTPcKnKEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importRisReference"/>
   <imports xsi:type="commands:Command" xmi:id="_AuNT8KnKEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importSdd"/>
-  <imports xsi:type="commands:Command" xmi:id="_Av4u8KnKEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importExcelSpecimen"/>
   <imports xsi:type="commands:Command" xmi:id="_LCsbgKnKEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importTcs"/>
   <imports xsi:type="commands:Command" xmi:id="_fQX7EKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportJaxb"/>
   <imports xsi:type="commands:Command" xmi:id="_iaZnEKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportSdd"/>
@@ -18,6 +17,8 @@
   <imports xsi:type="commands:Command" xmi:id="_mOC30KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCsvPrint"/>
   <imports xsi:type="commands:Command" xmi:id="_n1FHEKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportCdmLight"/>
   <imports xsi:type="commands:Command" xmi:id="_aN3BsL2gEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.command.collapse"/>
+  <imports xsi:type="commands:Command" xmi:id="_Ih5dAEjAEe6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.command.exportColDP"/>
+  <imports xsi:type="commands:Command" xmi:id="_lMkLQLnKEe6hy6A4KTNM1w" elementId="eu.etaxonomy.taxeditor.store.command.exportWfoBackbone"/>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_oDvMsCTfEeeiN5lBIuqN3g" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.trimcontribution.mainToolbar">
     <elements xsi:type="menu:ToolControl" xmi:id="_7kZI4CTfEeeiN5lBIuqN3g" elementId="eu.etaxonomy.taxeditor.navigation.toolcontrol.search_bar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.search.SearchBar"/>
   </fragments>
@@ -73,7 +74,6 @@
           <children xsi:type="menu:Menu" xmi:id="_2sWBQAUvEeqpi5fkbwgEHQ" elementId="eu.etaxonomy.taxeditor.navigation.menu.specimen" label="Specimen">
             <children xsi:type="menu:HandledMenuItem" xmi:id="_YMugAKkeEeejedk4mZQIGw" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.importSpecimens" label="%handledmenuitem.label.2" command="_yBC78KnJEeeTAPHmaMLwQQ"/>
             <children xsi:type="menu:HandledMenuItem" xmi:id="_2NC0kKnEEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.importAbcd" label="%wizard.name.3" command="_AOq4QKnKEeeTAPHmaMLwQQ"/>
-            <children xsi:type="menu:HandledMenuItem" xmi:id="_6uLdcKnEEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.importExcelSpecimen" label="%wizard.name.5" command="_Av4u8KnKEeeTAPHmaMLwQQ"/>
           </children>
           <children xsi:type="menu:Menu" xmi:id="_6UTmcAUvEeqpi5fkbwgEHQ" elementId="eu.etaxonomy.taxeditor.navigation.menu.taxa" label="Taxa">
             <children xsi:type="menu:HandledMenuItem" xmi:id="_6YeTMKnEEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.importExcelTaxa" label="%wizard.name.2" command="_AqZK8KnKEeeTAPHmaMLwQQ"/>
         </children>
         <children xsi:type="menu:Menu" xmi:id="_rbInwKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.menu.export" label="%menu.label.2">
           <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_3qJaEMuuEeiGO4eKaXkw0w" coreExpressionId="isShowIOMenuEnabled"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_zDuJwKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportDwca" label="%wizard.name.9" command="_juMxQKqhEeeXcJGhyhlrKA"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_IfCk8LnMEe6hy6A4KTNM1w" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.wizardname123" label="%wizard.name.123" command="_lMkLQLnKEe6hy6A4KTNM1w"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_kVpisEi-Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportColDP" label="%wizard.name.122" command="_Ih5dAEjAEe6gZ65AByRHxQ"/>
+          <children xsi:type="menu:HandledMenuItem" xmi:id="_44XB4KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_n1FHEKqhEeeXcJGhyhlrKA"/>
+          <children xsi:type="menu:MenuSeparator" xmi:id="_8AZ3kEx-Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.navigation.menuseparator.9"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_tPAZIKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportJaxb" label="%wizard.name.6" command="_fQX7EKqhEeeXcJGhyhlrKA"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_xwZgsKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportSdd" label="%wizard.name.8" command="_iaZnEKqhEeeXcJGhyhlrKA"/>
-          <children xsi:type="menu:HandledMenuItem" xmi:id="_zDuJwKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportDwca" label="%wizard.name.9" command="_juMxQKqhEeeXcJGhyhlrKA"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_0e68cKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCsv" label="%wizard.name.18" command="_kuP5AKqhEeeXcJGhyhlrKA"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_2C_-UKqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCsvName" label="%wizard.name.19" command="_lMwZ8KqhEeeXcJGhyhlrKA"/>
           <children xsi:type="menu:HandledMenuItem" xmi:id="_3p8G8KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCsvPrint" label="%wizard.name.20" command="_mOC30KqhEeeXcJGhyhlrKA"/>
-          <children xsi:type="menu:HandledMenuItem" xmi:id="_44XB4KqhEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.eu.etaxonomy.taxeditor.navigation.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_n1FHEKqhEeeXcJGhyhlrKA"/>
         </children>
         <children xsi:type="menu:MenuSeparator" xmi:id="_x0uEMJIwEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.menuseparator.3"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_yH9JQJIwEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.delete" label="%command.label.10" command="__n644JIxEeeJAdt8ZUxyaw"/>
index de07f15d60a8967ed6b1401287d677379e75c417..efe21f23ab651404f16cd8a5805e22b1ff2061c0 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <groupId>eu.etaxonomy</groupId>
                <artifactId>taxeditor-parent</artifactId>
-               <version>5.33.0</version>
+               <version>5.42.0</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index 03460c84cd82fc63d27971cbcbb412ed1e9b2610..ac99f0c26054d99642b23398ee8b2eda96a1a4a4 100644 (file)
@@ -29,7 +29,6 @@ public class AppModelId {
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_EXPORTSDD = "eu.etaxonomy.taxeditor.store.command.exportSdd";
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTABCD = "eu.etaxonomy.taxeditor.store.command.importAbcd";
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTEXCELDISTRIBUTION = "eu.etaxonomy.taxeditor.store.command.importExcelDistribution";
-       public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTEXCELSPECIMEN = "eu.etaxonomy.taxeditor.store.command.importExcelSpecimen";
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTEXCELTAXA = "eu.etaxonomy.taxeditor.store.command.importExcelTaxa";
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTRISREFERENCE = "eu.etaxonomy.taxeditor.store.command.importRisReference";
        public static final String COMMAND_EU_ETAXONOMY_TAXEDITOR_STORE_COMMAND_IMPORTSDD = "eu.etaxonomy.taxeditor.store.command.importSdd";
index 52c0c4723ae052b43aae014d9879cbbb8bd65369..4587fb99b1a569c1b65cf3c5928043880cd528bb 100644 (file)
@@ -36,8 +36,8 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.internal.TaxeditorNavigationPlugin;
@@ -149,8 +149,8 @@ public class NavigationUtil extends AbstractUtility{
 
            Collection<MPart> dirtyParts = partService.getDirtyParts();
            for (MPart part : dirtyParts) {
-            if(part.getObject() instanceof TaxonNameEditorE4){
-                TaxonEditorInputE4 input = ((TaxonNameEditorE4) part.getObject()).getEditorInput();
+            if(part.getObject() instanceof TaxonEditor){
+                TaxonEditorInput input = ((TaxonEditor) part.getObject()).getEditorInput();
                 if(input.getTaxonNode().getUuid().equals(taxonNode.getUuid())){
                     return true;
                 }
@@ -169,8 +169,8 @@ public class NavigationUtil extends AbstractUtility{
 
         Collection<MPart> dirtyParts = partService.getDirtyParts();
         for (MPart part : dirtyParts) {
-            if(part.getObject() instanceof TaxonNameEditorE4){
-                TaxonEditorInputE4 input = ((TaxonNameEditorE4) part.getObject()).getEditorInput();
+            if(part.getObject() instanceof TaxonEditor){
+                TaxonEditorInput input = ((TaxonEditor) part.getObject()).getEditorInput();
                 if(input.getTaxonNode().equals(taxonNode)){
                     return true;
                 }
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartDataChangeBehaviorE4.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/PolytomousKeyViewPartDataChangeBehaviorE4.java
deleted file mode 100644 (file)
index 53fe14d..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.navigation.key.polytomous.e4;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
-
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
-import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
-
-/**
- *
- * @author pplitzner
- * @since Sep 28, 2017
- *
- */
-public class PolytomousKeyViewPartDataChangeBehaviorE4 extends
-               AbstractDataChangeBehaviour {
-
-    private static final String UPDATING_POLYTOMOUS_KEY_VIEWER = Messages.PolytomousKeyViewPartDataChangeBehavior_UPDATE;
-    private final PolytomousKeyViewPartE4 source;
-
-       public PolytomousKeyViewPartDataChangeBehaviorE4(
-                       PolytomousKeyViewPartE4 polytomousKeyViewPart) {
-               source = polytomousKeyViewPart;
-       }
-
-       @Override
-       public void reactOnDataChange(CdmDataChangeMap changeEvents) {
-               if(isRelevant(changeEvents)){
-                       final Display display = Display.getCurrent();
-                       Job job = new Job(UPDATING_POLYTOMOUS_KEY_VIEWER) {
-
-                               @Override
-                               protected IStatus run(IProgressMonitor monitor) {
-                                       monitor.beginTask(UPDATING_POLYTOMOUS_KEY_VIEWER, 3);
-                                       monitor.worked(1);
-
-                                       // clear the session completely
-                                       monitor.subTask(Messages.PolytomousKeyViewPartDataChangeBehavior_CLEAR);
-                                       display.asyncExec(new Runnable() {
-                                                @Override
-                        public void run() {
-                                                        source.getConversationHolder().clear();
-                                                }
-                                       });
-                                       // FIXME completely clearing the session is a brute force approach.
-                                       // It would be much more elegant to clear only those elements that have been changed.
-                                       // I could not get that to work but we should consider workin on this because we might
-                                       // run into serious performance issues, especially when it comes to large trees
-                                       //
-                                       // at least, we moved this to a job so it can run in a background thred
-                                       // seems to improve the situation but not sure if final solution
-                                       monitor.worked(1);
-
-                                       monitor.subTask(Messages.PolytomousKeyViewPartDataChangeBehavior_REFRESH);
-
-                                       display.asyncExec(new Runnable() {
-                                           @Override
-                        public void run() {
-                                               source.refresh();
-                                           }
-                                       });
-
-
-
-                                       monitor.worked(1);
-                                       monitor.done();
-                                       return Status.OK_STATUS;
-                               }
-                       };
-
-                       job.setPriority(Job.SHORT);
-                       job.schedule();
-
-               }
-       }
-
-       private boolean isRelevant(CdmDataChangeMap changeEvents) {
-               for(CdmDataChangeEvent event : changeEvents.getAllEvents()){
-                       EventType eventType = event.getEventType();
-                       CdmBase eventEntity = event.getEntity();
-
-                       // all poyltomous key changes are relevant
-                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE)
-                                       && eventEntity instanceof PolytomousKey){
-                               return true;
-                       }
-               }
-               return false;
-       }
-}
index f3ade0f40e85d1820cb6787c7105b0d7c3d39381..b02a7f700dd432979a867b8de3d6cd0c9acbf11d 100644 (file)
@@ -49,13 +49,9 @@ import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
 import eu.etaxonomy.cdm.api.application.ICdmDataChangeService;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
-import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyContentProvider;
@@ -71,7 +67,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  * @since Sep 28, 2017
  */
 public class PolytomousKeyViewPartE4 implements
-               IConversationEnabled, ICdmEntitySessionEnabled<PolytomousKey>, IPostOperationEnabled,
+               ICdmEntitySessionEnabled<PolytomousKey>, IPostOperationEnabled,
                ICdmChangeListener {
 
     private class FilterModifyListener implements ModifyListener{
@@ -120,13 +116,12 @@ public class PolytomousKeyViewPartE4 implements
     }
 
     private ListViewer viewer;
-    private ConversationHolder conversation;
     private IContextListener contextListener;
     private final CdmFormFactory formFactory;
     private Text text_filter;
     private ICdmEntitySession cdmEntitySession;
 
-    private PolytomousKeyViewPartDataChangeBehaviorE4 dataChangeBehavior;
+    //private PolytomousKeyViewPartDataChangeBehaviorE4 dataChangeBehavior;
 
 
     @Inject
@@ -207,8 +202,6 @@ public class PolytomousKeyViewPartE4 implements
     }
 
     private void setInput() {
-        conversation = CdmStore.createConversation();
-        conversation.registerForDataStoreChanges(this);
         cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
         CdmApplicationState.getCurrentDataChangeService().register(this);
 
@@ -228,29 +221,11 @@ public class PolytomousKeyViewPartE4 implements
         }
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-        if (dataChangeBehavior == null) {
-            dataChangeBehavior = new PolytomousKeyViewPartDataChangeBehaviorE4(this);
-        }
-
-        DataChangeBridge.handleDataChange(changeEvents, dataChangeBehavior);
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
     @PreDestroy
     public void dispose() {
-        if(conversation!=null){
-            conversation.unregisterForDataStoreChanges(this);
-            conversation.close();
-            CdmStore.getContextManager().removeContextListener(contextListener);
-            conversation = null;
-        }
+        
         if(cdmEntitySession != null) {
+               CdmStore.getContextManager().removeContextListener(contextListener);
             cdmEntitySession.dispose();
             cdmEntitySession = null;
         }
@@ -262,8 +237,6 @@ public class PolytomousKeyViewPartE4 implements
 
     @Override
     public boolean postOperation(Object objectAffectedByOperation) {
-        getConversationHolder().bind();
-        getConversationHolder().commit(true);
         viewer.refresh();
         return true;
     }
@@ -274,9 +247,6 @@ public class PolytomousKeyViewPartE4 implements
     }
 
     public void refresh() {
-        getConversationHolder().bind();
-        //FIXME : Need to make sure this is a stable fix (ticket 3822)
-        getConversationHolder().commit();
         List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
         if(!viewer.getControl().isDisposed()){
             viewer.setInput(input);
index 7df83b76449801d93e8cb8613febc614707e0fe0..a465f8cc2484ced7d14c71260406871746374f0d 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.MessageDialog;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
@@ -45,9 +44,8 @@ public class DeleteOperation extends AbstractPersistentPostOperation {
        public DeleteOperation(String label, IUndoContext undoContext,
                        PolytomousKey key,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
                        ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
                this.key = key;
                this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
        }
index 5bb8f28ebe4ac4f223c7bd3714d1f7515a0c03d0..bacc615e7e940d8384b31ebafb035fed97532045 100644 (file)
@@ -1,3 +1,11 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.navigation.key.polytomous.operation;
 
 import java.util.UUID;
@@ -8,10 +16,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
-import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
-import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
@@ -21,57 +26,41 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * Operation responsible for refreshing key nodes node numbers of the Polytomous Keys.
  * The refresh is performed on all keys/
- * 
+ *
  * @author c.mathew
  * @created Jan 17 2013
- * @version 1.0
- *
  */
 public class RefreshNodesOperation extends AbstractPostTaxonOperation {
 
-       PolytomousKey key;      
-       
+       private PolytomousKey key;
+
        public RefreshNodesOperation(String label,
-                       IUndoContext undoContext, 
-                       PolytomousKey key, 
+                       IUndoContext undoContext,
+                       PolytomousKey key,
                        IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
                this.key = key;
        }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
+
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                UUID polytomousKeyNodeUuid = key.getRoot().getUuid();
-               ConversationHolder conversation = CdmStore.createConversation();
                PolytomousKeyNode root = CdmStore.getService(IPolytomousKeyNodeService.class).load(polytomousKeyNodeUuid, null);
-               root.refreshNodeNumbering();    
+               root.refreshNodeNumbering();
                CdmStore.getService(IPolytomousKeyNodeService.class).saveOrUpdate(root);
-               conversation.commit(true);
                return postExecute(root);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus redo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               // TODO Auto-generated method stub
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
-        */
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               // TODO Auto-generated method stub
                return null;
        }
-
-}
+}
\ No newline at end of file
index 6c06c1c330c20c8a400ffbfd99726aefb9e8c6b0..3efc287e982713ddea0a02f291318d78c7fcf1fd 100644 (file)
@@ -21,8 +21,8 @@ DeleteHandler_CONFIRM_DELETE=Confirm Deletion
 DeleteHandler_CONFIRM_MESSAGE=Do you want to delete the selected key(s)?
 DeleteHandler_DELETE_ALL=Delete all children
 DeleteHandler_DELETE_CLASSIFICATION=Do you really want to delete the classification?
-DeleteHandler_DELETE_NODE=Do you really want to delete the selected node?
-DeleteHandler_DELETE_NODES=Do you really want to delete the selected nodes?
+DeleteHandler_DELETE_NODE=Do you really want to delete the selected node? Taxa will be deleted including all factual data.
+DeleteHandler_DELETE_NODES=Do you really want to delete the selected nodes? Taxa will be deleted including all factual data.
 DeleteHandler_MOVE_TO_PARENT=Move children to parent node
 DeleteHandler_SKIP=Cancel
 DeleteHandler_DELETE=Delete
index 6c87afc36f9454289f841cda09cdca326a9854fd..39441059b2fc92c1e777c426e2829e14c954caf1 100644 (file)
@@ -21,8 +21,8 @@ DeleteHandler_CONFIRM_DELETE=L
 DeleteHandler_CONFIRM_MESSAGE=Wollen wie Sie die ausgewählten Schlüssen löschen?
 DeleteHandler_DELETE_ALL=Alle Kinder löschen
 DeleteHandler_DELETE_CLASSIFICATION=Wollen Sie die Klassifikation wirklich löschen?
-DeleteHandler_DELETE_NODE=Wollen Sie den ausgewählten Knoten wirklich löschen?
-DeleteHandler_DELETE_NODES=Wollen Sie die ausgewählten Knoten wirklich löschen?
+DeleteHandler_DELETE_NODE=Wollen Sie den ausgewählten Knoten wirklich löschen? Taxa werden inklusive aller Faktendaten gelöscht.
+DeleteHandler_DELETE_NODES=Wollen Sie die ausgewählten Knoten wirklich löschen? Taxa werden inklusive aller Faktendaten gelöscht.
 DeleteHandler_MOVE_TO_PARENT=Verschiebe Kinder zu Elternknoten
 DeleteHandler_SKIP=Abbrechen
 DeleteHandler_DELETE=Löschen
index daf9c589b35c72172e3827e9755f75a04395710e..681a055f651489a9a731fbba94b842f32578408e 100644 (file)
@@ -27,7 +27,7 @@ public class EmptyRoot extends Root {
         * <p>Constructor for EmptyRoot.</p>
         */
        public EmptyRoot() {
-               super(null);
+               super();
        }
 
        /**
index 93b9386818d69b7b6eddf0f62e7f30930dfa7d32..51894bb8ff8fa0607715214d53daf9c534e65c61 100644 (file)
@@ -6,7 +6,6 @@
 * 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.navigation.navigator;
 
 import java.util.ArrayList;
@@ -19,40 +18,22 @@ import org.eclipse.ui.IElementFactory;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IPersistableElement;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>Root class.</p>
- *
  * @author p.ciardelli
  * @created 02.06.2009
- * @version 1.0
  */
-public class Root extends PlatformObject implements IAdaptable, IPersistableElement, IElementFactory, IConversationEnabled {
+public class Root extends PlatformObject
+        implements IPersistableElement, IElementFactory {
 
-       private final ConversationHolder conversation;
        private List<TaxonNodeDto> rootNodes = new ArrayList<>();
 
-       /**
-        * <p>Constructor for Root.</p>
-        *
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public Root (ConversationHolder conversation){
-               this.conversation = conversation;
-       }
+       public Root () {}
 
-       /**
-        * <p>getParentBeans</p>
-        *
-        * @return a {@link java.util.List} object.
-        */
        public List<TaxonNodeDto> getParentBeans() {
                List<String> propertyPaths = Arrays.asList(new String[]{
                        "name", //$NON-NLS-1$
@@ -78,50 +59,20 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
                return rootNodes;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IPersistableElement#getFactoryId()
-        */
-       /**
-        * <p>getFactoryId</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
        @Override
     public String getFactoryId() {
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
-        */
-       /** {@inheritDoc} */
        @Override
     public void saveState(IMemento memento) {
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
-        */
-       /** {@inheritDoc} */
        @Override
     public IAdaptable createElement(IMemento memento) {
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {}
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
        public void addRootNode(Classification newClassification){
            newClassification = CdmStore.getService(IClassificationService.class).load(newClassification.getUuid());
            boolean exist = false;
@@ -134,12 +85,8 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
            if (!exist){
                rootNodes.add(new TaxonNodeDto(newClassification.getRootNode()));
            }
-
        }
 
-    /**
-     * @param cb
-     */
     public void removeRootNode(Classification cb) {
         int index = -1;
         for (TaxonNodeDto dto: rootNodes){
@@ -151,6 +98,5 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
         if (index > 0){
             rootNodes.remove(index);
         }
-
     }
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorDataChangeBehaviorE4.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorDataChangeBehaviorE4.java
deleted file mode 100644 (file)
index 1fc6993..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.navigation.navigator.e4;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
-
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.name.TaxonName;
-import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
-import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
-import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
-
-/**
- * <p>TaxonNavigatorDataChangeBehavior class.</p>
- *
- * @author n.hoffmann
- * @created 01.04.2009
- * @version 1.0
- */
-public class TaxonNavigatorDataChangeBehaviorE4 extends AbstractDataChangeBehaviour implements
-               IDataChangeBehavior {
-
-    private static final String UPDATING_TAXON_NAVIGATOR = Messages.TaxonNavigatorDataChangeBehavior_UPDATE_NAVIGATOR;
-
-    private final TaxonNavigatorE4 source;
-
-       private Set<CdmBase> staleObjects;
-
-       /**
-        * <p>Constructor for TaxonNavigatorDataChangeBehavior.</p>
-        *
-        * @param taxonNavigator a {@link eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator} object.
-        */
-       public TaxonNavigatorDataChangeBehaviorE4(TaxonNavigatorE4 taxonNavigator) {
-               source = taxonNavigator;
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.model.IDataChangeBehavior#isRelevant(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
-        */
-       /**
-        * <p>isRelevant</p>
-        *
-        * @param events a {@link eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap} object.
-        * @return a boolean.
-        */
-       public boolean isRelevant(CdmDataChangeMap events) {
-
-               // TODO react only on insert/update/delete of taxon and synonym objects
-               // and on update of name objects
-               boolean relevant = false;
-               staleObjects = new HashSet<CdmBase>();
-
-               for(CdmDataChangeEvent event : events.getAllEvents()){
-                       EventType eventType = event.getEventType();
-                       CdmBase eventEntity = event.getEntity();
-
-                       Set<CdmBase> affectedObjects = event.getAffectedObjects();
-                       if(affectedObjects != null) {
-                           for(CdmBase cb : affectedObjects) {
-                               staleObjects.add(HibernateProxyHelper.deproxy(cb));
-                           }
-                       }
-
-                       // all tree node changes are relevant
-                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE)
-                                       && event.getEntity() instanceof ITaxonTreeNode){
-                               return true;
-                       }
-
-                       if (eventType == EventType.DELETE){
-                               return true;
-                       }
-
-
-
-                       if(eventType == EventType.UPDATE && event.getEntity() instanceof Taxon){
-                               TaxonName name = null;
-                               if(eventEntity instanceof Taxon){
-                                       name = ((Taxon) eventEntity).getName();
-                               }else{
-                                       continue;
-                               }
-
-                               // Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors();
-                               /*for(IEditorPart editor : openEditors){
-
-                                       if(name.equals(((TaxonEditorInput) editor.getEditorInput()).getTaxon().getName())){
-                                               return true;
-                                       }
-                               }*/
-                       }
-
-//                     if(eventType == EventType.UPDATE){
-//                             relevant = true;
-//                             CdmBase entity = event.getEntity();
-//                             if((entity instanceof TaxonNameBase)
-//                                             || (entity instanceof Taxon)
-//                                             || (entity instanceof Synonym)){
-//                                     staleObjects.add(entity);
-//                             }
-//                     }
-               }
-
-               return false;
-
-               // @deprecated
-               // react on everything except load
-//             if(events.sizeByEventType(EventType.INSERT) > 0){
-//                     return true;
-//             }else if(events.sizeByEventType(EventType.UPDATE) > 0){
-//                     return true;
-//             }else if(events.sizeByEventType(EventType.DELETE) > 0){
-//                     return true;
-//             }else{
-//                     return false;
-//             }
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void reactOnDataChange(CdmDataChangeMap events) {
-               if(isRelevant(events)){
-
-                       final Display display = Display.getCurrent();
-                       Job job = new Job(UPDATING_TAXON_NAVIGATOR) {
-
-                               @Override
-                               protected IStatus run(IProgressMonitor monitor) {
-                                       monitor.beginTask(UPDATING_TAXON_NAVIGATOR, 3);
-                                       monitor.worked(1);
-
-                                       // clear the session completely
-                                       monitor.subTask(Messages.TaxonNavigatorDataChangeBehavior_CLEAR_SESSION);
-                                       display.asyncExec(new Runnable() {
-                                                @Override
-                                                public void run() {
-                                                        source.getConversationHolder().clear();
-                                                }
-                                       });
-                                       // FIXME completely clearing the session is a brute force approach.
-                                       // It would be much more elegant to clear only those elements that have been changed.
-                                       // I could not get that to work but we should consider workin on this because we might
-                                       // run into serious performance issues, especially when it comes to large trees
-                                       //
-                                       // at least, we moved this to a job so it can run in a background thred
-                                       // seems to improve the situation but not sure if final solution
-                                       monitor.worked(1);
-
-                                       monitor.subTask(Messages.TaxonNavigatorDataChangeBehavior_REFRESH_VIEWER);
-
-                                       display.asyncExec(new Runnable() {
-                                           @Override
-                                           public void run() {
-                                               if(staleObjects != null && staleObjects.size() > 0) {
-                                                  source.refresh(staleObjects);
-                                               } else {
-                                                   source.refresh();
-                                               }
-                                           }
-                                       });
-
-
-
-                                       monitor.worked(1);
-                                       monitor.done();
-                                       return Status.OK_STATUS;
-                               }
-                       };
-
-                       job.setPriority(Job.SHORT);
-                       job.schedule();
-
-               }
-       }
-}
index 6b36ee4147d7bb866a7606a4d9c95aee1b28651c..f04cd56369d46d008cf9c0936b76f9fd29bea7cc 100644 (file)
@@ -59,8 +59,6 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -68,13 +66,11 @@ import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
 import eu.etaxonomy.taxeditor.navigation.AppModelId;
@@ -95,7 +91,7 @@ import eu.etaxonomy.taxeditor.workbench.part.ICollapsableExpandable;
  * @since Sep 7, 2017
  */
 public class TaxonNavigatorE4 implements
-               IPostOperationEnabled, IConversationEnabled, Observer,
+               IPostOperationEnabled, Observer,
                ICdmChangeListener, IContextListener,
                ICollapsableExpandable {
 
@@ -107,8 +103,6 @@ public class TaxonNavigatorE4 implements
 
        private final int dndOperations = DND.DROP_MOVE;
 
-       private ConversationHolder conversation;
-
        private IDataChangeBehavior dataChangeBehavior;
 
        private Root root;
@@ -242,7 +236,7 @@ public class TaxonNavigatorE4 implements
                        // we do not preserve state. Closing the view, in contrary to
                        // closing the whole application
                        // should be handled by the state manager too
-                   root = new Root(conversation);
+                   root = new Root();
 
                        return root;
                }
@@ -250,10 +244,10 @@ public class TaxonNavigatorE4 implements
        }
 
        public void init() {
-               if (CdmStore.isActive() && conversation == null) {
-                       conversation = CdmStore.createConversation();
-                       conversation.registerForDataStoreChanges(TaxonNavigatorE4.this);
-               }
+//             if (CdmStore.isActive() && conversation == null) {
+//                     conversation = CdmStore.createConversation();
+//                     conversation.registerForDataStoreChanges(TaxonNavigatorE4.this);
+//             }
                if (CdmStore.isActive()) {
 //                 cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
                    CdmApplicationState.getCurrentDataChangeService().register(this);
@@ -271,8 +265,8 @@ public class TaxonNavigatorE4 implements
                viewer.refresh();
                TaxonNodeDto taxonNode = null;
                if(editor.getTaxon()!=null && editor.getTaxon().getTaxonNodes()!=null){
-                   if (editor instanceof TaxonNameEditorE4){
-                       taxonNode = new TaxonNodeDto( ((TaxonNameEditorE4)editor).getEditorInput().getTaxonNode());
+                   if (editor instanceof TaxonEditor){
+                       taxonNode = new TaxonNodeDto( ((TaxonEditor)editor).getEditorInput().getTaxonNode());
                    }else{
                        if (editor.getTaxon().getTaxonNodes() != null && !editor.getTaxon().getTaxonNodes().isEmpty()){
                            taxonNode = new TaxonNodeDto(editor.getTaxon().getTaxonNodes().iterator().next());
@@ -310,13 +304,7 @@ public class TaxonNavigatorE4 implements
         * Refresh this navigators viewer
         */
        public void refresh() {
-               if(getConversationHolder() != null){
-                       getConversationHolder().bind();
-                       //FIXME : Need to make sure this is a stable fix (ticket 3822)
-                       if(!getConversationHolder().isCompleted()){
-                           getConversationHolder().commit();
-                       }
-               }
+
                if(!viewer.getTree().isDisposed()){
                    if (CdmStore.isActive()){
 
@@ -354,7 +342,7 @@ public class TaxonNavigatorE4 implements
        }
 
        private void restore(IMemento memento, IProgressMonitor monitor) {
-           root = new Root(conversation);
+           root = new Root();//conversation);
                if (memento == null) {
                    viewer.setInput(root);
                        return;
@@ -380,9 +368,9 @@ public class TaxonNavigatorE4 implements
                subProgressMonitor.subTask(RESTORING_TAXON_NAVIGATOR);
                subProgressMonitor.worked(1);
 
-               conversation = CdmStore.createConversation();
+               //conversation = CdmStore.createConversation();
                subProgressMonitor.worked(1);
-               conversation.registerForDataStoreChanges(TaxonNavigatorE4.this);
+               //conversation.registerForDataStoreChanges(TaxonNavigatorE4.this);
                subProgressMonitor.worked(1);
                viewer.setInput(root);
                subProgressMonitor.worked(1);
@@ -444,18 +432,10 @@ public class TaxonNavigatorE4 implements
            viewer.expandAll();
        }
 
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
+
 
        @PreDestroy
        public void dispose() {
-               dataChangeBehavior = null;
-               if (conversation != null) {
-                       conversation.unregisterForDataStoreChanges(this);
-                       conversation.close();
-               }
                if(CdmApplicationState.getCurrentDataChangeService() != null) {
                    CdmApplicationState.getCurrentDataChangeService().unregister(this);
                }
@@ -463,9 +443,7 @@ public class TaxonNavigatorE4 implements
 
        @Focus
        public void setFocus() {
-               if (getConversationHolder() != null) {
-                       getConversationHolder().bind();
-               }
+
        }
 
     public UISynchronize getSync() {
@@ -498,16 +476,16 @@ public class TaxonNavigatorE4 implements
                }
        }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-        if (dataChangeBehavior == null) {
-            dataChangeBehavior = new TaxonNavigatorDataChangeBehaviorE4(this);
-        }
-
-        DataChangeBridge.handleDataChange(changeEvents, dataChangeBehavior);
-        updateSyncButton();
-
-    }
+//    @Override
+//    public void update(CdmDataChangeMap changeEvents) {
+//        if (dataChangeBehavior == null) {
+//            dataChangeBehavior = new TaxonNavigatorDataChangeBehaviorE4(this);
+//        }
+//
+//        DataChangeBridge.handleDataChange(changeEvents, dataChangeBehavior);
+//        updateSyncButton();
+//
+//    }
 
     public List<TaxonNodeDto> getRootEntities() {
         if(root != null) {
index 6dcb1fc1f9bdc365827a4b5d102e1f56d095bf2f..67ede99032cecc0ac34419fa0ee7c78baecf7355 100644 (file)
@@ -8,6 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
 
+import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -28,6 +29,7 @@ import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
+import eu.etaxonomy.cdm.model.permission.CRUD;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
@@ -53,6 +55,8 @@ public class ChangeAcceptedTaxonToSynonymHandlerE4 extends CdmHandlerE4 {
     private Classification classification;
     protected boolean isSetSource = false;
 
+    private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
+
     public ChangeAcceptedTaxonToSynonymHandlerE4() {
         super(TaxonNavigatorLabels.CHANGE_ACCEPTED_TAXON_TO_SYNONYM_LABEL);
     }
@@ -132,7 +136,6 @@ public class ChangeAcceptedTaxonToSynonymHandlerE4 extends CdmHandlerE4 {
         }
 
         TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(shell,
-//                new ConversationHolderMock(),
                 Messages.RemotingChangeAcceptedTaxonToSynonymHandler_CHOOSE_TAXON,
                 excludeTaxa,
                 null,
@@ -212,11 +215,12 @@ public class ChangeAcceptedTaxonToSynonymHandlerE4 extends CdmHandlerE4 {
         for (TaxonNodeDto tn: oldTaxonNodes){
             EditorUtil.closeObsoleteEditor(tn, partService);
         }
+        //Authentication aut = CdmStore.getCurrentAuthentiation();
         ChangeAcceptedTaxonToSynonymOperation rcattso =
                 new ChangeAcceptedTaxonToSynonymOperation(getTrigger(),
                         false,
                         nodeUuids,
-                        newAcceptedTaxonNode.getUuid(), newSecUuid, secHandling, partService, activePart, application, isSetSource);
+                        newAcceptedTaxonNode.getUuid(), newSecUuid, secHandling,partService, activePart, application, isSetSource);
 
         return rcattso;
     }
@@ -225,6 +229,10 @@ public class ChangeAcceptedTaxonToSynonymHandlerE4 extends CdmHandlerE4 {
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = !selection.isEmpty();
         Object[] array = selection.toArray();
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(TaxonNode.class, UPDATE);
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         for (Object object : array) {
             canExecute &= (object instanceof TaxonNodeDto) && ((TaxonNodeDto)selection.getFirstElement()).getTaxonUuid() != null;
         }
index 8bb116d1636222ad815d9842f39336e01c588ceb..5b5031bf787ac74e69b0463cc616fde10712583f 100644 (file)
@@ -61,7 +61,7 @@ public class CloneClassificationHandlerE4 {
 
             CloneClassificationOperation operation = new CloneClassificationOperation(Messages.CloneClassificationHandler_CLONE_CLASSIFICATION,
                     StoreUtil.getUndoContext(), classification, classificationName, reference, relationType,
-                    taxonNavigator, taxonNavigator);
+                    taxonNavigator);
 
             AbstractUtility.executeOperation(operation, sync);
             taxonNavigator.refresh();
index bf7cb4f27f4bc78027ff58cfc263381eb64fc957..6402676db3a4f1fab5173a722199f38dfc7e0b74 100644 (file)
@@ -55,6 +55,11 @@ public class CopyHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(TaxonNode.class, EnumSet.of(CRUD.UPDATE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.size()==1
                 && selection.getFirstElement() instanceof TaxonNodeDto;
         menuItem.setVisible(canExecute);
index af27b35e4a05de68e66910f2c33cd12f5f745993..a588c5bf246cb0f709de3cc8e54c22a1f76f0a67 100644 (file)
@@ -41,7 +41,7 @@ public class CreateClassificationHierarchyHandlerE4 {
         if (selectedElement instanceof TaxonNode && !((TaxonNode)selectedElement).hasTaxon()) {
             Classification classification = ((TaxonNode) selectedElement).getClassification();
             try {
-                CreateNewTaxonHierarchyOperation operation = new CreateNewTaxonHierarchyOperation(Messages.CreateClassificationHierarchyHandler_CREATE_HIERARCHY, StoreUtil.getUndoContext(),classification, taxonNavigator, taxonNavigator);
+                CreateNewTaxonHierarchyOperation operation = new CreateNewTaxonHierarchyOperation(Messages.CreateClassificationHierarchyHandler_CREATE_HIERARCHY, StoreUtil.getUndoContext(),classification, taxonNavigator);
                 AbstractUtility.executeOperation(operation, sync);
                 taxonNavigator.refresh();
             } catch (Exception e) {
index 8ed66caac9991ab0ce3ce4eb284a2a98c561c6b4..8501dd22c4ce1019861a362ceecf470e454fe4ab 100644 (file)
@@ -145,7 +145,6 @@ public class DeleteHandlerE4 {
                                                                taxonNode,
                                                                config,
                                                                taxonNavigator,
-                                                               taxonNavigator,
                                                                null);
 
                                                AbstractUtility.executeOperation(operation, sync);
@@ -170,7 +169,6 @@ public class DeleteHandlerE4 {
                                                        treeNodes,
                                                        new TaxonDeletionConfigurator(),
                                                        taxonNavigator,
-                                                       taxonNavigator,
                                                        null);
 
                                        AbstractUtility.executeOperation(operation, sync);
index d77313fff5df70be06e64649df4ec21453ca7836..be1d0f3d5fa7ed26897dbf2fcfd2061c492a0892 100644 (file)
@@ -205,6 +205,10 @@ public class DeleteTaxonNodeHandlerE4 extends CdmHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(TaxonNode.class, EnumSet.of(CRUD.DELETE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.size()==1
                 && (selection.getFirstElement() instanceof TaxonNodeDto)
                 ||
index 914d884fed42d0b09633a4f9bce93daf5ed9b9f8..f05e0b17b7a2e63fb8d07c9f427d7fac4da019a3 100644 (file)
@@ -93,7 +93,6 @@ public class MoveFactualDataHandlerE4 extends CdmHandlerE4 {
         excludeTaxa.add(sourceTaxonNode.getUuid());
 
         targetTaxonNode = TaxonNodeSelectionDialog.select(shell,
-//                new ConversationHolderMock(),
                 Messages.RemotingMoveFactualDataHandler_CHOOSE_TAXA,
                 excludeTaxa,
                 CdmStore.getService(ITaxonNodeService.class).find(sourceTaxonNode.getUuid()),
@@ -126,6 +125,10 @@ public class MoveFactualDataHandlerE4 extends CdmHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(Taxon.class, EnumSet.of(CRUD.UPDATE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.size()==1
                 && selection.getFirstElement() instanceof TaxonNodeDto
                 && ((TaxonNodeDto)selection.getFirstElement()).getTaxonUuid()  != null;
index ec74351114c1c30e4c5911c30e9a964a7be883c5..75e33abc8f78ae9ec133c6e583f9890697fbd5a6 100755 (executable)
@@ -93,7 +93,6 @@ public class MoveFactualDataSetNameInSourceHandlerE5 extends CdmHandlerE4 {
         excludeTaxa.add(sourceTaxonNode.getUuid());
 
         targetTaxonNode = TaxonNodeSelectionDialog.select(shell,
-//                new ConversationHolderMock(),
                 Messages.RemotingMoveFactualDataHandler_CHOOSE_TAXA,
                 excludeTaxa,
                 CdmStore.getService(ITaxonNodeService.class).find(sourceTaxonNode.getUuid()),
@@ -129,6 +128,10 @@ public class MoveFactualDataSetNameInSourceHandlerE5 extends CdmHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(Taxon.class, EnumSet.of(CRUD.UPDATE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.size()==1
                 && selection.getFirstElement() instanceof TaxonNodeDto
                 && ((TaxonNodeDto)selection.getFirstElement()).getTaxonUuid()  != null;
index 59192fe14617a0d64541c73179ca16cef499898b..44307e450436e9674e6413acb8d2a2e0640e5cd6 100644 (file)
@@ -198,6 +198,10 @@ public class MoveTaxonNodeHandlerE4 extends CdmHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(TaxonNode.class, EnumSet.of(CRUD.UPDATE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.getFirstElement() instanceof TaxonNodeDto
                 && ((TaxonNodeDto)selection.getFirstElement()).getTaxonUuid() != null;
         menuItem.setVisible(canExecute);
index 3a4e18062ada7522bed1c4b41684bdf295b7bbcd..151bd6ebe306ede89a0fa8f89e768e3d3d9c3c28 100644 (file)
@@ -49,6 +49,22 @@ public class NewClassificationHandlerE4 {
 
         //TODO Performance check for existing classification causes server call, this should be cached somehow
         canExecute = !PreferencesUtil.getBooleanValue(PreferencePredicate.DisableMultiClassification.getKey()) || TaxonNodePropertyTester.noClassifiactionExists();
+        if (!canExecute) {
+            return canExecute;
+        }
+        //canExecute = canExecute && CdmStore.currentAuthentiationHasPermission(TaxonNode.class, CREATE);
+
+//        CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN, Role.ROLE_PROJECT_MANAGER);
+//        CdmStore.getCurrentAuthentiation().getAuthorities().contains(menuItem)
+//        if (selection != null && selection.getFirstElement() != null && selection.getFirstElement() instanceof TaxonNodeDto) {
+//            TaxonNodeDto targetNode = (TaxonNodeDto)selection.getFirstElement();
+//            TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(targetNode.getUuid());
+//            boolean hasTargetNodePermission = CdmStore.currentAuthentiationHasPermission(node, UPDATE);
+//
+//            canExecute = canExecute && hasTargetNodePermission;
+//            canExecute = canExecute && CdmStore.currentAuthentiationHasPermission(node, CREATE);
+//        }
+
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index 92fdade0420e9bf7ad2e991f5ad001446f1341f4..072a4f907d39f98095320ffe1ce1391448271de3 100644 (file)
@@ -9,6 +9,8 @@
 
 package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
 
+import java.util.EnumSet;
+
 import javax.inject.Named;
 
 import org.eclipse.core.runtime.IStatus;
@@ -24,13 +26,15 @@ import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
 
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.permission.CRUD;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.event.EventUtility;
-import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
 import eu.etaxonomy.taxeditor.newWizard.NewTaxonNodeWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewTaxonNodeWizardDialog;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  *
@@ -39,6 +43,8 @@ import eu.etaxonomy.taxeditor.newWizard.NewTaxonNodeWizardDialog;
  *
  */
 public class NewTaxonNodeHandlerE4 {
+    private static final EnumSet<CRUD> CREATE = EnumSet.of(CRUD.CREATE);
+    private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
 
     @Execute
     public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
@@ -72,6 +78,19 @@ public class NewTaxonNodeHandlerE4 {
             MHandledMenuItem menuItem){
         boolean canExecute = false;
         canExecute = selection!=null && selection.size()==1;
+        if (!canExecute) {
+            return canExecute;
+        }
+        //canExecute = canExecute && CdmStore.currentAuthentiationHasPermission(TaxonNode.class, CREATE);
+        if (selection != null && selection.getFirstElement() != null && selection.getFirstElement() instanceof TaxonNodeDto) {
+            TaxonNodeDto targetNode = (TaxonNodeDto)selection.getFirstElement();
+            TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(targetNode.getUuid());
+            boolean hasTargetNodePermission = CdmStore.currentAuthentiationHasPermission(node, UPDATE);
+
+            canExecute = canExecute && hasTargetNodePermission;
+            canExecute = canExecute && CdmStore.currentAuthentiationHasPermission(node, CREATE);
+        }
+
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index b46583e9c98c6109cdaffa03afb1dfe2d6d755da..e14c7604640cb9e30216a0d53338de36cc8384ac 100755 (executable)
@@ -127,6 +127,10 @@ public class SetSecReferenceForSubtreeHandlerE4 extends CdmHandlerE4 {
     @CanExecute
     private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
         boolean canExecute = false;
+//        boolean hasPermission = CdmStore.currentAuthentiationHasPermission(Taxon.class, EnumSet.of(CRUD.UPDATE));
+//        if (!hasPermission && !CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_ADMIN)) {
+//            return hasPermission;
+//        }
         canExecute = selection.size()==1
                 && selection.getFirstElement() instanceof TaxonNodeDto;
         menuItem.setEnabled(canExecute);
index 79cdd3a73952df500f63961cdb13cf4f9f854022..b2d8b54b5ca43b41f6f8c218d91ef9d7e38cb94c 100644 (file)
@@ -30,32 +30,25 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
 import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
-import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;\r
+import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;\r
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.navigation.l10n.Messages;\r
 import eu.etaxonomy.taxeditor.operation.CdmUpdateOperation;\r
 \r
-\r
 /**\r
  * @author cmathew\r
  * @date 17 Jun 2015\r
- *\r
  */\r
 public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {\r
 \r
-    private Set<UUID> oldTaxonNodeUuids = new HashSet();\r
+    private Set<UUID> oldTaxonNodeUuids = new HashSet<>();\r
     private final UUID newAcceptedTaxonNodeUuid;\r
     private UUID secundumUuid;\r
     private boolean setNameInSource ;\r
     private SecReferenceHandlingEnum secHandling;\r
-    private DeleteResult deleteResult;\r
-\r
 \r
     private final static String LABEL = Messages.RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP;\r
 \r
-    /**\r
-     * @param label\r
-     */\r
     public ChangeAcceptedTaxonToSynonymOperation(Object source,\r
             boolean async,\r
             Set<UUID> oldTaxonNodeUuids,\r
@@ -75,9 +68,6 @@ public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {
 \r
     }\r
 \r
-    /**\r
-     * @param label\r
-     */\r
     public ChangeAcceptedTaxonToSynonymOperation(Object source,\r
             boolean async,\r
             UUID oldTaxonNodeUuid,\r
@@ -96,9 +86,6 @@ public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {
         this.secHandling = secHandling;\r
     }\r
 \r
-    /**\r
-     * @param label\r
-     */\r
     public ChangeAcceptedTaxonToSynonymOperation(Object source,\r
             boolean async,\r
             UUID oldTaxonNodeUuid,\r
@@ -114,9 +101,6 @@ public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {
         this.secHandling = secHandling;\r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see eu.etaxonomy.taxeditor.operation.CdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
-     */\r
     @Override\r
     protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {\r
 \r
@@ -153,17 +137,15 @@ public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {
                    }\r
                }\r
            }\r
-\r
        }\r
        if (newTaxon != null && oldTaxaPublished != newTaxon.isPublish()){\r
             MessagingUtils.warningDialog("Publish flag", null, Messages.RemotingChangeAcceptedTaxonToSynonym_warning_publish);\r
         }\r
-       updateNameEditor();\r
+       updateTaxonEditor();\r
        return updateResult;\r
-\r
     }\r
 \r
-    private void updateNameEditor(){\r
+    private void updateTaxonEditor(){\r
        if (partService != null){\r
            Display.getDefault().asyncExec(new Runnable() {\r
 \r
@@ -178,11 +160,11 @@ public class ChangeAcceptedTaxonToSynonymOperation extends CdmUpdateOperation {
                                        if (part.getContributionURI().endsWith("TaxonNameEditorE4")){\r
 \r
                                        }\r
-                                       if (object instanceof TaxonNameEditorE4 ){\r
-                                               Set<TaxonNode> nodes = ((TaxonNameEditorE4)object).getTaxon().getTaxonNodes();\r
+                                       if (object instanceof TaxonEditor ){\r
+                                               Set<TaxonNode> nodes = ((TaxonEditor)object).getTaxon().getTaxonNodes();\r
                                                for (TaxonNode node: nodes){\r
                                                        if (node.getUuid().equals(newAcceptedTaxonNodeUuid)){\r
-                                                               EditorUtil.updateEditor(node, (TaxonNameEditorE4)object);\r
+                                                               EditorUtil.updateEditor(node, (TaxonEditor)object);\r
                                                        }\r
 \r
                                                }\r
index d5227c00cf2445af371c357b68977be02e833d7f..ed91db4e3369011bd5dc0380df9db76e4645c821 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
@@ -55,15 +54,13 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
      * @param label a {@link java.lang.String} object.
      * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
      * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
      * @param treeNodes a {@link java.util.Set} object.
      */
     public DeleteOperation(String label, IUndoContext undoContext,
             TaxonNodeDto taxonNode, TaxonDeletionConfigurator config,
             IPostOperationEnabled postOperationEnabled,
-            IConversationEnabled conversationEnabled,
             ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-        super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+        super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
         this.taxonNode = taxonNode;
         this.config = config;
         this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
@@ -75,15 +72,13 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
      * @param label a {@link java.lang.String} object.
      * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
      * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
      * @param treeNodes a {@link java.util.Set} object.
      */
     public DeleteOperation(String label, IUndoContext undoContext,
             Set<TaxonNodeDto> treeNodes, TaxonDeletionConfigurator config,
             IPostOperationEnabled postOperationEnabled,
-            IConversationEnabled conversationEnabled,
             ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-        super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+        super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
         this.treeNodes = treeNodes;
         this.config = config;
         this.cdmEntitySessionEnabled = cdmEntitySessionEnabled;
index f56202746b692f1878d3e8b0b4aa818455f2b6a8..b5e20608f546c1c90e4292036f4ad526823be0e9 100644 (file)
@@ -14,7 +14,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.config.SubtreeCloneConfigurator;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
@@ -42,9 +41,8 @@ public class CloneClassificationOperation extends AbstractPersistentPostOperatio
 
     public CloneClassificationOperation(String label, IUndoContext undoContext, Classification classification,
             String classificationName, Reference sec, TaxonRelationshipType relationType,
-            IPostOperationEnabled postOperationEnabled,
-            IConversationEnabled conversationEnabled) {
-        super(label, undoContext, postOperationEnabled, conversationEnabled);
+            IPostOperationEnabled postOperationEnabled) {
+        super(label, undoContext, postOperationEnabled);
 
         this.classification = classification;
         this.classificationName = classificationName;
index 107b311faa6ae5545454baa70d75dff1429b1658..fa39d05fbaba6e937de7e9dbaa3167fa76067b89 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
@@ -44,13 +43,11 @@ public class CreateClassification extends AbstractPersistentPostOperation {
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public CreateClassification(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
                        ICdmEntitySessionEnabled cdmEntitiySessionEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitiySessionEnabled);
+               super(label, undoContext, postOperationEnabled, cdmEntitiySessionEnabled);
 
                this.classification = classification;
 
index 5d736690339ebaf98b82f16947f2bfc1498eea23..8d24a50aa5fada3b740bfeece7ef9923afaded6d 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -43,9 +42,8 @@ public class CreateNewTaxonHierarchyOperation extends AbstractPersistentPostOper
      * @param undoContext
      */
     public CreateNewTaxonHierarchyOperation(String label, IUndoContext undoContext, Classification classification,
-            IPostOperationEnabled postOperationEnabled,
-            IConversationEnabled conversationEnabled) {
-        super(label, undoContext, postOperationEnabled, conversationEnabled);
+            IPostOperationEnabled postOperationEnabled) {
+        super(label, undoContext, postOperationEnabled);
 
         this.classification = classification;
         this.service = CdmStore.getService(IClassificationService.class);
index c64bc4da55f4451e887a46574395f278dafa7443..a30d278fe35531b3fbb452d548151647197e3062 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
@@ -43,9 +42,8 @@ public class CreatePolytomousKey extends AbstractPersistentPostOperation {
                        IUndoContext undoContext,
                        PolytomousKey key,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
                        ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+               super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
                this.key = key;
        }
 
index 67f4a13486f9fb7ef66e9fba646ae991e2ed4939..cf73f045f1d762f0b807e126ef2dd0bf42e55533 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -49,15 +48,13 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public CreateTaxonNode(String label,
                IUndoContext undoContext,
                TaxonNodeDto parentNode, TaxonName name,
                IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
-            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, cdmEntitySessionEnabled);
 
                newTaxon = Taxon.NewInstance(name, null);
        }
@@ -70,16 +67,14 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public CreateTaxonNode(String label,
                IUndoContext undoContext,
                TaxonNodeDto parentNode,
                Taxon taxon,
                IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
-            ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
-               super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled, cdmEntitySessionEnabled);
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+               super(label, undoContext, parentNode, postOperationEnabled, cdmEntitySessionEnabled);
 
                this.newTaxon = taxon;
        }
index 1775bc50bc14aa53f3e40042304dd823d15dd82e..b76e67ef5aacda017ee0ddc803cdc1d3cedeebdf 100644 (file)
@@ -43,8 +43,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IMemento;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
@@ -65,7 +63,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since Sep 27, 2017
  *
  */
-public class SearchResultViewE4 implements IConversationEnabled{
+public class SearchResultViewE4 {
 
        private static Object[] EMPTY = new Object[0];
 
@@ -91,8 +89,6 @@ public class SearchResultViewE4 implements IConversationEnabled{
 
        private TableViewer resultViewer;
 
-       private ConversationHolder conversation;
-
        private Text searchString;
 
        private Text configurationLabel;
@@ -120,15 +116,7 @@ public class SearchResultViewE4 implements IConversationEnabled{
        /** {@inheritDoc} */
        @PostConstruct
        public void createPartControl(Composite parent, EMenuService menuService) {
-        if (CdmStore.isActive()){
-            if(conversation == null){
-                conversation = getConversation_internal();
-            }
-        }
-        else{
-            return;
-        }
-               contextListener = new ContextListener();
+               contextListener = new ContextListener();
                CdmStore.getContextManager().addContextListener(contextListener);
 
                GridLayout layout = new GridLayout();
@@ -261,55 +249,23 @@ public class SearchResultViewE4 implements IConversationEnabled{
        @Focus
        public void setFocus() {
                //logger.warn("Setting focus to search result viewer");
-               ConversationHolder conversation_internal = getConversation_internal();
-               if(conversation_internal!=null){
-                   conversation_internal.bind();
-               }
+               
                // pass focus to resultViewer
                if(resultViewer!=null && resultViewer.getControl()!=null && !resultViewer.getControl().isDisposed()){
                    resultViewer.getControl().setFocus();
                }
        }
 
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
-    public ConversationHolder getConversationHolder() {
-               return this.conversation;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {
-               // TODO Auto-generated method stub
-
-       }
+       
 
        /** {@inheritDoc} */
        @PreDestroy
        public void dispose() {
-               if(conversation!=null){
-                   conversation.close();
-                   conversation = null;
-               }
                if(searchJob != null) {
             searchJob.cancel();
         }
        }
 
-       private ConversationHolder getConversation_internal(){
-           if(conversation==null && CdmStore.isActive()){
-               try {
-                   conversation = CdmStore.createConversation();
-            } catch (Exception e) {
-                //nothing
-            }
-           }
-           return conversation;
-       }
 
        /**
         *
index 6158c81456e097778a64a9c25cc6e0a6c1458220..c1a193c2d8fd8c170317903c30d233d52e50262f 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Printpublisher Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Export-Package: eu.etaxonomy.cdm.print,
  eu.etaxonomy.cdm.print.out,
  eu.etaxonomy.cdm.print.out.odf,
@@ -47,8 +47,8 @@ Require-Bundle: org.eclipse.osgi,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.store
 Bundle-ClassPath: .,
- lib/cdmlib-print-5.33.0.jar,
- lib/cdmlib-remote-5.33.0.jar
+ lib/cdmlib-print-5.42.0.jar,
+ lib/cdmlib-remote-5.42.0.jar
 Import-Package: org.apache.logging.log4j,
  org.apache.logging.log4j.core,
  org.eclipse.core.runtime,
index 390896fa0e3a5b39062aaec39330634567c7899e..90bb58e221d990104a454b769c4692f73cc5ebec 100644 (file)
@@ -2,7 +2,7 @@ source.. = src/main/java/
 bin.includes = META-INF/,\
                .,\
                plugin.xml,\
-               lib/cdmlib-print-5.33.0.jar,\
-               lib/cdmlib-remote-5.33.0.jar,\
+               lib/cdmlib-print-5.42.0.jar,\
+               lib/cdmlib-remote-5.42.0.jar,\
                OSGI-INF/l10n/bundle.properties,\
                OSGI-INF/l10n/bundle_de.properties,\
index ae91e8496af88d7fdc9a13d0a7a7e48c5df462bb..2576a69868b65539a18a0b650e12377251b03857 100644 (file)
@@ -3,7 +3,7 @@
        <parent>
                <artifactId>taxeditor-parent</artifactId>
                <groupId>eu.etaxonomy</groupId>
-               <version>5.33.0</version>
+               <version>5.42.0</version>
        </parent>
 
        <modelVersion>4.0.0</modelVersion>
index d557f0e698ba4655c65fbbafd63c9f7246f8149a..761dcd11ba38537d1281bccc76d2e40dc381100e 100644 (file)
@@ -6,7 +6,6 @@
 * 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.printpublisher.handler;
 
 import java.util.UUID;
@@ -24,14 +23,11 @@ import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.out.pdf.PdfOutputModule;
 import eu.etaxonomy.cdm.print.out.xml.XMLOutputModule;
-import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
+import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.printpublisher.wizard.DirectPublishingWizard;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>GeneratePdfHandler class.</p>
- *
  * @author n.hoffmann
  * @created Jul 20, 2010
  */
@@ -46,15 +42,16 @@ public class GeneratePdfHandler extends AbstractHandler {
 
                IEditorInput input = editor.getEditorInput();
 
-               if(!(input instanceof TaxonEditorInputE4)){
+               if(!(input instanceof TaxonEditorInput)){
                        MessagingUtils.warningDialog("PDF generation not supported for selected input", this, "Generating PDF output is not supported for the current active editor");
 
                        return null;
                }
 
-               configurator = PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationConfiguration());
+               //Note: was NewLocalInstance before
+               configurator = PublishConfigurator.NewRemoteInstance();
 
-               Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInputE4) input);
+               Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInput) input);
                configurator.addSelectedTaxonNodeElements(taxonNodeElement);
 
                configurator.setDoPublishEntireBranches(false);
@@ -70,7 +67,7 @@ public class GeneratePdfHandler extends AbstractHandler {
                return null;
        }
 
-       private Element getTaxonNodeElement(TaxonEditorInputE4 input){
+       private Element getTaxonNodeElement(TaxonEditorInput input){
 
                UUID taxonNodeUuid = input.getTaxonNode().getUuid();
 
index c9d3281c7f23af6d2432f8c8d57b9e6304388bfa..a598e92e7bd2397310366c18ca4994744c42ff94 100644 (file)
@@ -15,14 +15,12 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.Publisher;
 import eu.etaxonomy.cdm.print.out.IPublishOutputModule;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.printpublisher.internal.PrintpublisherPlugin;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>AbstractPublishWizard class.</p>
@@ -71,24 +69,25 @@ public abstract class AbstractPublishWizard extends Wizard implements IExportWiz
                        @Override
                        protected IStatus run(IProgressMonitor monitor) {
                                monitor.beginTask("Print Publisher", getConfigurator().calculateNumberOfNodes() + 1);
-                               ConversationHolder conversation = null;
+
                                try{
                                        getConfigurator().setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
 
                                        if(getConfigurator().isLocal()){
-                                               conversation = CdmStore.createConversation();
-                                               // we want to enforce that the session is closed and nothing is
-                                               // instantiated beneath the regular cdmlib-remote object boundaries
-                                               conversation.commit(false);
+                                           //TODO conversation not supported anymore as we use only remote
+//                                             conversation = CdmStore.createConversation();
+//                                             // we want to enforce that the session is closed and nothing is
+//                                             // instantiated beneath the regular cdmlib-remote object boundaries
+//                                             conversation.commit(false);
                                        }
 
                                        Publisher.publish(getConfigurator());
 
                                }finally{
                                        monitor.done();
-                                       if(conversation != null) {
-                        conversation.close();
-                    }
+//                                     if(conversation != null) {
+//                        conversation.close();
+//                    }
                                        Display.getDefault().asyncExec(new Runnable() {
                                                @Override
                                                public void run() {
index ce974cc920fab1b240b096ccaacdba840b3bb36c..98174fae499fc0aab40cefb668dcfffa8cb44708 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -37,19 +37,13 @@ import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Text;
 import org.jdom.Element;
 
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.print.IXMLEntityFactory;
 import eu.etaxonomy.cdm.print.PublishConfigurator;
 import eu.etaxonomy.cdm.print.XMLHelper;
 import eu.etaxonomy.cdm.print.XMLHelper.EntityType;
-import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.printpublisher.PrintUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>SelectServiceWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Apr 6, 2010
  */
@@ -67,7 +61,8 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                setTitle("Select a Service");
        }
 
-       public void createControl(Composite parent) {
+       @Override
+    public void createControl(Composite parent) {
 
                composite = new Composite(parent, SWT.NULL);
                composite.setLayout(new GridLayout());
@@ -83,17 +78,18 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                                "connected to will be used to gather data.)");
 
                button_local.addSelectionListener(listener);
-                               
+
                button_remote = new Button(radioGroup, SWT.RADIO);
                button_remote.setText("Remote");
                button_remote.addSelectionListener(listener);
-               
+
                text_serviceUrl = new Text(radioGroup, SWT.BORDER);
                text_serviceUrl.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-               text_serviceUrl.setText("http://");     
+               text_serviceUrl.setText("http://");
                text_serviceUrl.addModifyListener(new ModifyListener() {
 
-                       public void modifyText(ModifyEvent e) {
+                       @Override
+            public void modifyText(ModifyEvent e) {
                                String text = text_serviceUrl.getText();
 
                                if(!text.endsWith("/")){
@@ -114,7 +110,7 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                                getConfigurator().setWebserviceUrl(url);
 
                                SelectServiceWizardPage.this.setErrorMessage(null);
-       
+
                        }
                });
 
@@ -127,12 +123,12 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
 
                treeViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
-               if(CdmStore.isActive()){
-                       enableLocal();
-               }else{
+//             if(CdmStore.isActive()){
+//                     enableLocal();
+//             }else{
                        enableRemote();
                        button_local.setEnabled(false);
-               }
+//             }
 
                setControl(composite);
        }
@@ -157,23 +153,28 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                setConfigurator(PublishConfigurator.NewRemoteInstance());
                getConfigurator().addOutputModule(getOutputModule());
        }
-       
+
+       /**
+        * @deprecated real local is not supported anymore, also the currently active
+        *             database is a "remoting" database
+        */
+       @Deprecated
        private void enableLocal() {
                button_remote.setSelection(false);
                button_local.setSelection(true);
 
                text_serviceUrl.setEnabled(false);
 
-               setConfigurator(PublishConfigurator.NewLocalInstance((ICdmRepository) CdmStore.getCurrentApplicationConfiguration()));
+               setConfigurator(PublishConfigurator.NewRemoteInstance());
                getConfigurator().addOutputModule(getOutputModule());
                refresh();
        }
 
        @Override
-       public boolean canFlipToNextPage() {    
+       public boolean canFlipToNextPage() {
                return isPageComplete();
        }
-       
+
        public void refresh(){
 
                if(getConfigurator() != null){
@@ -185,7 +186,7 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                                        monitor.beginTask("Loading classifications", IProgressMonitor.UNKNOWN);
                                        IXMLEntityFactory factory = getConfigurator().getFactory();
                                        final List<Element> classifications = factory.getClassifications();
-                                       
+
                                        Display.getDefault().asyncExec(new Runnable(){
 
                                                @Override
@@ -207,83 +208,90 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                        }
                }
        }
-               
+
        @Override
        public boolean isPageComplete() {
                boolean complete = true;
                if(getConfigurator().isLocal()){
                        complete &= true;
-               }else if(getConfigurator().isRemote() 
-                               && getConfigurator().getWebserviceUrl() != null 
+               }else if(getConfigurator().isRemote()
+                               && getConfigurator().getWebserviceUrl() != null
                                && getConfigurator().getWebserviceUrl().toString().endsWith("/")){
                        complete &= true;
                }else{
                        return false;
                }
-               
+
                List<Element> selectedTaxonNodes = getConfigurator().getSelectedTaxonNodeElements();
-               
+
                complete &= !selectedTaxonNodes.isEmpty();
-               
+
                return complete;
        }
-       
+
        private class SelectionChangedListener implements ISelectionChangedListener {
 
-               public void selectionChanged(SelectionChangedEvent event) {
+               @Override
+        public void selectionChanged(SelectionChangedEvent event) {
                        StructuredSelection selection = (StructuredSelection) treeViewer.getSelection();
-                       
+
                        List<Element> selectedElements = selection.toList();
                        if(selectedElements.size() > 0){
                                getConfigurator().setSelectedTaxonNodeElements(selectedElements);
                                setPageComplete(true);
                        }
                }
-               
+
        }
-       
+
        private class ContentProvider implements ITreeContentProvider{
 
-               public Object[] getChildren(Object parentElement) {
+               @Override
+        public Object[] getChildren(Object parentElement) {
                        if(parentElement instanceof List){
                                return ((List)parentElement).toArray();
                        }
                        else if(parentElement instanceof Element){
                                Element element = (Element) parentElement;
-                               
+
                                IXMLEntityFactory factory = getConfigurator().getFactory();
-                               
+
                                return factory != null ? factory.getChildNodes(element).toArray() : new Object[]{};
-                               
+
                        }
-                       
+
                        return new Object[]{};
                }
 
-               public Object getParent(Object element) {
+               @Override
+        public Object getParent(Object element) {
                        return null;
                }
 
-               public boolean hasChildren(Object element) {
+               @Override
+        public boolean hasChildren(Object element) {
                        return getChildren(element).length > 0;
                }
 
-               public Object[] getElements(Object inputElement) {
+               @Override
+        public Object[] getElements(Object inputElement) {
                        return getChildren(inputElement);
                }
 
-               public void dispose() {
-                       
+               @Override
+        public void dispose() {
+
                }
 
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-                       
-               }       
+               @Override
+        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+               }
        }
-       
+
        private class LabelProvider  extends ColumnLabelProvider
                implements ILabelProvider{
-               
+
                @Override
                public String getText(Object element) {
                        if(element instanceof Element){
@@ -291,10 +299,10 @@ public class SelectServiceWizardPage extends AbstractPublishWizardPage {
                                EntityType entityType = XMLHelper.getEntityType(xmlElement);
                                if(EntityType.TAXON_NODE.equals(entityType)){
                                        xmlElement = getConfigurator().getFactory().getTaxonForTaxonNode(xmlElement);
-                               }                               
+                               }
                                return XMLHelper.getTitleCache(xmlElement);
                        }
                        return "no title cache";
-               }       
+               }
        }
 }
\ No newline at end of file
index a2c2acefdd0b6bc5c0ffbd9d8abed328da54dd32..852f33e9d59c7261b3bd97d16abce82078a3bfef 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: DataStore Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
 Bundle-Vendor: EDIT
 Bundle-Localization: OSGI-INF/l10n/bundle
index 46ddbbced18b5f1b2b54d6e7393e7af915123d87..e235fb2099ad25bb33b1543d0584ade02d0013df 100644 (file)
@@ -74,11 +74,9 @@ command.name.7 = New Term Vocabulary
 category.name = CDM\r
 wizard.name = TCS\r
 wizard.name.0 = Berlin Model\r
-wizard.name.1 = Endnote\r
 wizard.name.2 = Excel Normal Explicit\r
 wizard.name.3 = ABCD file\r
 wizard.name.4 = SDD\r
-wizard.name.5 = Specimen CDM Excel\r
 category.name.0 = CDM\r
 wizard.name.6 = JAXB\r
 wizard.name.7 = Berlin Model\r
@@ -94,6 +92,7 @@ wizard.name.15 = Polytomous Key
 category.name.2 = CDM\r
 wizard.name.16 = Taxon\r
 wizard.name.17 = Classification\r
+wizard.name.123 = WFO Backbone\r
 themeElementCategory.label = Taxonomic Editor\r
 themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor\r
 colorDefinition.label = List Background\r
@@ -177,6 +176,7 @@ command.label.CHANGE_PASSWORD = Change password
 command.label.CONNECT = Connect\r
 command.label.RE_CONNECT = Re-connect\r
 wizard.name.22 = CDM light (csv)\r
+wizard.name.122 = Col DP\r
 wizard.name.23 = Excel Distribution Data Update\r
 wizard.name.24 = RIS\r
 command.label.25 = Import Preferences
@@ -210,8 +210,8 @@ handledmenuitem.label.4 = Export as Word file
 handledmenuitem.label.5 = Remove Term
 handledmenuitem.label.6 = Delete
 handledmenuitem.label.7 = Kind Of Term
-partdescriptor.label.1 = GFBio Term Import
-partdescriptor.tooltip.1 = GFBio Term Import
+partdescriptor.label.1 = GFBio Term Search
+partdescriptor.tooltip.1 = GFBio Term Search
 command.commandname.1 = Add Feature
 command.description.1 = Add a term to the term tree
 command.commandname.2 = Remove term
@@ -229,8 +229,8 @@ command.commandname.10 = Restart
 menu.label.1 = Terms
 handledmenuitem.label.8 = Term Tree
 handledmenuitem.tooltip.1 = Term Tree Editor
-handledmenuitem.label.9 = GFBio Term Import
-handledmenuitem.tooltip.2 = GFBio Term Import
+handledmenuitem.label.9 = GFBio Term Search
+handledmenuitem.tooltip.2 = GFBio Term Search
 menu.label.2 = Export
 menu.label.3 = Import
 handledmenuitem.label.10 = Restart
index 9d2ad599c546c906985c26e7fa3ef231e32c5f2d..f3ebc2ede29dbabf3a16e49c7a29174997048589 100644 (file)
@@ -74,11 +74,9 @@ command.name.7 = Neues Begriffsvokabular
 category.name = CDM
 wizard.name = TCS
 wizard.name.0 = Berlin Modell
-wizard.name.1 = Endnote
 wizard.name.2 = Excel Normal Explicit
 wizard.name.3 = ABCD Datei
 wizard.name.4 = SDD
-wizard.name.5 = Beleg CDM Excel
 category.name.0 = CDM
 wizard.name.6 = JAXB
 wizard.name.7 = Berlin Model
@@ -94,6 +92,7 @@ wizard.name.15 = Polytome Schl\u00fcssel
 category.name.2 = CDM
 wizard.name.16 = Taxon
 wizard.name.17 = Klassifikation
+wizard.name.123 = WFO Backbone
 themeElementCategory.label = Taxonomischer Editor
 themeElementCategory.description = Farb- und Schriftdefinitionen f\u00fcr den EDIT Taxonomischen Editor
 colorDefinition.label = Liste Hintergrund
@@ -177,6 +176,7 @@ command.label.CHANGE_PASSWORD = Kennwort 
 command.label.CONNECT = Verbinden
 command.label.RE_CONNECT = Aktualisiere Verbindung
 wizard.name.22 = CDM light (csv)
+wizard.name.122 = Col DP
 wizard.name.23 = Excel Verbreitungsdaten Update
 wizard.name.24 = RIS
 command.label.25 = Import Präferenzen
@@ -211,8 +211,8 @@ handledmenuitem.label.4 = Als Word-Datei exportieren
 handledmenuitem.label.5 = Term entfernen
 handledmenuitem.label.6 = Löschen
 handledmenuitem.label.7 = Kind-Of Term
-partdescriptor.label.1 = GFBio Term Import
-partdescriptor.tooltip.1 = GFBio Term Import
+partdescriptor.label.1 = GFBio Term Suche
+partdescriptor.tooltip.1 = GFBio Term Suche
 command.commandname.1 = Term hinzufügen
 command.description.1 = Term dem Termbaum hinzufügen
 command.commandname.2 = Term entfernen
@@ -230,8 +230,8 @@ command.commandname.10 = Neustarten
 menu.label.1 = Terme
 handledmenuitem.label.8 = Termbaum
 handledmenuitem.tooltip.1 = Termbaum-Editor
-handledmenuitem.label.9 = GFBio Term Import
-handledmenuitem.tooltip.2 = GFBio Term Import
+handledmenuitem.label.9 = GFBio Term Suche
+handledmenuitem.tooltip.2 = GFBio Term Suche
 menu.label.2 = Export
 menu.label.3 = Import
 handledmenuitem.label.10 = Neustarten
index cc3658576c35afe2d7b7c1557c5b5aead1b81408..0ed91f000969d784e4d80e015e7452b8a9555f79 100644 (file)
         <children xsi:type="menu:HandledMenuItem" xmi:id="_-y1Cj8KPEem1vZq1LletZg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.deletefeaturetree" label="%handledmenuitem.label.6" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/delete.gif" command="_3mqzkCFdEeiVXriJfxPIuA"/>
       </menus>
     </elements>
+    <elements xsi:type="basic:PartDescriptor" xmi:id="_WsXuMJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.view.remoteservers" label="Remote Servers" iconURI="" closeable="true" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart">
+      <handlers xmi:id="_WsXuMZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.CreateRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.CreateRemoteServerHandler" command="_nYPOkJ1XEe2Oid79gMgNzw"/>
+      <handlers xmi:id="_WsXuMp1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.EditRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.EditRemoteServerHandler" command="_m1wMkJ1XEe2Oid79gMgNzw"/>
+      <handlers xmi:id="_WsXuNJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handler.DeleteRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.DeleteRemoteServerHandler" command="_lvyqEJ1XEe2Oid79gMgNzw"/>
+      <handlers xmi:id="_l8zFcNkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.handler.MoveUpRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.MoveUpRemoteServerHandler" command="_tEWW8NkaEe231IdeAjpAvg"/>
+      <handlers xmi:id="_8KIN0NkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.handler.MoveDownRemoteServerHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.view.remoteserver.handler.MoveDownRemoteServerHandler" command="_-iLDQNkbEe231IdeAjpAvg"/>
+      <menus xsi:type="menu:PopupMenu" xmi:id="_WsXuNZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.popupmenu.remoteServerViewPart">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuNp1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.new" label="New" command="_nYPOkJ1XEe2Oid79gMgNzw"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuN51XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.edit" label="Edit" command="_m1wMkJ1XEe2Oid79gMgNzw"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_WsXuOZ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.delete" label="Delete" command="_lvyqEJ1XEe2Oid79gMgNzw"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_lMYVINkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.moveup" label="Move up" command="_tEWW8NkaEe231IdeAjpAvg"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_6bF5INkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.movedown" label="Move down" command="_-iLDQNkbEe231IdeAjpAvg"/>
+      </menus>
+    </elements>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_3rW8wCXaEeex9MwMOgUeWw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.menu.showView" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.afterConcept">
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_TlufMCaGEeeTEd_pKXBflg" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.supplemental" label="%command.label.1" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/applications-office.png" tooltip="%command.label.1" command="_bnVKsCZxEeeQLpuomSmVoQ">
     <elements xsi:type="commands:Command" xmi:id="_qAEkYKmjEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importExcelTaxa" commandName="%wizard.name.2"/>
     <elements xsi:type="commands:Command" xmi:id="_tBCr8KmsEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importRisReference" commandName="%wizard.name.24"/>
     <elements xsi:type="commands:Command" xmi:id="_bLGTMKmuEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importSdd" commandName="%wizard.name.4"/>
-    <elements xsi:type="commands:Command" xmi:id="_2JV9IKnAEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importExcelSpecimen" commandName="%wizard.name.5"/>
     <elements xsi:type="commands:Command" xmi:id="_OQ9n8KnCEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importTcs" commandName="%wizard.name"/>
     <elements xsi:type="commands:Command" xmi:id="_L0xNEKqYEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportJaxb" commandName="%wizard.name.6"/>
     <elements xsi:type="commands:Command" xmi:id="_ybovsKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.command.exportSdd" commandName="%wizard.name.8"/>
     </elements>
     <elements xsi:type="commands:Command" xmi:id="_MkieEMKuEeufc9n3VJNAaA" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.createFeatureTree_flat" commandName="%command.commandname.flat_tree"/>
     <elements xsi:type="commands:Command" xmi:id="_ukIJAMKuEeufc9n3VJNAaA" elementId="eu.etaxonomy.taxeditor.store.command.featureTree.createFeatureTree_ordered" commandName="%command.commandname.ordered_tree"/>
+    <elements xsi:type="commands:Command" xmi:id="_lB0JwJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.cloneRemoteServer" commandName="Clone"/>
+    <elements xsi:type="commands:Command" xmi:id="_lvyqEJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.deleteRemoteServer" commandName="Delete"/>
+    <elements xsi:type="commands:Command" xmi:id="_m1wMkJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.editRemoteServer" commandName="Edit"/>
+    <elements xsi:type="commands:Command" xmi:id="_nYPOkJ1XEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.command.newRemoteServer" commandName="New"/>
+    <elements xsi:type="commands:Command" xmi:id="_tEWW8NkaEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveUpRemoteServer" commandName="Move up"/>
+    <elements xsi:type="commands:Command" xmi:id="_-iLDQNkbEe231IdeAjpAvg" elementId="eu.etaxonomy.taxeditor.local.command.moveDownRemoteServer" commandName="Move down"/>
+    <elements xsi:type="commands:Command" xmi:id="_lbmBoEi_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.command.exportColDP" commandName="%wizard.name.122"/>
+    <elements xsi:type="commands:Command" xmi:id="_1BzvkLU-Ee6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.store.command.exportWfoBackbone" commandName="%wizard.name.123"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_swGH0GhvEee3K4uKJljEYg" featurename="handlers" parentElementId="xpath:/">
     <elements xsi:type="commands:Handler" xmi:id="_rVEdIGcjEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.termtree.e4.handler.RemoveTermHandler" command="_fNBtQGcjEee0qLTtA2ZpVQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_wvx9oKmjEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.excel.taxa.OpenExcelTaxaImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.in.excel.taxa.OpenExcelTaxaImportWizard" command="_qAEkYKmjEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_96ANIKmsEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.ris.OpenRisImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.in.ris.OpenRisImportWizard" command="_tBCr8KmsEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_do2IAKmuEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.sdd.OpenSddImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.in.sdd.OpenSddImportWizard" command="_bLGTMKmuEeeTAPHmaMLwQQ"/>
-    <elements xsi:type="commands:Handler" xmi:id="_6BmBEKnAEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.excel.specimen.OpenExcelSpecimenImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.in.excel.specimen.OpenExcelSpecimenImportWizard" command="_2JV9IKnAEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_Q8Z6gKnCEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.in.tcs.OpenTcsImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.in.tcs.OpenTcsImportWizard" command="_OQ9n8KnCEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_SciLQKqYEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.io.e4.out.csv.OpenCsvExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.csv.OpenCsvExportWizard" command="_y_uUMKqZEeeXcJGhyhlrKA"/>
     <elements xsi:type="commands:Handler" xmi:id="_SOrDgKqaEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.io.e4.out.jaxb.OpenJaxbExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.jaxb.OpenJaxbExportWizard" command="_L0xNEKqYEeeXcJGhyhlrKA"/>
     <elements xsi:type="commands:Handler" xmi:id="_wSjnIP5VEeqwiqpCwftRog" elementId="eu.etaxonomy.taxeditor.store.handler.searchForPlugin" command="_qENOgP5VEeqwiqpCwftRog"/>
     <elements xsi:type="commands:Handler" xmi:id="_4kk8oDoqEeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.OpenDefinedTermHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.editor.definedterm.e4.handler.OpenDefinedTermEditorHandlerE4" command="_qEMrsIdPEeecZ4F2Y9Z0Og"/>
     <elements xsi:type="commands:Handler" xmi:id="_4GeBAD4fEeuM4JU-Ch98ZA" elementId="eu.etaxonomy.taxeditor.store.OpenTermTreeHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.termtree.e4.handler.OpenTermTreeEditorHandler" command="_8aaicD4fEeuM4JU-Ch98ZA"/>
+    <elements xsi:type="commands:Handler" xmi:id="_oEReoEjAEe6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.io.e4.out.cdmlight.OpenColDPExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.col.OpenColExportWizard" command="_lbmBoEi_Ee6gZ65AByRHxQ"/>
+    <elements xsi:type="commands:Handler" xmi:id="_rng_YLU-Ee6JFM-mIdEBFA" elementId="eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenWfoBackboneExportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.out.wfo.OpenWfoBackboneExportWizard" command="_1BzvkLU-Ee6JFM-mIdEBFA"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_qT4hgIfTEeecZ4F2Y9Z0Og" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.window" positionInList="before:eu.etaxonomy.taxeditor.application.windowMenu.last">
     <elements xsi:type="menu:Menu" xmi:id="_LT3P8IfcEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menu.termeditor" label="%menu.label.1">
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_1xVggMTDEemAeKumL6iTpg" coreExpressionId="isCdmStoreConnected"/>
       <children xsi:type="menu:Menu" xmi:id="_umxYEDocEeuzzbCHEqs6jg" elementId="eu.etaxonomy.taxeditor.store.menu." label="%command.label.12">
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_46o0kDocEeuzzbCHEqs6jg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.features" label="%handledmenuitem.label.24" command="_n5NykDoqEeud_N8qGaxX2Q">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_46o0kDocEeuzzbCHEqs6jg" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.features" label="%handledmenuitem.label.24" tooltip="%handledmenuitem.label.24" command="_n5NykDoqEeud_N8qGaxX2Q">
           <parameters xmi:id="_UQRgQDouEeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.featureEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="FE"/>
         </children>
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_Sa3ZoDo1Eeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.characters" label="%handledmenuitem.label.25" command="_n5NykDoqEeud_N8qGaxX2Q">
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_Sa3ZoDo1Eeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.characters" label="%handledmenuitem.label.25" tooltip="%handledmenuitem.label.25" command="_n5NykDoqEeud_N8qGaxX2Q">
           <parameters xmi:id="_mglxwDo1Eeud_N8qGaxX2Q" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.characterEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="CHA"/>
         </children>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_nsbb4Dq7EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.properties" label="%handledmenuitem.label.27" command="_n5NykDoqEeud_N8qGaxX2Q">
         <children xsi:type="menu:HandledMenuItem" xmi:id="_7VAvkDq8EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.handledmenuitemlabel26" label="%handledmenuitem.label.26" command="_n5NykDoqEeud_N8qGaxX2Q">
           <parameters xmi:id="__0nHYDq8EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.structureEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="STRU"/>
         </children>
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_YFuh4Dq9EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.handledmenuitemlabel31" label="%handledmenuitem.label.31" command="_n5NykDoqEeud_N8qGaxX2Q">
-          <parameters xmi:id="_Yh7VsDq9EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.structureEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="STMO"/>
-        </children>
         <children xsi:type="menu:MenuSeparator" xmi:id="_6DMs8Dq9EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.menuseparator.1"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_3HtMMDq9EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.handledmenuitemlabel20" label="%handledmenuitem.label.20" command="_n5NykDoqEeud_N8qGaxX2Q">
           <parameters xmi:id="_BhV5gDq-EeuAuPxcOe1-XA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.namedAreaEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="NA"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_CUh5gMKOEem1vZq1LletZg" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.structureTreeEditor" label="%handledmenuitem.label.26" tooltip="%handledmenuitem.label.26" command="_8aaicD4fEeuM4JU-Ch98ZA">
           <parameters xmi:id="_CUh5gcKOEem1vZq1LletZg" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.structureTreeEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="STRU"/>
         </children>
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_0JJOoD4FEeuM4JU-Ch98ZA" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.featureTreeEditor" label="%handledmenuitem.label.31" tooltip="%handledmenuitem.label.31" command="_8aaicD4fEeuM4JU-Ch98ZA">
-          <parameters xmi:id="_0JJ1sD4FEeuM4JU-Ch98ZA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.featureTreeEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="STMO"/>
-        </children>
         <children xsi:type="menu:MenuSeparator" xmi:id="_AVOnkP8QEem7jP7thrJFNA" elementId="eu.etaxonomy.taxeditor.store.menuseparator.10"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_ZdYr4PysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.termEditorMenu.propertyTreeEditor" label="%handledmenuitem.label.20" tooltip="%handledmenuitem.label.20" command="_8aaicD4fEeuM4JU-Ch98ZA">
           <parameters xmi:id="_ZdYr4fysEemPDYtIH5gauA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.namedAreaTreeEditor" name="eu.etaxonomy.taxeditor.store.commandparameter.termType" value="NA"/>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_ITE10KkVEeejedk4mZQIGw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.file" positionInList="before:eu.etaxonomy.taxeditor.application.filemenu.io">
     <elements xsi:type="menu:Menu" xmi:id="_z6EugKqXEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.menu.export" label="%menu.label.2">
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_3eyLYKqXEeeXcJGhyhlrKA" coreExpressionId="isCdmStoreConnectedAndShowIOMenuEnabled"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_nf4z0KqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportDwca" label="%wizard.name.9" command="_y69I8KqZEeeXcJGhyhlrKA"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_WVBa4Ex_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportColDP" label="%wizard.name.122" command="_lbmBoEi_Ee6gZ65AByRHxQ"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_eE6dALnTEe6hy6A4KTNM1w" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.wizardname123" label="%wizard.name.123" command="_1BzvkLU-Ee6JFM-mIdEBFA"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_uruvcKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_zLKvMKqZEeeXcJGhyhlrKA"/>
+      <children xsi:type="menu:MenuSeparator" xmi:id="_l9Oe0Ex_Ee6gZ65AByRHxQ" elementId="eu.etaxonomy.taxeditor.store.menuseparator.17"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_OL6sMH1LEem6uMX-L-maww" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportOwlTerm" label="%handledmenuitem.label.22" command="_WISF0H1LEem6uMX-L-maww"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_b9E38KqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportJaxb" label="%wizard.name.6" command="_L0xNEKqYEeeXcJGhyhlrKA"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_lXe84KqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportSdd" label="%wizard.name.8" command="_ybovsKqZEeeXcJGhyhlrKA"/>
-      <children xsi:type="menu:HandledMenuItem" xmi:id="_nf4z0KqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportDwca" label="%wizard.name.9" command="_y69I8KqZEeeXcJGhyhlrKA"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_V3eBEKqYEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCsv" label="%wizard.name.18" command="_y_uUMKqZEeeXcJGhyhlrKA"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_qR5ocKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCsvName" label="%wizard.name.19" command="_zDy74KqZEeeXcJGhyhlrKA"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_tBUcEKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCsvPrint" label="%wizard.name.20" command="_zIKegKqZEeeXcJGhyhlrKA"/>
-      <children xsi:type="menu:HandledMenuItem" xmi:id="_uruvcKqZEeeXcJGhyhlrKA" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportCdmLight" label="%wizard.name.22" command="_zLKvMKqZEeeXcJGhyhlrKA"/>
-      <children xsi:type="menu:HandledMenuItem" xmi:id="_OL6sMH1LEem6uMX-L-maww" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.exportOwlTerm" label="%handledmenuitem.label.22" command="_WISF0H1LEem6uMX-L-maww"/>
     </elements>
     <elements xsi:type="menu:Menu" xmi:id="_QC5O8KkaEeejedk4mZQIGw" elementId="eu.etaxonomy.taxeditor.store.menu.import" label="%menu.label.3">
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_UL4dkKkaEeejedk4mZQIGw" coreExpressionId="isCdmStoreConnectedAndShowIOMenuEnabled"/>
       <children xsi:type="menu:Menu" xmi:id="_A8bvEAIREeqn7oFuQSAIvQ" elementId="eu.etaxonomy.taxeditor.store.menu.specimen" label="%menu.label.5">
         <children xsi:type="menu:HandledMenuItem" xmi:id="_RUOtQKkVEeejedk4mZQIGw" elementId="eu.etaxonomy.taxeditor.workbench.handledmenuitem.importspecimens" label="%wizard.name.14" command="_TwGSwKkVEeejedk4mZQIGw"/>
         <children xsi:type="menu:HandledMenuItem" xmi:id="_NO718KmQEeeDJPU_cUTI2g" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importAbcd" label="%wizard.name.3" command="_QbHeEKmQEeeDJPU_cUTI2g"/>
-        <children xsi:type="menu:HandledMenuItem" xmi:id="_0z1o8KmjEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importExcelSpecimen" label="%wizard.name.5" command="_2JV9IKnAEeeTAPHmaMLwQQ"/>
       </children>
       <children xsi:type="menu:Menu" xmi:id="_lspukAIREeqn7oFuQSAIvQ" elementId="eu.etaxonomy.taxeditor.store.menu.taxa" label="%menu.label.6">
         <children xsi:type="menu:HandledMenuItem" xmi:id="_BLzlAKnBEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importExcelTaxa" label="%wizard.name.2" command="_qAEkYKmjEeeTAPHmaMLwQQ"/>
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_mNW73LMnEeeMU61m8yqdaA" coreExpressionId="isCdmStoreConnected"/>
       <parameters xmi:id="_mNW73bMnEeeMU61m8yqdaA" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"/>
     </elements>
+    <elements xsi:type="menu:MenuSeparator" xmi:id="_KbVZUM76Ee2JEuR6aPJuLg" elementId="eu.etaxonomy.taxeditor.store.menuseparator.3"/>
+    <elements xsi:type="menu:HandledMenuItem" xmi:id="_Aq3JYJ1YEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.local.handledmenuitem.remoteservers" label="Remote Servers" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/web.gif" tooltip="Edit the available remote servers" command="_bnVKsCZxEeeQLpuomSmVoQ">
+      <parameters xmi:id="_H7ooUJ1YEe2Oid79gMgNzw" elementId="eu.etaxonomy.taxeditor.webapp.showView.parameter.remoteServerView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.remoteservers"/>
+    </elements>
+    <elements xsi:type="menu:HandledMenuItem" xmi:id="_Ub4tsM75Ee2JEuR6aPJuLg" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.datasource2" label="Datasource" iconURI="platform:/plugin/eu.etaxonomy.taxeditor.store/icons/system-file-manager.png" tooltip="%command.label.2" command="_bnVKsCZxEeeQLpuomSmVoQ">
+      <parameters xmi:id="_fD4nIM75Ee2JEuR6aPJuLg" elementId="eu.etaxonomy.taxeditor.webapp.showView.parameter.dataSourceView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.datasource"/>
+    </elements>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_lnmLABWNEeiazYUJirF0Pw" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.help" positionInList="after:eu.etaxonomy.taxeditor.workbench.menuseparator.beforeHelp">
     <elements xsi:type="menu:HandledMenuItem" xmi:id="_uHiLwBWNEeiazYUJirF0Pw" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.handledmenuitemlabel6" label="%handledmenuitem.label.11" command="_jSJrsBWPEeiazYUJirF0Pw"/>
diff --git a/eu.etaxonomy.taxeditor.store/icons/ban_new.gif b/eu.etaxonomy.taxeditor.store/icons/ban_new.gif
new file mode 100644 (file)
index 0000000..9abada2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/ban_new.gif differ
diff --git a/eu.etaxonomy.taxeditor.store/icons/no_entry.png b/eu.etaxonomy.taxeditor.store/icons/no_entry.png
new file mode 100644 (file)
index 0000000..1d701f4
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/no_entry.png differ
diff --git a/eu.etaxonomy.taxeditor.store/icons/no_entry_2.png b/eu.etaxonomy.taxeditor.store/icons/no_entry_2.png
new file mode 100644 (file)
index 0000000..7657b6b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/no_entry_2.png differ
diff --git a/eu.etaxonomy.taxeditor.store/icons/no_entry_3.png b/eu.etaxonomy.taxeditor.store/icons/no_entry_3.png
new file mode 100644 (file)
index 0000000..7657b6b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/no_entry_3.png differ
index ff4ac6957ad39240bea06b773bbae643e21cf5a3..99b79dd952774185b317b543be7e0ba8ea239d96 100755 (executable)
             id="eu.etaxonomy.taxeditor.store.distributionNamedAreaVocabularies"
             name="%page.name.106">
       </page>
-      
+       <page 
+            category="eu.etaxonomy.taxeditor.preferences.general"
+            class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.MediaMetaDataPreference"
+            id="eu.etaxonomy.taxeditor.store.metaDataPreference"
+            name="Media Meta Data">
+      </page>
       <page
             category="eu.etaxonomy.taxeditor.store.abcdImportPreference"
             class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.AbcdImportProviderAdminPreferencePage"
             id="eu.etaxonomy.taxeditor.store.TaxonNavigator"
             name="%page.name.32">
       </page>
+       <page
+                        category="eu.etaxonomy.taxeditor.preference.EmptyLanguagePage"
+             class="eu.etaxonomy.taxeditor.databaseAdmin.preferencePage.LanguageRepresentationAdminPreferencePage"
+             id="eu.etaxonomy.taxeditor.preferences.termLanguages"
+             name="%page.name.23">
+       </page>
 </extension>
 </plugin>
index fbf4394bbb9c6d0684452fa9e8d37203dd6b8818..91e780f7523760ec88b11576ef91199e35dc1f56 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
        <groupId>eu.etaxonomy</groupId>
        <artifactId>taxeditor-parent</artifactId>
-       <version>5.33.0</version>
+       <version>5.42.0</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index e05565e1653b5e1dd7258623cadd056f5e54378f..e6b6ed40abcb4d1b3ec1a7f3f9a574437c8ac7b8 100755 (executable)
@@ -10,7 +10,7 @@ package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.IPreferenceService;
-import eu.etaxonomy.cdm.ext.geo.CondensedDistributionRecipe;
+import eu.etaxonomy.cdm.format.description.distribution.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
@@ -37,7 +37,6 @@ public class CdmLightExportAdminPreference extends CdmLightExportPreference {
         }else{
             recipe = null;
         }
-
     }
 
     @Override
@@ -68,5 +67,4 @@ public class CdmLightExportAdminPreference extends CdmLightExportPreference {
         }
         return true;
     }
-
-}
+}
\ No newline at end of file
index 9592753260e1bc86557a792f33e057a44aed54a7..46e8d6a9e24cdbbc13f546aeb9838352a0ded6b9 100755 (executable)
@@ -14,6 +14,7 @@ import org.eclipse.swt.widgets.Control;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.IPreferenceService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.DistributionDescription;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
 import eu.etaxonomy.cdm.model.metadata.TermComboEnum;
@@ -119,6 +120,17 @@ public class ChecklistEditorGeneralAdminPreference extends ChecklistEditorGenera
             pref.setAllowOverride(prefNumberStatus.isAllowOverride());
             service.set(pref);
         }
+        
+        if (descriptionForDistributionEditor == null && allowOverrideDescriptionSelectionButton.getSelection()){
+            service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.DescriptionForDistributionEditor));
+        }else{
+            pref = CdmPreference.NewTaxEditorInstance( PreferencePredicate.DescriptionForDistributionEditor, descriptionForDistributionEditor != null? descriptionForDistributionEditor.getKey(): null);
+            if (prefDescription == null){
+                prefDescription = pref;
+            }
+            pref.setAllowOverride(prefDescription.isAllowOverride());
+            service.set(pref);
+        }
 
         PreferencesUtil.updateDBPreferences();
 
@@ -197,10 +209,10 @@ public class ChecklistEditorGeneralAdminPreference extends ChecklistEditorGenera
             this.numberOfStatus = null;
         }
 
-        if (prefOwnDescription != null){
-            this.ownDescriptionForDistributionEditor = prefOwnDescription.getValue() != null? Boolean.valueOf(prefOwnDescription.getValue().toString()): null;
+        if (prefDescription != null){
+            this.descriptionForDistributionEditor = prefDescription.getValue() != null? DistributionDescription.byKey(prefDescription.getValue().toString()): null;
         }else{
-            this.ownDescriptionForDistributionEditor = null;
+            this.descriptionForDistributionEditor = null;
         }
 
 
index ab9a0cf53b8d9e6e06d7a7e05c85c9c01095647c..9222d03bda9ea577b64d891beecf74937fdc0dcd 100755 (executable)
@@ -10,7 +10,7 @@ package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.IPreferenceService;
-import eu.etaxonomy.cdm.ext.geo.CondensedDistributionRecipe;
+import eu.etaxonomy.cdm.format.description.distribution.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
@@ -20,7 +20,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author k.luther
  * @since 08.10.2018
- *
  */
 public class DistributionAdminPreferences extends DistributionGeneralPreference {
 
@@ -56,7 +55,4 @@ public class DistributionAdminPreferences extends DistributionGeneralPreference
             recipe = null;
         }
     }
-
-
-
-}
+}
\ No newline at end of file
index eddbf96043f645afd88ac49b7f830d8e5065d1ed..1f88aad1c99f66ca390c738978a655dead190dcf 100755 (executable)
@@ -34,6 +34,12 @@ public class FactualDataAdminPreferencePage extends FactualDataPreference {
 
         allowOverrideFreeText = getPrefAllowOverride(prefFreeText);
         isShowModifierFreeText = getBooleanPrefValue(prefFreeText);
+        
+        prefShowSpecimenAsSource = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSpecimenInFactSource);
+
+        allowOverrideSpecimen = getPrefAllowOverride(prefShowSpecimenAsSource);
+
+        isShowSpecimenAsSource = getBooleanPrefValue(prefShowSpecimenAsSource);
     }
 
 
@@ -48,6 +54,10 @@ public class FactualDataAdminPreferencePage extends FactualDataPreference {
             prefFreeText = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowModifierFreeText, isShowModifierFreeText != null? Boolean.toString(this.isShowModifierFreeText): null);
             prefFreeText.setAllowOverride(allowOverrideFreeText);
             PreferencesUtil.setPreferenceToDB(prefFreeText);
+            
+            prefShowSpecimenAsSource = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimenInFactSource, isShowSpecimenAsSource != null? Boolean.toString(this.isShowSpecimenAsSource): null);
+            prefShowSpecimenAsSource.setAllowOverride(allowOverrideSpecimen);
+            PreferencesUtil.setPreferenceToDB(prefShowSpecimenAsSource);
             setApply(false);
         }
         return true;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/LanguageRepresentationAdminPreferencePage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/LanguageRepresentationAdminPreferencePage.java
new file mode 100644 (file)
index 0000000..c86dcbb
--- /dev/null
@@ -0,0 +1,86 @@
+// $Id$
+/**
+* Copyright (C) 2023 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.databaseAdmin.preferencePage;
+
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.preference.LanguageRepresentationPreferencePage;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author k.luther
+ * @date 25.04.2023
+ *
+ */
+public class LanguageRepresentationAdminPreferencePage extends LanguageRepresentationPreferencePage {
+    
+    public LanguageRepresentationAdminPreferencePage() {
+        super();
+        isAdminPreference = true;
+       
+    }
+
+
+    @Override
+    public boolean performOk() {
+       if (!isApply()){
+            return true;
+        }
+
+        //boolean result = performOkAdmin();
+        if (this.globalLanguage == null &&  termLanguagePref.isAllowOverride()){
+            CdmPreference savePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, null);
+            PreferencesUtil.removeFromDB(savePref);
+        }else{
+            CdmPreference savePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, globalLanguage != null? globalLanguage.getUuid().toString(): null);
+            Boolean allowOverride = this.allowOverrideOrderButton.getSelection();
+            savePref.setAllowOverride(allowOverride);
+
+            PreferencesUtil.setPreferenceToDB(savePref);
+        }
+        PreferencesUtil.updateDBPreferences();
+        PreferencesUtil.firePreferencesChanged(this.getClass());
+//        CdmStore.getTermManager().clearTermMapForTermType(TermType.Language);
+        return true;
+    }
+
+    @Override
+    public void getValues() {
+       isAdminPreference = true;
+
+       setPreferenceStore(PreferencesUtil.getPreferenceStore());
+       termLanguagePref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.TermLanguage);
+       if (termLanguagePref == null){
+           termLanguagePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, null);
+       }
+
+
+       globalLanguage = termLanguagePref.getValue() != null? Language.getLanguageFromUuid(UUID.fromString(termLanguagePref.getValue())): null;
+   }
+    
+    @Override
+    protected void performDefaults() {
+
+        globalLanguage =  null;
+        //termLanguagePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, globalLanguage.getUuid().toString());
+        overrideActivated = true;
+        this.allowOverrideOrderButton.setSelection(overrideActivated);
+        
+        combo_globalLanguage.select(0);
+
+        
+        setApply(true);
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/MediaMetaDataPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/MediaMetaDataPreference.java
new file mode 100644 (file)
index 0000000..53b5846
--- /dev/null
@@ -0,0 +1,398 @@
+/**
+* Copyright (C) 2019 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.databaseAdmin.preferencePage;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.commons.lang3.StringUtils;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
+
+/**
+ * @author k.luther
+ * @since 19.12.2023
+ *
+ */
+public class MediaMetaDataPreference extends CdmPreferencePage {
+
+    protected String commandHandlerStringStatus;
+
+
+    private Button button_addAdditional;
+    private Button button_removeLine;
+
+    private Composite composite;
+    private Composite tableComposite;
+    private Table table;
+
+    CdmPreferenceCache cache;
+    CdmPreference pref;
+
+    List<String> metaData;
+    Map<String,String> metaDataMapping= new HashMap<>();
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+   public Control createContents(Composite parent) {
+        getValues();
+        composite = new Composite(parent, SWT.NULL);
+        composite.setLayout(new GridLayout());
+
+        GridData textGrid = createTextGridData();
+        textGrid.verticalSpan = 2;
+
+        final CLabel labelPerAreaStatus = new CLabel(composite, SWT.NULL);
+        labelPerAreaStatus.setText(Messages.MediaMetadataPreferenceDescription);
+        labelPerAreaStatus.setLayoutData(textGrid);
+
+
+        createStatusTable();
+        Composite compositeButtons = new Composite(composite, SWT.NULL);
+        GridLayout grid = new GridLayout();
+        grid.numColumns = 2;
+        compositeButtons.setLayout(grid);
+        button_addAdditional = new Button(compositeButtons, SWT.PUSH);
+
+        button_addAdditional.setImage(ImageResources.getImage(ImageResources.ADD_EDIT));
+        button_addAdditional.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent se) {
+                InputDialog dialog = null;
+
+                dialog = new InputDialog(null,
+                    String.format("Create %s", "metadata entry"), String.format("Enter new %s", "metadata entry"), "",
+                    null);
+                dialog.open();
+                if (dialog.getValue() != null) {
+                   metaDataMapping.put(dialog.getValue(), dialog.getValue());
+                   refresh();
+                   table.setSelection(table.getItemCount()-1);
+                }
+
+            }
+
+        });
+        button_addAdditional.setToolTipText("Add new meta data entry");
+
+
+
+        button_removeLine = new Button(compositeButtons, SWT.PUSH);
+        button_removeLine.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON));
+        button_removeLine.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent se) {
+                // you can execute a command directly ... but to get the proper environment it's better to execute it through the IHandlerService:
+                TableItem[] selection = table.getSelection();
+                if (selection != null && selection.length > 0) {
+                    int n = 0;
+                   for (TableItem item: selection) {
+                      metaDataMapping.remove(selection[n].getText(1));
+                      n++;
+                   }
+
+                   refresh();
+                }
+
+            }
+
+        });
+        button_removeLine.setToolTipText("Remove selected meta data entry");
+        composite.pack ();
+        return composite;
+    }
+
+
+
+
+
+
+
+    public void createStatusTable() {
+        tableComposite = new Composite(composite, SWT.NULL);
+
+        GridLayout gridLayout = new GridLayout();
+        GridData gridData = new GridData();
+        gridData.grabExcessVerticalSpace = false;
+        gridData.heightHint = 400;
+        tableComposite.setLayoutData(gridData);
+
+
+        tableComposite.setLayout(gridLayout);
+
+        table = new Table(
+                tableComposite, SWT.BORDER | SWT.CHECK | SWT.FULL_SELECTION | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL
+        );
+
+        table.setLinesVisible(true);
+        table.setHeaderVisible(true);
+
+
+
+        GridData tableGrid = createTextGridData();
+        tableGrid.grabExcessVerticalSpace = true;
+
+        table.setLayoutData(tableGrid);
+        TableColumn column = new TableColumn(table, SWT.CHECK);
+        column.setText(Messages.Show);
+        column.setToolTipText("Show this attribute if available in media viewer of dataportal.");
+        column.setWidth(100);
+
+        column = new TableColumn(table, SWT.NONE);
+        column.setText(Messages.OriginalLabel);
+        column.setWidth(300);
+
+        column = new TableColumn(table, SWT.NONE);
+        column.setText(Messages.DisplayedLabel);
+        column.setWidth(300);
+
+        final TableEditor editor = new TableEditor(table);
+        //The editor must have the same size as the cell and must
+        //not be any smaller than 50 pixels.
+        editor.horizontalAlignment = SWT.LEFT;
+        editor.grabHorizontal = true;
+        editor.minimumWidth = 50;
+        // editing the second column
+        final int EDITABLECOLUMN = 2;
+
+        table.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                // Clean up any previous editor control
+                Control oldEditor = editor.getEditor();
+                if (oldEditor != null) {
+                    oldEditor.dispose();
+                }
+
+                // Identify the selected row
+                TableItem item = (TableItem) e.item;
+                if (item == null) {
+                    return;
+                }
+
+                // The control that will be the editor must be a child of the Table
+                Text newEditor = new Text(table, SWT.NONE);
+                newEditor.setText(item.getText(EDITABLECOLUMN));
+                newEditor.addModifyListener(me -> {
+                    Text text = (Text) editor.getEditor();
+                    editor.getItem().setText(EDITABLECOLUMN, text.getText());
+                });
+                newEditor.selectAll();
+                newEditor.setFocus();
+                editor.setEditor(newEditor, item, EDITABLECOLUMN);
+                setApply(true);
+            }
+        });
+
+        for (String metaDataString: this.metaDataMapping.keySet()) {
+            createTableRow(metaDataString);
+        }
+
+       // tableComposite.pack();
+        composite.pack();
+    }
+
+
+    public void createTableRow(String metaDataItem) {
+        TableItem item = new TableItem(table, SWT.NONE);
+
+        item.setText(1, metaDataItem);
+        if (metaDataMapping.get(metaDataItem) != null) {
+            item.setText(2, metaDataMapping.get(metaDataItem));
+            item.setChecked(true);
+
+        }
+    }
+
+    @Override
+    public void getValues() {
+        isAdminPreference = true;
+
+        cache = CdmPreferenceCache.instance();
+
+
+        this.pref = cache.get(PreferencePredicate.MediaMetadataKeynameIncludes.getKey());
+        if (this.pref == null) {
+            pref = new CdmPreference("/", PreferencePredicate.MediaMetadataKeynameIncludes.getKey(), PreferencePredicate.MediaMetadataKeynameIncludes.getDefaultValue().toString());
+            pref.setAllowOverride(false);
+        }
+
+        String prefString = pref.getValue();
+        metaDataMapping = readJson(prefString);
+        if (metaDataMapping.isEmpty()) {
+            metaDataMapping = readJson(PreferencePredicate.MediaMetadataKeynameIncludes.getDefaultValue().toString());
+        }
+        TreeMap<String, String> treeMap = new TreeMap<>(metaDataMapping);
+        metaDataMapping = treeMap;
+
+        setApply(true);
+    }
+
+    /**
+     * @return the metaData
+     */
+    public List<String> getMetaData() {
+        return metaData;
+    }
+
+
+
+    /**
+     * @param metaData the metaData to set
+     */
+    public void setMetaData(List<String> metaData) {
+        this.metaData = metaData;
+    }
+
+
+
+    protected void refresh() {
+
+       if (table != null){
+           table.removeAll();
+
+           disposeTableEditors();
+
+           pref = cache.get(PreferencePredicate.MediaMetadataKeynameIncludes.getKey());
+           if (this.pref == null) {
+               pref = new CdmPreference("/", PreferencePredicate.MediaMetadataKeynameIncludes.getKey(), PreferencePredicate.MediaMetadataKeynameIncludes.getDefaultValue().toString());
+           }
+           for (String metaDataString: this.metaDataMapping.keySet()) {
+               createTableRow(metaDataString);
+           }
+
+
+//           table.redraw();
+//           table.pack();
+
+        }
+       composite.layout(true);
+       composite.redraw();
+
+
+    }
+
+    private void disposeTableEditors() {
+        Control [] controls = table.getChildren();
+
+        for (int i = 0; i < controls.length; i++) {
+                if(!controls[i].isDisposed()){
+                        controls[i].setVisible(false);
+                        controls[i].dispose();
+
+                }
+        }
+    }
+
+
+
+
+    @Override
+    protected void performDefaults() {
+        metaDataMapping = readJson(PreferencePredicate.MediaMetadataKeynameIncludes.getDefaultValue().toString());
+        refresh();
+        setApply(true);
+    }
+
+    @Override
+    public boolean performOk(){
+        if (!isApply()){
+            return true;
+        }
+        CdmPreferenceCache cache = CdmPreferenceCache.instance();
+        TableItem[] itemsArray = table.getItems();
+        Map<String, String> prefmap= new HashMap<>();
+        for (TableItem item: itemsArray) {
+            if (item.getChecked()) {
+                if (StringUtils.isNotBlank(item.getText(2))) {
+                    prefmap.put(item.getText(1), item.getText(2));
+                }else {
+                    prefmap.put(item.getText(1), item.getText(1));
+                }
+            }
+        }
+        if (!prefmap.isEmpty()) {
+            String prefString = createJsonString(prefmap);
+            pref = CdmPreference.NewInstance(pref.getKey(), prefString);
+            pref.setAllowOverride(false);
+            PreferencesUtil.setPreferenceToDB(pref);
+        }else {
+
+            PreferencesUtil.removeFromDB(pref);
+        }
+
+
+        return true;
+    }
+
+    protected Map<String, String> readJson(String json) {
+        JsonNode tree = null;
+        ObjectMapper mapper = new ObjectMapper();
+        try {
+            Map<String, String> map
+            = mapper.readValue(json, new TypeReference<Map<String,String>>(){});
+            return map;
+        } catch (JsonProcessingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return null;
+
+    }
+
+    protected String createJsonString(Map<String,String> map) {
+        String result = null;
+        ObjectMapper objectMapper = new ObjectMapper();
+        try {
+            result = objectMapper.writeValueAsString(map);
+        } catch (JsonProcessingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        return result;
+    }
+
+
+
+
+
+}
index 813c48f3f7e92532637efe4042bf2a79072a4758..e433c9ca9f82275128019097e1f1b601aad61637 100644 (file)
@@ -17,10 +17,8 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.service.config.SortIndexUpdaterConfigurator;
 import eu.etaxonomy.cdm.api.service.longrunningService.ILongRunningTasksService;
 import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
-import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author k.luther
@@ -33,7 +31,6 @@ public class DatabaseRepairUpdateSortIndicesWizard extends Wizard implements IPo
 
     ILongRunningTasksService longRunningTaskService;
 
-
     public DatabaseRepairUpdateSortIndicesWizard() {
         setWindowTitle("Update Sort Indices");
         config = SortIndexUpdaterConfigurator.NewInstance();
@@ -41,34 +38,30 @@ public class DatabaseRepairUpdateSortIndicesWizard extends Wizard implements IPo
         longRunningTaskService = CdmApplicationState.getLongRunningTasksService();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean performFinish() {
 
-            if (config == null){
-                ICdmSource source= CdmStore.getActiveCdmSource();
-                config = SortIndexUpdaterConfigurator.NewInstance();
-                config.setDoTermNode(false);
-                config.setDoPolytomousKeyNode(false);
-             }
-            if (config.isDoTermNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
+        if (config == null){
+            config = SortIndexUpdaterConfigurator.NewInstance();
+            config.setDoTermNode(false);
+            config.setDoPolytomousKeyNode(false);
+        }
+        if (config.isDoTermNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
 
-                final UUID uuid = longRunningTaskService.monitLongRunningTask(config);
-                Display.getDefault().asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        AbstractUtility.executeMoniteredOperation("Update SortIndices: ",
-                                uuid,
-                                1000,
-                                false,
-                                DatabaseRepairUpdateSortIndicesWizard.this,
-                                null,
-                                true, true);
-                    }
-                });
-            }
+            final UUID uuid = longRunningTaskService.monitLongRunningTask(config);
+            Display.getDefault().asyncExec(new Runnable() {
+                @Override
+                public void run() {
+                    AbstractUtility.executeMoniteredOperation("Update SortIndices: ",
+                            uuid,
+                            1000,
+                            false,
+                            DatabaseRepairUpdateSortIndicesWizard.this,
+                            null,
+                            true, true);
+                }
+            });
+        }
 
         return true;
     }
@@ -78,11 +71,8 @@ public class DatabaseRepairUpdateSortIndicesWizard extends Wizard implements IPo
         addPage(page);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void postOperation(IRemotingProgressMonitor monitor) {
         // TODO Auto-generated method stub
     }
-}
+}
\ No newline at end of file
index d70f6b764b2f2b50e968707bb3c56422c14c3463..e6e8892f12bd9a1cc3b7dbe226339d622e435dad 100755 (executable)
@@ -39,6 +39,7 @@ public class NameDetailsViewComposite extends Composite {
     boolean isShowEpithets;
     boolean isShowAuthorshipCache;
     boolean isShowAuthorship;
+    boolean isShowInAuthors;
     boolean isShowNomenclaturalRef;
     boolean isShowNomenclaturalStatus;
     boolean isShowProtologue;
@@ -47,6 +48,7 @@ public class NameDetailsViewComposite extends Composite {
     boolean isShowHybrid;
     Composite child;
        private boolean isShowNameApprobiation;
+       Button showInAuthors;
 
     public NameDetailsViewComposite(Composite parent, int style, NameDetailsConfigurator config){
 
@@ -203,9 +205,21 @@ public class NameDetailsViewComposite extends Composite {
             @Override
             public void widgetSelected(SelectionEvent e) {
                 isShowAuthorship = showAuthorship.getSelection();
+                showInAuthors.setEnabled(isShowAuthorship);
              }
         });
 
+       showInAuthors = new Button(child, SWT.CHECK);
+       isShowInAuthors =config.isInAuthorshipActivated();
+       showInAuthors.setText(Messages.NameDetailsViewComposite_Show_In_Author);
+       showInAuthors.setSelection(isShowInAuthors);
+       showInAuthors.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                isShowInAuthors = showInAuthors.getSelection();
+             }
+        });
+       showInAuthors.setEnabled(isShowAuthorship);
        final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
        isShowNomenclaturalRef = config.isNomenclaturalReferenceSectionActivated();
        showNomenclaturalRef.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalReference);
index 11268ed260e2d2c2a7a1bcc9494ef2caba172f34..8cc7e4b3df6b7d0f8aefb6f786dc70300eb818e9 100644 (file)
@@ -40,10 +40,11 @@ public abstract class CdmEntitySessionInput<T extends CdmBase> implements ICdmEn
     }
 
     public void bind() {
-        if(cdmEntitySession!=null){
+        if(cdmEntitySession != null){
             cdmEntitySession.bind();
         }
         else {
+            //TODO AM: what if session initializing is not successful
             initSession();
         }
     }
@@ -53,7 +54,6 @@ public abstract class CdmEntitySessionInput<T extends CdmBase> implements ICdmEn
             cdmEntitySession.dispose();
         }
         cdmEntitySession = null;
-
     }
 
     public abstract void merge();
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ICharacterMatrix.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ICharacterMatrix.java
new file mode 100644 (file)
index 0000000..9e75de5
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+* Copyright (C) 2023 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.editor;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
+
+/**
+ * @author KatjaLuther
+ * @since 05.07.2023
+ */
+public interface ICharacterMatrix {
+
+    public IStructuredSelection getActualSelection();
+
+    /**
+     * @param columnPosition
+     * @return
+     */
+    FeatureDto getActualFeature(int columnPosition);
+
+}
index 65d79ec9aedbfb751480e313a9f154701ff69cb0..e7ebe175cb910c129abc4e54fb3e1134e7419e03 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2018 EDIT
 * European Distributed Institute of Taxonomy
@@ -9,13 +8,19 @@
 */
 package eu.etaxonomy.taxeditor.editor.definedterm;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerComparator;
 
 import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
-import eu.etaxonomy.cdm.model.term.OrderedTermBase;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * @author pplitzner
@@ -29,9 +34,12 @@ public class DefinedTermSorter extends ViewerComparator {
         // location <-> add term method used in the MoveDefinedTermOperation
         // execute call
         //FIXME: remove this when all viewer are changed to use DTOs
-        if(e1 instanceof OrderedTermBase && e2 instanceof OrderedTermBase) {
-            OrderedTermBase otbe1 = (OrderedTermBase)e1;
-            OrderedTermBase otbe2 = (OrderedTermBase)e2;
+        List<Language> languages = new ArrayList<>();
+        languages.add(PreferencesUtil.getGlobalLanguage());
+        if(e1 instanceof DefinedTermBase && CdmBase.deproxy(e1, DefinedTermBase.class).isOrderRelevant()
+                && e2 instanceof DefinedTermBase && CdmBase.deproxy(e2, DefinedTermBase.class).isOrderRelevant()) {
+            DefinedTermBase<?> otbe1 = (DefinedTermBase<?>)e1;
+            DefinedTermBase<?> otbe2 = (DefinedTermBase<?>)e2;
             if(otbe1.getOrderIndex() == otbe2.getOrderIndex()) {
                 return 0;
             } else if (otbe1.getOrderIndex() < otbe2.getOrderIndex()){
@@ -60,8 +68,9 @@ public class DefinedTermSorter extends ViewerComparator {
             }
             else {
                 // order indexes are equal or null -> compare by label
-                termDto1.localize(new TermRepresentation_L10n());
-                termDto2.localize(new TermRepresentation_L10n());
+
+                termDto1.localize(new TermRepresentation_L10n(), languages);
+                termDto2.localize(new TermRepresentation_L10n(), languages);
                 if(termDto1.getRepresentation_L10n()!=null){
                     if(termDto2.getRepresentation_L10n()!=null) {
                         return termDto1.getRepresentation_L10n().toLowerCase().compareTo(termDto2.getRepresentation_L10n().toLowerCase());
@@ -78,8 +87,8 @@ public class DefinedTermSorter extends ViewerComparator {
         else if(e1 instanceof TermVocabularyDto && e2 instanceof TermVocabularyDto) {
             TermVocabularyDto termVoc1 = (TermVocabularyDto)e1;
             TermVocabularyDto termVoc2 = (TermVocabularyDto)e2;
-            termVoc1.localize(new TermRepresentation_L10n());
-            termVoc2.localize(new TermRepresentation_L10n());
+            termVoc1.localize(new TermRepresentation_L10n(), languages);
+            termVoc2.localize(new TermRepresentation_L10n(), languages);
             if(termVoc1.getRepresentation_L10n()!=null){
                 if(termVoc2.getRepresentation_L10n()!=null) {
                     return termVoc1.getRepresentation_L10n().toLowerCase().compareTo(termVoc2.getRepresentation_L10n().toLowerCase());
index ff9a6637270a2d86911b2a9cf7e514d0715d29c5..8ce276428566de667989ff70dae7b3affd57c31c 100755 (executable)
@@ -28,7 +28,8 @@ public class FeatureDtoContentProvider extends TermDtoContentProvider {
     boolean isAvailableForTaxonName = true;
     boolean isAvailableForOccurrence = true;
 
-    public FeatureDtoContentProvider(boolean isAvailableForTaxon, boolean isAvailableForTaxonName, boolean isAvailableForOccurrence){
+    public FeatureDtoContentProvider(boolean isAvailableForTaxon, boolean isAvailableForTaxonName,
+            boolean isAvailableForOccurrence) {
         super();
         this.isAvailableForOccurrence = isAvailableForOccurrence;
         this.isAvailableForTaxon = isAvailableForTaxon;
@@ -38,76 +39,69 @@ public class FeatureDtoContentProvider extends TermDtoContentProvider {
     @Override
     public Object[] getChildren(Object parentElement) {
         Collection<TermDto> children = new HashSet<>();
-        if(parentElement instanceof TermVocabularyDto){
-            children.addAll(getChildTerms((TermVocabularyDto)parentElement));
-        } else if(parentElement instanceof FeatureDto){
-                if(((FeatureDto) parentElement).getIncludes()!=null){
-                    for (TermDto child: ((FeatureDto) parentElement).getIncludes()){
-                        if (child instanceof FeatureDto){
-                            FeatureDto featureChild= (FeatureDto)child;
-                            if (featureChild.isAvailableForOccurrence() && isAvailableForOccurrence) {
-                                children.add(featureChild);
-                            }
-                            else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
-                                children.add(featureChild);
-                            }else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
-                                children.add(featureChild);
-                            }
+        if (parentElement instanceof TermVocabularyDto) {
+            children.addAll(getChildTerms((TermVocabularyDto) parentElement));
+        } else if (parentElement instanceof FeatureDto) {
+            if (((FeatureDto) parentElement).getIncludes() != null) {
+                for (TermDto child : ((FeatureDto) parentElement).getIncludes()) {
+                    if (child instanceof FeatureDto) {
+                        FeatureDto featureChild = (FeatureDto) child;
+                        if (featureChild.isAvailableForOccurrence() && isAvailableForOccurrence) {
+                            children.add(featureChild);
+                        } else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
+                            children.add(featureChild);
+                        } else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
+                            children.add(featureChild);
                         }
                     }
-
                 }
-                if(((FeatureDto) parentElement).getGeneralizationOf()!=null){
-                    for (TermDto child: ((FeatureDto) parentElement).getGeneralizationOf()){
-                        if (child instanceof FeatureDto){
-                            FeatureDto featureChild= (FeatureDto)child;
-                            if (featureChild.isAvailableForOccurrence() && isAvailableForOccurrence) {
-                                children.add(featureChild);
-                            }
-                            else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
-                                children.add(featureChild);
-                            }else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
-                                children.add(featureChild);
-                            }
+
+            }
+            if (((FeatureDto) parentElement).getGeneralizationOf() != null) {
+                for (TermDto child : ((FeatureDto) parentElement).getGeneralizationOf()) {
+                    if (child instanceof FeatureDto) {
+                        FeatureDto featureChild = (FeatureDto) child;
+                        if (featureChild.isAvailableForOccurrence() && isAvailableForOccurrence) {
+                            children.add(featureChild);
+                        } else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
+                            children.add(featureChild);
+                        } else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
+                            children.add(featureChild);
                         }
                     }
-
                 }
+
+            }
         }
         return children.toArray();
     }
 
-
-
-    @Override
     public Collection<TermDto> getChildTerms(TermVocabularyDto voc) {
         Collection<TermDto> children = getVocabularyToChildTermMap().get(voc);
         Collection<TermDto> filteredChildren = new HashSet<>();
-        if(children==null || children.isEmpty()){
+        if (children == null || children.isEmpty()) {
             children = new ArrayList<>(CdmStore.getService(IVocabularyService.class).getCompleteTermHierarchy(voc));
-            for (TermDto child: children){
-                if (child instanceof FeatureDto){
-                    FeatureDto featureChild= (FeatureDto)child;
+            for (TermDto child : children) {
+                if (child instanceof FeatureDto) {
+                    FeatureDto featureChild = (FeatureDto) child;
                     if (featureChild.isAvailableForOccurrence() && isAvailableForOccurrence) {
                         filteredChildren.add(featureChild);
-                    }
-                    else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
+                    } else if (featureChild.isAvailableForTaxon() && isAvailableForTaxon) {
                         filteredChildren.add(featureChild);
-                    }else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
+                    } else if (featureChild.isAvailableForTaxonName() && isAvailableForTaxonName) {
                         filteredChildren.add(featureChild);
                     }
                 }
             }
-            if (filteredChildren.isEmpty()){
+            if (filteredChildren.isEmpty()) {
                 getVocabularyToChildTermMap().remove(voc);
-            }else{
+            } else {
                 getVocabularyToChildTermMap().put(voc, filteredChildren);
             }
-        }else{
+        } else {
             filteredChildren = children;
         }
         return filteredChildren;
     }
 
-
 }
index 87d965b6c20afc6115d91e11cecf785177b2eca1..50b8215b0f2625a33d4a65fad0d286546e6657e0 100644 (file)
@@ -18,7 +18,9 @@ import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.term.TermBase;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
+import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;\r
 import eu.etaxonomy.cdm.persistence.dto.TermDto;\r
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;\r
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
@@ -28,58 +30,72 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */\r
 public class TermBasePropertyTester extends PropertyTester {\r
 \r
-       private static final String IS_MODIFIABLE = "isModifiable";\r
+    private static final String IS_MODIFIABLE = "isModifiable";\r
 \r
-       @Override\r
-       public boolean test(Object receiver, String property, Object[] args,\r
-                       Object expectedValue) {\r
+    @Override\r
+    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {\r
 \r
-               IStructuredSelection selection = (IStructuredSelection) receiver;\r
-               Object selectedElement = selection.getFirstElement();\r
-               if (selectedElement != null && HibernateProxyHelper.isInstanceOf(selectedElement, TermBase.class)){\r
-                       TermBase term = HibernateProxyHelper.deproxy(selectedElement, TermBase.class);\r
+        IStructuredSelection selection = (IStructuredSelection) receiver;\r
+        Object selectedElement = selection.getFirstElement();\r
+        if (selectedElement != null && HibernateProxyHelper.isInstanceOf(selectedElement, TermBase.class)) {\r
+            TermBase term = HibernateProxyHelper.deproxy(selectedElement, TermBase.class);\r
 \r
-                       if(IS_MODIFIABLE.equals(property)){\r
-                               return isModifiable(term);\r
-                       }\r
-               }\r
-\r
-               return false;\r
-       }\r
+            if (IS_MODIFIABLE.equals(property)) {\r
+                return isModifiable(term);\r
+            }\r
+        }\r
 \r
+        return false;\r
+    }\r
 \r
-       /**\r
-        * Checks whether there is a {@link Marker} with the type {@link MarkerType#MODIFIABLE()} and if there is then return its value.\r
-        *\r
-        * @return The markers value if it exists\r
-        */\r
-       public static boolean isModifiable(Object object) {\r
-               if (object == null){\r
-                       return true;\r
-               }\r
+    /**\r
+     * Checks whether there is a {@link Marker} with the type\r
+     * {@link MarkerType#MODIFIABLE()} and if there is then return its value.\r
+     *\r
+     * @return The markers value if it exists\r
+     */\r
+    public static boolean isModifiable(Object object) {\r
+        if (object == null) {\r
+            return true;\r
+        }\r
 \r
-               TermVocabulary<?> vocabulary = null;\r
+        TermVocabulary<?> vocabulary = null;\r
+        if (object instanceof TermBase) {\r
+            if (((TermBase) object).isManaged()) {\r
+                return false;\r
+            }\r
+        }\r
+        if (object instanceof AbstractTermDto) {\r
+            if (((AbstractTermDto) object).isManaged()) {\r
+                return false;\r
+            }\r
+        }\r
+        if (object instanceof TermNodeDto) {\r
+            if (((TermNodeDto) object).isExternallyManaged()) {\r
+                return false;\r
+            }\r
+        }\r
 \r
-               if(object instanceof DefinedTermBase){\r
-                       vocabulary = ((DefinedTermBase<?>) object).getVocabulary();\r
-               }else if(object instanceof TermVocabulary){\r
-                       vocabulary = (TermVocabulary<?>) object;\r
-               }else if(object instanceof TermDto){\r
+        if (object instanceof DefinedTermBase) {\r
+            vocabulary = ((DefinedTermBase<?>) object).getVocabulary();\r
+        } else if (object instanceof TermVocabulary) {\r
+            vocabulary = (TermVocabulary<?>) object;\r
+        } else if (object instanceof TermDto) {\r
             vocabulary = CdmStore.getService(IVocabularyService.class).load(((TermDto) object).getVocabularyUuid());\r
-        }else if(object instanceof TermVocabularyDto){\r
+        } else if (object instanceof TermVocabularyDto) {\r
             vocabulary = CdmStore.getService(IVocabularyService.class).load(((TermVocabularyDto) object).getUuid());\r
         }\r
 \r
-               if(vocabulary == null){\r
-                       return true;\r
-               }\r
+        if (vocabulary == null) {\r
+            return true;\r
+        }\r
 \r
-               for(Marker vocabularyMarker : vocabulary.getMarkers()){\r
-                       if(vocabularyMarker.getMarkerType().equals(MarkerType.MODIFIABLE())){\r
-                               return vocabularyMarker.getValue();\r
-                       }\r
-               }\r
+        for (Marker vocabularyMarker : vocabulary.getMarkers()) {\r
+            if (vocabularyMarker.getMarkerType().equals(MarkerType.MODIFIABLE())) {\r
+                return vocabularyMarker.getValue();\r
+            }\r
+        }\r
 \r
-               return true;\r
-       }\r
+        return true;\r
+    }\r
 }\r
index 316b565fdf407ec66e8739876c5053af71a552a4..87aa0790e8842171aa8323c677131c8f4b958df3 100644 (file)
@@ -8,7 +8,6 @@
 */
 package eu.etaxonomy.taxeditor.editor.definedterm;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -17,7 +16,10 @@ import java.util.Map;
 import org.eclipse.jface.viewers.TreeNodeContentProvider;
 
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -29,82 +31,88 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class TermDtoContentProvider extends TreeNodeContentProvider {
 
-    private Map<TermVocabularyDto, Collection<TermDto>> vocabularyToChildTermMap = new HashMap<>();
+    private Map<TermCollectionDto, Collection<TermDto>> vocabularyToChildTermMap = new HashMap<>();
 
     @Override
-       public Object[] getElements(Object inputElement) {
-               Collection<TermVocabularyDto> inputElements = (Collection<TermVocabularyDto>) inputElement;
-               return inputElements.toArray();
-       }
-
-       @Override
-       public Object[] getChildren(Object parentElement) {
-           Collection<TermDto> children = new HashSet<>();
-           if(parentElement instanceof TermVocabularyDto){
-               children.addAll(getChildTerms((TermVocabularyDto)parentElement));
-           } else if(parentElement instanceof TermDto){
-                   if(((TermDto) parentElement).getIncludes()!=null){
-                       children.addAll(((TermDto) parentElement).getIncludes());
-                   }
-                if(((TermDto) parentElement).getGeneralizationOf()!=null){
-                    children.addAll(((TermDto) parentElement).getGeneralizationOf());
-                }
-           }
-           return children.toArray();
-       }
-
-       @Override
-       public Object getParent(Object element) {
-               if(element instanceof TermDto){
-                   TermDto termDto = (TermDto) element;
-                   TermDto partOfDto = termDto.getPartOfDto();
-                   if(partOfDto!=null){
-                       return partOfDto;
-                   }
-                   TermDto kindOfDto = termDto.getKindOfDto();
-                   if(kindOfDto!=null){
-                       return kindOfDto;
-                   }
-                   TermVocabularyDto vocabularyDto = termDto.getVocabularyDto();
-                   if(vocabularyDto!=null){
-                       return vocabularyDto;
-                   }
-                   //parent is the vocabulary
-                   return termDto.getVocabularyDto();
-               }
-               return null;
-
-       }
-
-       @Override
-       public boolean hasChildren(Object element) {
-           if(element instanceof TermVocabularyDto){
-               return getChildren(element).length > 0;
-           }
-               if (getChildren(element) != null){
-                       return getChildren(element).length > 0;
-               }
-               return false;
-       }
-
-    public Collection<? extends TermDto> getChildTerms(TermVocabularyDto voc) {
+    public Object[] getElements(Object inputElement) {
+        Collection<TermCollectionDto> inputElements = (Collection<TermCollectionDto>) inputElement;
+        return inputElements.toArray();
+    }
+
+    @Override
+    public Object[] getChildren(Object parentElement) {
+        Collection<Object> children = new HashSet<>();
+        if (parentElement instanceof TermVocabularyDto) {
+            children.addAll(getChildTerms((TermVocabularyDto) parentElement));
+        } else if (parentElement instanceof TermDto) {
+            if (((TermDto) parentElement).getIncludes() != null) {
+                children.addAll(((TermDto) parentElement).getIncludes());
+            }
+            if (((TermDto) parentElement).getGeneralizationOf() != null) {
+                children.addAll(((TermDto) parentElement).getGeneralizationOf());
+            }
+        } else if (parentElement instanceof TermTreeDto) {
+            TermNodeDto root = ((TermTreeDto) parentElement).getRoot();
+            children.addAll(root.getChildren());
+
+        } else if (parentElement instanceof TermNodeDto) {
+            children.addAll(((TermNodeDto) parentElement).getChildren());
+        }
+        return children.toArray();
+    }
+
+    @Override
+    public Object getParent(Object element) {
+        if (element instanceof TermDto) {
+            TermDto termDto = (TermDto) element;
+            TermDto partOfDto = termDto.getPartOfDto();
+            if (partOfDto != null) {
+                return partOfDto;
+            }
+            TermDto kindOfDto = termDto.getKindOfDto();
+            if (kindOfDto != null) {
+                return kindOfDto;
+            }
+            TermCollectionDto vocabularyDto = termDto.getVocabularyDto();
+            if (vocabularyDto != null) {
+                return vocabularyDto;
+            }
+            // parent is the vocabulary
+            return termDto.getVocabularyDto();
+        }
+        return null;
+
+    }
+
+    @Override
+    public boolean hasChildren(Object element) {
+        if (element instanceof TermVocabularyDto) {
+            return getChildren(element).length > 0;
+        }
+        if (getChildren(element) != null) {
+            return getChildren(element).length > 0;
+        }
+        return false;
+    }
+
+    public Collection<? extends TermDto> getChildTerms(TermCollectionDto voc) {
         Collection<TermDto> children = getVocabularyToChildTermMap().get(voc);
-        if(children==null){
-            children = new ArrayList<>(CdmStore.getService(IVocabularyService.class).getCompleteTermHierarchy(voc));
-            getVocabularyToChildTermMap().put(voc, children);
+        if (children == null) {
+           children = CdmStore.getService(IVocabularyService.class).getCompleteTermHierarchy(voc);
+           getVocabularyToChildTermMap().put(voc, children);
         }
         return children;
     }
 
-    public void removeVocabularyFromCache(TermVocabularyDto voc){
+    public void removeVocabularyFromCache(TermCollectionDto voc) {
         getVocabularyToChildTermMap().remove(voc);
     }
 
-    public Map<TermVocabularyDto, Collection<TermDto>> getVocabularyToChildTermMap() {
+    public Map<TermCollectionDto, Collection<TermDto>> getVocabularyToChildTermMap() {
         return vocabularyToChildTermMap;
     }
 
-    public void setVocabularyToChildTermMap(Map<TermVocabularyDto, Collection<TermDto>> vocabularyToChildTermMap) {
+    public void setVocabularyToChildTermMap(Map<TermCollectionDto, Collection<TermDto>> vocabularyToChildTermMap) {
         this.vocabularyToChildTermMap = vocabularyToChildTermMap;
     }
 
index 867b114c4e4e1a7698a64d039886309322186933..16bfa830495139f4f9d5daf1da069a791d733afe 100644 (file)
@@ -20,12 +20,11 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.TextStyle;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -92,6 +91,18 @@ public class TermDtoLabelProvider //extends StyledCellLabelProvider implements I
                label = termDto.getTitleCache();
             }
         }
+        if(element instanceof TermNodeDto){
+            TermNodeDto termNodeDto = (TermNodeDto)element;            
+            Representation rep = termNodeDto.getTerm().getRepresentation(PreferencesUtil.getGlobalLanguage());            
+            label = rep != null? rep.getLabel() :termNodeDto.getTerm().getTitleCache()  ;
+
+            if(showIdInVoc && element instanceof TermNodeDto && termNodeDto.getTerm().getIdInVocabulary()!=null){
+                label = CdmUtils.concat(" : ", ( termNodeDto).getTerm().getIdInVocabulary(), label);
+            }
+            if (label == null){
+                label = termNodeDto.getTerm().getTitleCache();
+            }
+        }
         // TODO add fallback for label
         if(label==null){
                label = element.toString();
index 70711a155e7bb31630f110ff12e2c4915fc27052..a1a7086e7dc6c71ab796c1a11a09f2f5171e7a61 100644 (file)
@@ -32,7 +32,7 @@ public class TermTreeViewerComparator extends ViewerComparator {
         String label2 = "";
 
         if (e1 instanceof TermNodeDto ){
-            if (((TermNodeDto)e1).getTree().isOrderRelevant()){
+            if (((TermNodeDto)e1).isOrderRelevant()){
                 return 0;
             }
         }else if (e1 instanceof TermNode){
index bdabe00dea3b6470a1955e25ce87591f2b47adf2..4b71ecc78aed3c9693208787acdfa84373156cd7 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.dnd.DragSourceAdapter;
 import org.eclipse.swt.dnd.DragSourceEvent;
 
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermTransfer;
 
@@ -42,7 +43,18 @@ public class DefinedTermDragListenerE4 extends DragSourceAdapter {
             if(!(object instanceof TermDto)){
                 event.doit = false;
                 return;
+            }else {
+               if (VocabularyEnum.getVocabularyEnumByUuid(((TermDto) object).getVocabularyUuid()) != null) {
+                       event.doit = false;
+                    return;
+               }
+               if(((TermDto)object).isManaged() || ((TermDto)object).getVocabularyDto().isManaged()) {
+                   event.doit = false;
+                   return;
+               }
+               
             }
+            
         }
                event.doit = true;
        }
index 1a1a0aeea980dd39b54f8c78c06dee061e47de27..e2ca0443f6f83fe5075fdcd452b831062480a7cc 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ViewerDropAdapter;
 import org.eclipse.swt.dnd.TransferData;
 
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
@@ -46,7 +47,15 @@ public class DefinedTermDropAdapterE4 extends EditViewerDropAdapter {
 
     private static final String MOVE_FAILED_MESSAGE = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE;
 
+    public static final String MOVE_FAILED_STANDARD_TERM = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_STANDARD_TERM;
+    public static final String  MOVE_FAILED_TO_STANDARD_VOC = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_TO_STANDARD_VOC;
+    public static final String  MOVE_FAILED_TO_MANAGED_VOC = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_TO_MANAGED_VOC;
+    public static final String  MOVE_FAILED_TO_MANAGED_TERM = Messages.DefinedTermDropAdapterE4_MOVE_FAILED_MANAGED_TERM;
+   
+
        private final DefinedTermEditorE4 editor;
+       
+       private int test = 0;
 
        @Inject
     private UISynchronize sync;
@@ -83,14 +92,30 @@ public class DefinedTermDropAdapterE4 extends EditViewerDropAdapter {
                         MOVE_FAILED_MESSAGE);
                 return false;
             }
+           
+            if(droppedObject instanceof TermDto ) {
+               if (VocabularyEnum.getVocabularyEnumByUuid(((TermDto) droppedObject).getVocabularyUuid()) != null) {
+                       MessagingUtils.warningDialog(MOVE_FAILED, this, MOVE_FAILED_STANDARD_TERM);
+                       return false;
+               }
+            }
+
             if(target instanceof TermDto){
                 TermDto parentTerm = (TermDto)target;
                 //check term type compatibility
+                if (VocabularyEnum.getVocabularyEnumByUuid(((TermDto) target).getVocabularyUuid()) != null) {
+                       MessagingUtils.warningDialog(MOVE_FAILED, this, MOVE_FAILED_TO_STANDARD_VOC);
+                       return false;
+               }
+                if (((TermDto) target).isManaged()) {
+                    MessagingUtils.warningDialog(MOVE_FAILED, this, MOVE_FAILED_TO_MANAGED_VOC);
+                    return false;
+                }
                 if(droppedObject instanceof TermDto && !((TermDto) droppedObject).getTermType().equals(parentTerm.getTermType())){
                     MessagingUtils.warningDialog(TERM_TYPE_ERROR_TITLE, this, TERM_TYPE_ERROR_MESSAGE);
                     return false;
                 }
-
+                
                 TermDto partOfDto = parentTerm.getPartOfDto();
                 if(partOfDto!=null && partOfDto.equals(droppedObject)){
                     MessagingUtils.warningDialog(MOVE_FAILED, this.getClass(),
@@ -107,6 +132,14 @@ public class DefinedTermDropAdapterE4 extends EditViewerDropAdapter {
             else if(target instanceof TermVocabularyDto){
                 TermVocabularyDto vocDto = (TermVocabularyDto)target;
                 //check term type compatibility
+                if (VocabularyEnum.getVocabularyEnumByUuid(((TermVocabularyDto) target).getUuid()) != null) {
+                       MessagingUtils.warningDialog(MOVE_FAILED, this, MOVE_FAILED_TO_STANDARD_VOC);
+                       return false;
+               }
+                if (((TermVocabularyDto) target).isManaged()) {
+                    MessagingUtils.warningDialog(MOVE_FAILED, this, MOVE_FAILED_TO_MANAGED_VOC);
+                    return false;
+                }
                 if(droppedObject instanceof TermDto && !((TermDto) droppedObject).getTermType().equals(vocDto.getTermType())){
                     MessagingUtils.warningDialog(TERM_TYPE_ERROR_TITLE, this, TERM_TYPE_ERROR_MESSAGE);
                     return false;
@@ -129,12 +162,14 @@ public class DefinedTermDropAdapterE4 extends EditViewerDropAdapter {
                        TransferData transferType) {
            boolean valid = LocalSelectionTransfer.getTransfer().isSupportedType(transferType)
                 && target instanceof AbstractTermDto;
-           if(target instanceof TermVocabularyDto && getCurrentLocation()!=ViewerDropAdapter.LOCATION_ON ){
+          
+           if(target instanceof TermVocabularyDto && (getCurrentLocation()!=ViewerDropAdapter.LOCATION_ON || ((TermVocabularyDto)target).isManaged())){
                valid = false;
            }
-           if (target instanceof TermDto && ((TermDto)target).getOrderIndex() == null && getCurrentLocation() == ViewerDropAdapter.LOCATION_AFTER){
+           if (target instanceof TermDto && ((((TermDto)target).getOrderIndex() == null && getCurrentLocation() == ViewerDropAdapter.LOCATION_AFTER)||(((TermDto)target).isManaged()) || (((TermDto)target).getVocabularyDto().isManaged()))){
                valid = false;
            }
+
         return valid;
        }
 
index 7802a6e363b72bf02e0d695b333ec9d4005c73cd..20c0db0b52de7332f97f1d6508784f44584b8cd6 100644 (file)
@@ -41,17 +41,15 @@ import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.ui.IMemento;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermBase;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoContentProvider;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoLabelProvider;
@@ -74,15 +72,13 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @since Aug 22, 2017
  *
  */
-public class DefinedTermEditorE4 implements IConversationEnabled, IDirtyMarkable, IPostOperationEnabled,
-IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContextListener {
+public class DefinedTermEditorE4 implements IDirtyMarkable, IPostOperationEnabled, IPartContentHasDetails,
+        IPartContentHasSupplementalData, IE4SavablePart, IContextListener {
 
-       public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor"; //$NON-NLS-1$
-       private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
+    public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor"; //$NON-NLS-1$
+    private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
 
-       protected TreeViewer viewer;
-
-       protected ConversationHolder conversation;
+    protected TreeViewer viewer;
 
     @Inject
     private ESelectionService selService;
@@ -92,7 +88,7 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
 
     private ISelectionChangedListener selectionChangedListener;
 
-    private TermEditorInput input =null;
+    private TermEditorInput input = null;
 
     @Inject
     private MPart thisPart;
@@ -101,210 +97,184 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
 
     private TermDtoContentProvider contentProvider;
 
-       @Inject
-       public DefinedTermEditorE4() {
-           CdmStore.getContextManager().addContextListener(this);
-       }
-
-       @PostConstruct
-       public void createPartControl(Composite parent, EMenuService menuService,
-               IEclipseContext context) {
-           if (CdmStore.isActive()){
-            if(conversation == null){
-                conversation = CdmStore.createConversation();
-            }
-        }
-        else{
-            return;
-        }
-           FillLayout layout = new FillLayout();
-           layout.marginHeight = 0;
-           layout.marginWidth = 0;
-           layout.type = SWT.VERTICAL;
-
-           parent.setLayout(layout);
-           viewer = new TreeViewer(new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI));
-           viewer.getControl().setLayoutData(LayoutConstants.FILL());
-           contentProvider = new TermDtoContentProvider();
+    @Inject
+    public DefinedTermEditorE4() {
+        CdmStore.getContextManager().addContextListener(this);
+    }
+
+    @PostConstruct
+    public void createPartControl(Composite parent, EMenuService menuService, IEclipseContext context) {
+
+        FillLayout layout = new FillLayout();
+        layout.marginHeight = 0;
+        layout.marginWidth = 0;
+        layout.type = SWT.VERTICAL;
+
+        parent.setLayout(layout);
+        viewer = new TreeViewer(new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI));
+        viewer.getControl().setLayoutData(LayoutConstants.FILL());
+        contentProvider = new TermDtoContentProvider();
         viewer.setContentProvider(contentProvider);
-           viewer.setLabelProvider(new TermDtoLabelProvider());
-           viewer.setComparator(new DefinedTermSorter());
+        viewer.setLabelProvider(new TermDtoLabelProvider());
+        viewer.setComparator(new DefinedTermSorter());
 
-           Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
-           viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListenerE4(viewer));
-           DefinedTermDropAdapterE4 dropListener = new DefinedTermDropAdapterE4(this);
-           ContextInjectionFactory.inject(dropListener, context);
+        Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
+        viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListenerE4(viewer));
+        DefinedTermDropAdapterE4 dropListener = new DefinedTermDropAdapterE4(this);
+        ContextInjectionFactory.inject(dropListener, context);
         viewer.addDropSupport(dndOperations, transfers, dropListener);
 
-           //propagate selection
-           selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
-           viewer.addSelectionChangedListener(selectionChangedListener);
+        // propagate selection
+        selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
+        viewer.addSelectionChangedListener(selectionChangedListener);
 
-           //create context menu
-           menuService.registerContextMenu(viewer.getControl(), AppModelId.POPUPMENU_EU_ETAXONOMY_TAXEDITOR_STORE_POPUPMENU_TERMEDITOR);
+        // create context menu
+        menuService.registerContextMenu(viewer.getControl(),
+                AppModelId.POPUPMENU_EU_ETAXONOMY_TAXEDITOR_STORE_POPUPMENU_TERMEDITOR);
 
-       }
+    }
 
-       @Override
-       public boolean postOperation(Object objectAffectedByOperation) {
+    @Override
+    public boolean postOperation(Object objectAffectedByOperation) {
         input.initialiseVocabularies();
 
-           Collection<AbstractTermDto> itemsToSelect = new HashSet<>();
+        Collection<AbstractTermDto> itemsToSelect = new HashSet<>();
 
-           if(objectAffectedByOperation instanceof Collection){
-               for (Object o : (Collection<?>)objectAffectedByOperation) {
-                if(o instanceof TermVocabularyDto){
-                    contentProvider.removeVocabularyFromCache((TermVocabularyDto) o);
-                }
-                else if(o instanceof TermDto){
+        if (objectAffectedByOperation instanceof Collection) {
+            for (Object o : (Collection<?>) objectAffectedByOperation) {
+                if (o instanceof TermVocabularyDto) {
+                    contentProvider.removeVocabularyFromCache((TermCollectionDto) o);
+                } else if (o instanceof TermDto) {
                     contentProvider.removeVocabularyFromCache(((TermDto) o).getVocabularyDto());
                     itemsToSelect.add((TermDto) o);
                 }
             }
-           }
-           if(objectAffectedByOperation instanceof TermVocabularyDto){
-               contentProvider.removeVocabularyFromCache((TermVocabularyDto) objectAffectedByOperation);
-               itemsToSelect.add((AbstractTermDto) objectAffectedByOperation);
-           }
-           else if(objectAffectedByOperation instanceof TermDto){
-               TermDto termDto = (TermDto) objectAffectedByOperation;
+        }
+        if (objectAffectedByOperation instanceof TermVocabularyDto) {
+            contentProvider.removeVocabularyFromCache((TermVocabularyDto) objectAffectedByOperation);
+            itemsToSelect.add((AbstractTermDto) objectAffectedByOperation);
+        } else if (objectAffectedByOperation instanceof TermDto) {
+            TermDto termDto = (TermDto) objectAffectedByOperation;
             itemsToSelect.add(termDto);
             contentProvider.removeVocabularyFromCache(termDto.getVocabularyDto());
-           }
-               if(!itemsToSelect.isEmpty()){
-                       StructuredSelection selection = new StructuredSelection(itemsToSelect);
+        }
+        if (!itemsToSelect.isEmpty()) {
+            StructuredSelection selection = new StructuredSelection(itemsToSelect);
             viewer.setSelection(selection);
             for (AbstractTermDto termDto : itemsToSelect) {
                 viewer.expandToLevel(termDto, 1);
             }
-               }
-               viewer.refresh();
-               return true;
-       }
+        }
+        viewer.refresh();
+        return true;
+    }
 
-       public void init(TermEditorInput input, String label){
-           this.input = input;
+    public void init(TermEditorInput input, String label) {
+        this.input = input;
 
         viewer.setInput(input.getVocabularies());
-        for (TermVocabularyDto voc:input.getVocabularies()){
-            for (TermDto dto: this.contentProvider.getChildTerms(voc)){
-                voc.addTerm(dto);;
+        for (TermCollectionDto voc : input.getVocabularies()) {
+            for (TermDto dto : this.contentProvider.getChildTerms(voc)) {
+                voc.addTerm(dto);
+                
             }
         }
         thisPart.setLabel(label);
-       }
+    }
 
-       @Override
+    @Override
     @Persist
-       public void save(IProgressMonitor monitor) {
-               getConversationHolder().commit();
-               List<DefinedTermBase> terms = new ArrayList<>();
-               List<TermVocabulary> vocs = new ArrayList<>();
-               for(TermBase term:changedTerms){
-            if(term.isInstanceOf(DefinedTermBase.class)){
+    public void save(IProgressMonitor monitor) {
+        List<DefinedTermBase> terms = new ArrayList<>();
+        List<TermVocabulary> vocs = new ArrayList<>();
+        for (TermBase term : changedTerms) {
+            if (term.isInstanceOf(DefinedTermBase.class)) {
                 DefinedTermBase<?> definedTermBase = (DefinedTermBase<?>) term;
                 terms.add(definedTermBase);
 
-            }
-            else if(term.isInstanceOf(TermVocabulary.class)){
+            } else if (term.isInstanceOf(TermVocabulary.class)) {
                 TermVocabulary<?> voc = (TermVocabulary<?>) term;
                 vocs.add(voc);
             }
-               }
-               if (!terms.isEmpty()){
-                   CdmStore.getService(ITermService.class).merge(terms, true);
-               }
-               if (!vocs.isEmpty()){
-                   CdmStore.getService(IVocabularyService.class).merge(vocs, true);
-               }
-               setDirty(false);
-               input.initialiseVocabularies();
+        }
+        if (!terms.isEmpty()) {
+            CdmStore.getService(ITermService.class).merge(terms, true);
+        }
+        if (!vocs.isEmpty()) {
+            CdmStore.getService(IVocabularyService.class).merge(vocs, true);
+        }
+        setDirty(false);
+        input.initialiseVocabularies();
         changedTerms.clear();
         viewer.refresh();
-               EventUtility.postEvent(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL, true);
-       }
+        EventUtility.postEvent(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL, true);
+    }
 
-       @Override
+    @Override
     public boolean isDirty() {
-               return dirty.isDirty();
-       }
-
-       @Focus
-       public void setFocus() {
-           if(viewer!=null && viewer.getControl() != null && !viewer.getControl().isDisposed()){
-               viewer.getControl().setFocus();
-           }
-           if(conversation!=null){
-               conversation.bind();
-           }
-               if(input!=null){
-                   input.bind();
-               }
-
-               if (viewer.getSelection().isEmpty()){
-                   viewer.setSelection(null);
-               }
-       }
-
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-       }
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       @Override
-       public void changed(Object element) {
-           if(element instanceof DefinedTermBase){
-               DefinedTermBase<?> definedTermBase = (DefinedTermBase<?>) element;
+        return dirty.isDirty();
+    }
+
+    @Focus
+    public void setFocus() {
+        if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
+            viewer.getControl().setFocus();
+        }
+        if (input != null) {
+            input.bind();
+        }
+
+        if (viewer.getSelection().isEmpty()) {
+            viewer.setSelection(null);
+        }
+    }
+
+    @Override
+    public void changed(Object element) {
+        if (element instanceof DefinedTermBase) {
+            DefinedTermBase<?> definedTermBase = (DefinedTermBase<?>) element;
             TermDto termDto = TermDto.fromTerm(definedTermBase);
-               viewer.update(termDto, null);
-               changedTerms.add(definedTermBase);
+            viewer.update(termDto, null);
+            changedTerms.add(definedTermBase);
             contentProvider.removeVocabularyFromCache(termDto.getVocabularyDto());
-           }
-           else if(element instanceof TermVocabulary){
-               TermVocabulary<?> vocabulary = (TermVocabulary<?>)element;
-               TermVocabularyDto vocabularyDto = new TermVocabularyDto(vocabulary.getUuid(), vocabulary.getRepresentations(), vocabulary.getTermType(), vocabulary.getTitleCache(), vocabulary.isAllowDuplicates(), vocabulary.isOrderRelevant(), vocabulary.isFlat());
-               viewer.update(vocabularyDto, null);
-               changedTerms.add(vocabulary);
+        } else if (element instanceof TermVocabulary) {
+            TermVocabulary<?> vocabulary = (TermVocabulary<?>) element;
+            TermVocabularyDto vocabularyDto = new TermVocabularyDto(vocabulary.getUuid(),
+                    vocabulary.getRepresentations(), vocabulary.getTermType(), vocabulary.getTitleCache(),
+                    vocabulary.isAllowDuplicates(), vocabulary.isOrderRelevant(), vocabulary.isFlat());
+            viewer.update(vocabularyDto, null);
+            changedTerms.add(vocabulary);
             contentProvider.removeVocabularyFromCache(vocabularyDto);
-           }
-               setDirty(true);
-               viewer.update(element, null);
-       }
-
-       @Override
-       public void forceDirty() {
-           changed(null);
-       }
-
-       public void setDirty(boolean dirty) {
-               this.dirty.setDirty(dirty);
-       }
-
-       @Override
-       public boolean onComplete() {
-               return false;
-       }
-
-       public TreeViewer getViewer() {
-               return viewer;
-       }
-
-       @PreDestroy
-       public void dispose() {
-           if(conversation!=null){
-               conversation.unregisterForDataStoreChanges(this);
-               conversation.close();
-               conversation = null;
-           }
-           if(input!=null){
-               input.dispose();
-           }
-           this.dirty.setDirty(false);
-       }
+        }
+        setDirty(true);
+        viewer.update(element, null);
+    }
+
+    @Override
+    public void forceDirty() {
+        changed(null);
+    }
+
+    public void setDirty(boolean dirty) {
+        this.dirty.setDirty(dirty);
+    }
+
+    @Override
+    public boolean onComplete() {
+        return false;
+    }
+
+    public TreeViewer getViewer() {
+        return viewer;
+    }
+
+    @PreDestroy
+    public void dispose() {
+        if (input != null) {
+            input.dispose();
+        }
+        this.dirty.setDirty(false);
+    }
 
     public TermEditorInput getDefinedTermEditorInput() {
         return input;
@@ -316,12 +286,11 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
 
     @Override
     public void contextStop(IMemento memento, IProgressMonitor monitor) {
-        //close view when workbench closes
-        try{
+        // close view when workbench closes
+        try {
             thisPart.getContext().get(EPartService.class).hidePart(thisPart);
-        }
-        catch(Exception e){
-            //nothing
+        } catch (Exception e) {
+            // nothing
         }
     }
 
@@ -337,26 +306,26 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
-    public void setSelection(TermDto toBeSelected){
+    public void setSelection(TermDto toBeSelected) {
         TreeItem[] children = viewer.getTree().getItems();
-        for (TreeItem con: children){
-            if (con.getData() == toBeSelected){
+        for (TreeItem con : children) {
+            if (con.getData() == toBeSelected) {
                 this.viewer.setSelection(new StructuredSelection(toBeSelected));
                 return;
-            }else {
-               if(con != null){
-                   Object data= con.getData();
-                   if(data != null && data instanceof TermVocabularyDto ){
-                       for (TermDto term:((TermVocabularyDto)data).getTerms()){
-                           if(term.getUuid().equals(toBeSelected.getUuid())){
-                               StructuredSelection selection = new StructuredSelection(term);
-                               viewer.expandToLevel(data, 1);
-                               viewer.setSelection(selection,true);
-                               return;
-                           }
-                       }
-                   }
-               }
+            } else {
+                if (con != null) {
+                    Object data = con.getData();
+                    if (data != null && data instanceof TermVocabularyDto) {
+                        for (TermDto term : ((TermVocabularyDto) data).getTerms()) {
+                            if (term.getUuid().equals(toBeSelected.getUuid())) {
+                                StructuredSelection selection = new StructuredSelection(term);
+                                viewer.expandToLevel(data, 1);
+                                viewer.setSelection(selection, true);
+                                return;
+                            }
+                        }
+                    }
+                }
 
             }
         }
index d0862545272ab69424a95f86aa2c3864e76b48a3..78f27cebf64afee4f206c7a9a147f2dab709c464 100644 (file)
@@ -21,8 +21,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
 import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
-import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.location.Country;
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
@@ -81,15 +80,23 @@ public class CreateDefinedTermHandlerE4 {
         UUID vocabularyUuid = null;
 
         if(firstElement instanceof TermDto){
+            if (((TermDto)firstElement).isManaged() || ((TermDto)firstElement).getVocabularyDto().isManaged()) {
+                return false;
+            }
             vocabularyUuid = ((TermDto) firstElement).getVocabularyUuid();
-        }else if(firstElement instanceof TermVocabularyDto
-                && !menuItem.getCommand().getElementId()
-                .equals(AppModelId.COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DEFINEDTERMS_NEWKINDOFTERM)){
-            vocabularyUuid = ((TermVocabularyDto) firstElement).getUuid();
+        }else if(firstElement instanceof TermVocabularyDto) {
+            if (((TermVocabularyDto)firstElement).isManaged()) {
+                return false;
+            }
+            if (!menuItem.getCommand().getElementId()
+                    .equals(AppModelId.COMMAND_EU_ETAXONOMY_TAXEDITOR_EDITOR_DEFINEDTERMS_NEWKINDOFTERM)){
+                vocabularyUuid = ((TermVocabularyDto) firstElement).getUuid();
+            }
         }
+             
         canExecute &= vocabularyUuid!=null
                 // TODO temporary fix for #7933
-                && !vocabularyUuid.equals(Country.uuidCountryVocabulary) && !Language.cdmVocabularyUuids().contains(vocabularyUuid);
+                && VocabularyEnum.getVocabularyEnumByUuid(vocabularyUuid) == null;
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index 469208bb26290843607edf30c04e7ae526a5fb6b..8e8bcba33cfd9d98ef5050c89ce3b08d61feaaff 100644 (file)
@@ -8,6 +8,8 @@
  */
 package eu.etaxonomy.taxeditor.editor.definedterm.e4.handler;
 
+import java.util.HashSet;
+import java.util.Set;
 import java.util.UUID;
 
 import javax.inject.Named;
@@ -22,7 +24,7 @@ import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
 import org.eclipse.e4.ui.services.IServiceConstants;
 import org.eclipse.jface.viewers.IStructuredSelection;
 
-import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
@@ -51,13 +53,13 @@ public class DeleteTermBaseHandlerE4 {
         if(!StoreUtil.confirmDelete()){
             return;
         }
-
+        Set<AbstractTermDto> deleteTerms = new HashSet(selection.toList());
         String label = menuItem.getLocalizedLabel();
         IUndoContext undoContext = StoreUtil.getUndoContext();
         AbstractPostOperation operation =
                 new DeleteTermBaseOperation(label,
                         undoContext,
-                        (AbstractTermDto) selection.getFirstElement(),
+                        deleteTerms,
                         termEditor.getDefinedTermEditorInput(),
                         termEditor);
         AbstractUtility.executeOperation(operation, sync);
@@ -68,15 +70,23 @@ public class DeleteTermBaseHandlerE4 {
             MHandledMenuItem menuItem){
         boolean canExecute = false;
         Object firstElement = selection.getFirstElement();
-        canExecute = selection.size()==1
-                && (firstElement instanceof AbstractTermDto);
+        canExecute = //selection.size()==1 &&
+                 (firstElement instanceof AbstractTermDto);
         UUID vocabularyUuid = null;
         if(firstElement instanceof TermDto){
+            if (((TermDto)firstElement).isManaged() || ((TermDto)firstElement).getVocabularyDto().isManaged()) {
+                return false;
+            }
             vocabularyUuid = ((TermDto) firstElement).getVocabularyUuid();
         }else if(firstElement instanceof TermVocabularyDto){
+            if (((TermVocabularyDto)firstElement).isManaged()) {
+                return false;
+            }
             vocabularyUuid = ((TermVocabularyDto) firstElement).getUuid();
         }
-        canExecute &= vocabularyUuid!=null && !Language.cdmVocabularyUuids().contains(vocabularyUuid);
+        
+        
+        canExecute &= vocabularyUuid!=null && VocabularyEnum.getVocabularyEnumByUuid(vocabularyUuid)== null;//!Language.cdmVocabularyUuids().contains(vocabularyUuid);
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index a30b9822e2996614b5ae29acddb224663a714d3a..411014444e6f346079969bee965945634f8136b2 100644 (file)
@@ -9,7 +9,7 @@
 package eu.etaxonomy.taxeditor.editor.definedterm.e4.handler;
 
 import java.util.ArrayList;
-import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -27,10 +27,10 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.location.Country;
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.e4.DefinedTermEditorE4;
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.MoveDefinedTermOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -60,7 +60,7 @@ public class MoveDefinedTermHandler {
 
         TermDto selectedTerm = (TermDto) selection.getFirstElement();
 
-        TermChooseWizard wizard = new TermChooseWizard(selectedTerm);
+        TermChooseWizard wizard = new TermChooseWizard(selectedTerm, true, true);
         WizardDialog dialog = new WizardDialog(shell, wizard);
 
         List<AbstractTermDto> selectedTerms = new ArrayList<>();
@@ -75,10 +75,26 @@ public class MoveDefinedTermHandler {
             return;
         }
 
+        if(selectedTerms.size()==1){
+               if (selectedTerms.get(0) instanceof TermVocabularyDto) {
+                       if (VocabularyEnum.getVocabularyEnumByUuid(((TermVocabularyDto)selectedTerms.get(0)).getUuid()) != null) {
+                               MessagingUtils.warningDialog("Move not possible", this, "Standard Vocabularies should not be changed");
+                               return;
+                       }
+                   
+               }
+               if (selectedTerms.get(0) instanceof TermDto) {
+                       if (VocabularyEnum.getVocabularyEnumByUuid(((TermDto)selectedTerms.get(0)).getVocabularyUuid()) != null) {
+                               MessagingUtils.warningDialog("Move not possible", this, "Standard Vocabularies should not be changed");
+                               return;
+                       }
+                   
+               }
+        }      
         AbstractTermDto target = selectedTerms.get(0);
         String label = menuItem.getLocalizedLabel();
         IUndoContext undoContext = StoreUtil.getUndoContext();
-        Set<TermDto> movedTerms = Collections.singleton(selectedTerm);
+        Set<TermDto> movedTerms = new HashSet(selection.toList());
         AbstractPostOperation operation =
                 new MoveDefinedTermOperation(label,
                         undoContext,
@@ -94,11 +110,15 @@ public class MoveDefinedTermHandler {
             MHandledMenuItem menuItem){
         boolean canExecute = false;
         Object firstElement = selection.getFirstElement();
-        canExecute = selection.size()==1
-                && firstElement instanceof TermDto
-                // TODO temporary fix for #7933
-                && !((TermDto) firstElement).getVocabularyUuid().equals(Country.uuidCountryVocabulary)
-                && !Language.cdmVocabularyUuids().contains(((TermDto) firstElement).getVocabularyUuid());
+        canExecute = //selection.size()==1 &&
+                firstElement instanceof TermDto
+                // default vocabularies should not be changed
+                && VocabularyEnum.getVocabularyEnumByUuid(((TermDto) firstElement).getVocabularyUuid()) == null
+                && !((TermDto) firstElement).isManaged()
+                && !((TermDto) firstElement).getVocabularyDto().isManaged();
+//                && !((TermDto) firstElement).getVocabularyUuid().equals(VocabularyEnum.Feature.getUuid())
+//                && !((TermDto) firstElement).getVocabularyUuid().equals(VocabularyEnum.NameFeature.getUuid())
+//                && !Language.cdmVocabularyUuids().contains(((TermDto) firstElement).getVocabularyUuid());
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index 9bc8602bfdfb80d99d2d38891986923ebbe18073..6afdb81bfca62a99f33b9bccfc300ea14fff4695 100644 (file)
@@ -21,6 +21,7 @@ import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -32,113 +33,119 @@ import eu.etaxonomy.taxeditor.store.TermStore;
  */
 public class TermEditorInput extends AbstractDefinedTermEditorInput<DefinedTerm> {
 
-       private TermType termType;
-       private Set<TermVocabularyDto> vocabularies;
-
-       // FIXME: the default feature should be move to CdmApplicationState
-       //        where it is a singleton instance variable
-       private static TermTree defaultFeatureTree = null;
-       private static TermTree completeFeatureTree = null;
-       private static TermTree defaultNameFeatureTree = null;
-
-       private List<String> termClasses = Arrays.asList(new String[]{
-                       DefinedTerm.class.getName()
-       });
-
-       public TermEditorInput(TermType termType) {
-               this.termType = termType;
-               vocabularies = new HashSet<>();
-               initialiseVocabularies();
-       }
-       public String getName() {
-               return termType.getLabel();
-       }
-
-       @Override
-       public List<String> getTermClasses() {
-               return termClasses;
-       }
-
-       public TermType getTermType() {
-               return termType;
-       }
-
-       public void initialiseVocabularies() {
-               if(vocabularies != null) {
-                       vocabularies.clear();
-               }
-               List<TermVocabularyDto> vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(termType, false);
-               vocabularies.addAll(vocs);
-
-       }
-
-       public Set<TermVocabularyDto> getVocabularies() {
-               return vocabularies;
-       }
-
-       public void updateDefaultFeatureTree() {
-           for(TermVocabularyDto vocab : getVocabularies()) {
-               if(vocab != null && TermType.Feature.equals(vocab.getTermType())) {
-                   defaultFeatureTree = null;
-                   return;
-               }
-           }
-       }
-
-       @Override
-    public Set<TermVocabularyDto>  getRootEntities() {
+    private TermType termType;
+    private Set<TermCollectionDto> vocabularies;
+
+    // FIXME: the default feature should be move to CdmApplicationState
+    // where it is a singleton instance variable
+    private static TermTree<Feature> defaultFeatureTree = null;
+    private static TermTree<Feature> completeFeatureTree = null;
+    private static TermTree<Feature> defaultNameFeatureTree = null;
+
+    private List<String> termClasses = Arrays.asList(new String[] { DefinedTerm.class.getName() });
+
+    public TermEditorInput(TermType termType) {
+        this.termType = termType;
+        vocabularies = new HashSet<>();
+        initialiseVocabularies();
+    }
+
+    public String getName() {
+        return termType.getLabel();
+    }
+
+    @Override
+    public List<String> getTermClasses() {
+        return termClasses;
+    }
+
+    public TermType getTermType() {
+        return termType;
+    }
+
+    public void initialiseVocabularies() {
+        if (vocabularies != null) {
+            vocabularies.clear();
+        }
+        List<TermVocabularyDto> vocs = CdmStore.getService(IVocabularyService.class)
+                .findVocabularyDtoByTermType(termType, false);
+        vocabularies.addAll(vocs);
+
+    }
+
+    public Set<TermCollectionDto> getVocabularies() {
+        return vocabularies;
+    }
+
+    public void updateDefaultFeatureTree() {
+        for (TermCollectionDto vocab : getVocabularies()) {
+            if (vocab != null && TermType.Feature.equals(vocab.getTermType())) {
+                defaultFeatureTree = null;
+                return;
+            }
+        }
+    }
+
+    @Override
+    public Set<TermCollectionDto> getRootEntities() {
         return getVocabularies();
     }
 
-       @Override
+    @Override
     public void merge() {
-           List<TermVocabulary> vocabularies = new ArrayList<>();
-           getRootEntities().forEach(vocDto->vocabularies.add(CdmStore.getService(IVocabularyService.class).load(vocDto.getUuid())));
+        List<TermVocabulary> vocabularies = new ArrayList<>();
+        getRootEntities().forEach(
+                vocDto -> vocabularies.add(CdmStore.getService(IVocabularyService.class).load(vocDto.getUuid())));
         CdmStore.getService(IVocabularyService.class).merge(vocabularies, true);
         updateDefaultFeatureTree();
     }
 
     public static TermTree getDefaultFeatureTree() {
-        if(defaultFeatureTree == null) {
+        if (defaultFeatureTree == null) {
             List<Feature> features = TermStore.getTerms(Feature.class);
 
             List<Feature> taxonFeatures = features.stream().filter(f -> f.isAvailableForTaxon())
                     .collect(Collectors.toList());
 
-            defaultFeatureTree = TermTree.NewInstance(taxonFeatures);
+            defaultFeatureTree = TermTree.NewFeatureInstance(taxonFeatures);
         }
         return defaultFeatureTree;
     }
-    
+
     public static TermTree getCompleteFeatureTree() {
-        if(completeFeatureTree == null) {
+        if (completeFeatureTree == null) {
             List<Feature> features = TermStore.getTerms(Feature.class);
-            completeFeatureTree = TermTree.NewInstance(features);
+            completeFeatureTree = TermTree.NewFeatureInstance(features);
         }
         return completeFeatureTree;
     }
 
-    public static void resetDefaultFeatureTree(){
+    public static void resetDefaultFeatureTree() {
         defaultFeatureTree = null;
     }
+
     public static TermTree getDefaultNameFeatureTree() {
-        if(defaultNameFeatureTree == null) {
-//            List<TermVocabularyDto> vocs = new ArrayList<>();
-//            Set<CdmClass> availableFor = new HashSet<>();
-//            availableFor.add(CdmClass.TAXON_NAME);
-//            vocs = CdmStore.getService(IVocabularyService.class).findFeatureVocabularyDtoByTermTypes(availableFor);
-//            TermVocabulary voc = CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid());
-//            List<Feature> nameFeatures = new ArrayList(voc.getTerms());
-//            nameFeatures.remove(Feature.PROTOLOGUE());
-//            PreferencesUtil.createPreferredFeatureTreeForNameDescription();
+        if (defaultNameFeatureTree == null) {
+            // List<TermVocabularyDto> vocs = new ArrayList<>();
+            // Set<CdmClass> availableFor = new HashSet<>();
+            // availableFor.add(CdmClass.TAXON_NAME);
+            // vocs =
+            // CdmStore.getService(IVocabularyService.class).findFeatureVocabularyDtoByTermTypes(availableFor);
+            // TermVocabulary voc =
+            // CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid());
+            // List<Feature> nameFeatures = new ArrayList(voc.getTerms());
+            // nameFeatures.remove(Feature.PROTOLOGUE());
+            // PreferencesUtil.createPreferredFeatureTreeForNameDescription();
             defaultNameFeatureTree = PreferencesUtil.getPreferredFeatureTreeForNameDescription(true);
-          //List<Feature> nameFeatures = CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()), null);
-//            defaultNameFeatureTree = TermTree.NewInstance(nameFeatures);
+            // List<Feature> nameFeatures =
+            // CdmStore.getTermManager().getPreferredTerms(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.NameFeature.getUuid()),
+            // null);
+            // defaultNameFeatureTree = TermTree.NewInstance(nameFeatures);
         }
         return defaultNameFeatureTree;
     }
 
-    public static void resetDefaultNameFeatureTree(){
+    public static void resetDefaultNameFeatureTree() {
         defaultNameFeatureTree = null;
     }
 
index b986426fc7a6c2e03e459a854aaf0b5030256f6a..4af9f60c2c3b7aa2e8713f431c88fe2dbc8eb035 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IStatus;
 \r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
-import eu.etaxonomy.cdm.model.term.OrderedTermBase;\r
 import eu.etaxonomy.cdm.model.term.OrderedTermVocabulary;\r
 import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
@@ -30,7 +29,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**\r
  * @author l.morris\r
  * @date 21 Dec 2011\r
- *\r
  */\r
 public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {\r
 \r
@@ -48,18 +46,18 @@ public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
 \r
-          TermType type= definedEditorInput.getTermType();\r
-          DefinedTermBase test = type.getEmptyDefinedTermBase(PreferencesUtil.getGlobalLanguage());\r
-          TermVocabulary termVocabulary = null;\r
-          if (test instanceof OrderedTermBase){\r
+          TermType type = definedEditorInput.getTermType();\r
+          DefinedTermBase<?> test = type.getEmptyDefinedTermBase(PreferencesUtil.getGlobalLanguage());\r
+          TermVocabulary<?> termVocabulary = null;\r
+          if (test.isOrderRelevant()){\r
              termVocabulary = OrderedTermVocabulary.NewInstance(definedEditorInput.getTermType());\r
-             termVocabulary.setLabel("Untitled", PreferencesUtil.getGlobalLanguage());       \r
+             termVocabulary.setLabel("Untitled", PreferencesUtil.getGlobalLanguage());\r
           }\r
 \r
           if (termVocabulary == null){\r
            termVocabulary =\r
                 TermVocabulary.NewInstance(definedEditorInput.getTermType(),\r
-                    null,null, \r
+                    null,null,\r
                     "Untitled",\r
                     null,\r
                     null, PreferencesUtil.getGlobalLanguage());\r
@@ -83,5 +81,4 @@ public class CreateTermVocabularyOperation extends AbstractPostTaxonOperation {
                        throws ExecutionException {\r
                return null;\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 4cbfc5ba6c89fb9b43622da3e8206feb90e49832..23d1c8e43d7b548e9126b619152cf74ba8db83aa 100644 (file)
@@ -8,7 +8,12 @@
 */\r
 package eu.etaxonomy.taxeditor.editor.definedterm.operation;\r
 \r
+import java.util.ArrayList;\r
 import java.util.Collection;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Set;\r
+import java.util.UUID;\r
 \r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
@@ -41,44 +46,60 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 public class DeleteTermBaseOperation extends AbstractPostTaxonOperation {\r
 \r
        private final TermEditorInput definedEditorInput;\r
-       private final AbstractTermDto termBase;\r
+       private final Set<AbstractTermDto> termBases;\r
 \r
        public DeleteTermBaseOperation(String label,\r
                        IUndoContext undoContext,\r
-                       AbstractTermDto termBase,\r
+                       Set<AbstractTermDto> termBases,\r
                        TermEditorInput definedEditorInput,\r
                        IPostOperationEnabled postOperationEnabled) {\r
                super(label, undoContext, postOperationEnabled);\r
-               this.termBase = termBase;\r
+               this.termBases = termBases;\r
                this.definedEditorInput = definedEditorInput;\r
        }\r
 \r
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-               if (termBase instanceof TermVocabularyDto) {\r
-                       definedEditorInput.getVocabularies().remove(termBase);\r
+               Set<TermVocabularyDto> vocs = new HashSet<>();\r
+               Set<TermDto> terms = new HashSet<>();\r
+               for (AbstractTermDto dto: termBases) {\r
+                       if (dto instanceof TermVocabularyDto) {\r
+                               vocs.add((TermVocabularyDto)dto);\r
+                       }else if (dto instanceof TermDto){\r
+                               terms.add((TermDto)dto);\r
+                       }\r
+               }\r
+               \r
+               if (!terms.isEmpty()) {\r
+                       List<UUID> uuids = new ArrayList<>();\r
+                       terms.forEach(term -> uuids.add(term.getUuid()));\r
+                       DeleteResult result = CdmStore.getService(ITermService.class).delete(uuids,\r
+                               new TermDeletionConfigurator());\r
+                       if (!result.isOk()){\r
+                           return showErrorMessage(result);\r
+            }\r
+               }\r
+               \r
+               if (!vocs.isEmpty()) {\r
+                       for (TermVocabularyDto voc: vocs) {\r
+                       definedEditorInput.getVocabularies().remove(voc);\r
 \r
                        // FIXME this is just a temporary fix for #6952\r
-                       Collection<TermDto> topLevelTerms = CdmStore.getService(IVocabularyService.class).getTopLevelTerms(termBase.getUuid());\r
+                       Collection<TermDto> topLevelTerms = CdmStore.getService(IVocabularyService.class).getTopLevelTerms(voc.getUuid());\r
                        if(!topLevelTerms.isEmpty()){\r
-                           MessagingUtils.warningDialog("Deletion not possible", this, "Deletion not possible. Vocabulary is not empty.\nPlease delete or move the child terms first");\r
+                           MessagingUtils.warningDialog("Deletion not possible", this, "Deletion not possible. Vocabulary "+ voc.getTitleCache()+" is not empty.\nPlease delete or move the child terms first");\r
                            return Status.CANCEL_STATUS;\r
                        }\r
 \r
-                       DeleteResult result =   CdmStore.getService(IVocabularyService.class).delete(termBase.getUuid());\r
+                       DeleteResult result =   CdmStore.getService(IVocabularyService.class).delete(voc.getUuid());\r
                        if (!result.isOk()){\r
                            return showErrorMessage(result);\r
                        }\r
+                       }\r
 \r
-               } else if (termBase instanceof TermDto) {\r
-                       DeleteResult result =   CdmStore.getService(ITermService.class).delete(termBase.getUuid(),\r
-                               new TermDeletionConfigurator());\r
-                       if (!result.isOk()){\r
-                           return showErrorMessage(result);\r
-            }\r
-               }\r
-               return postExecute(termBase);\r
+               } \r
+               return postExecute(termBases);\r
        }\r
 \r
        private IStatus showErrorMessage(DeleteResult result) {\r
index 418a82865da9214c26ce71cda402bf90e2f04328..7c18d21f3132319e6529566be98d0338e66c9896 100644 (file)
@@ -26,6 +26,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;\r
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;\r
 import eu.etaxonomy.cdm.persistence.dto.TermDto;\r
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
@@ -39,75 +40,72 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */\r
 public class MoveDefinedTermOperation extends AbstractPostTaxonOperation {\r
 \r
-       private final Collection<TermDto> sourceTerms;// the actual DefinedTermBase(s) we are moving\r
-       private final Collection<TermVocabularyDto> sourceVocabularies;\r
-       private final AbstractTermDto targetTermOrVocabulary;// the target VOCABULARY or DefinedTerm we are moving these to\r
-       private final int currentLocation;\r
+    private final Collection<TermDto> sourceTerms;// the actual\r
+                                                  // DefinedTermBase(s) we are\r
+                                                  // moving\r
+    private final Collection<TermCollectionDto> sourceVocabularies;\r
+    private final AbstractTermDto targetTermOrVocabulary;// the target\r
+                                                         // VOCABULARY or\r
+                                                         // DefinedTerm we are\r
+                                                         // moving these to\r
+    private final int currentLocation;\r
 \r
-       public MoveDefinedTermOperation(String label,\r
-               IUndoContext undoContext,\r
-               AbstractTermDto target,\r
-               Collection<TermDto> sourceTerms,\r
-               IPostOperationEnabled postOperationEnabled) {\r
-           this(label, undoContext, target, sourceTerms, postOperationEnabled, ViewerDropAdapter.LOCATION_ON);\r
-       }\r
-       public MoveDefinedTermOperation(String label,\r
-               IUndoContext undoContext,\r
-               AbstractTermDto target,\r
-               Collection<TermDto> sourceTerms,\r
-                       IPostOperationEnabled postOperationEnabled,\r
-                       int currentLocation) {\r
-               super(label, undoContext, postOperationEnabled);\r
+    public MoveDefinedTermOperation(String label, IUndoContext undoContext, AbstractTermDto target,\r
+            Collection<TermDto> sourceTerms, IPostOperationEnabled postOperationEnabled) {\r
+        this(label, undoContext, target, sourceTerms, postOperationEnabled, ViewerDropAdapter.LOCATION_ON);\r
+    }\r
 \r
-               this.targetTermOrVocabulary = target;\r
-               this.sourceTerms = sourceTerms;\r
-               this.currentLocation = currentLocation;\r
-               sourceVocabularies = new HashSet<>();\r
-       }\r
+    public MoveDefinedTermOperation(String label, IUndoContext undoContext, AbstractTermDto target,\r
+            Collection<TermDto> sourceTerms, IPostOperationEnabled postOperationEnabled, int currentLocation) {\r
+        super(label, undoContext, postOperationEnabled);\r
 \r
-       @Override\r
-       public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-           UpdateResult result = new UpdateResult();\r
-           for(TermDto term:sourceTerms){\r
-               sourceVocabularies.add(term.getVocabularyDto());\r
+        this.targetTermOrVocabulary = target;\r
+        this.sourceTerms = sourceTerms;\r
+        this.currentLocation = currentLocation;\r
+        sourceVocabularies = new HashSet<>();\r
+    }\r
+\r
+    @Override\r
+    public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {\r
+        UpdateResult result = new UpdateResult();\r
+        for (TermDto term : sourceTerms) {\r
+            sourceVocabularies.add(term.getVocabularyDto());\r
             UUID parentUuid = targetTermOrVocabulary.getUuid();\r
             TermMovePosition termMovePosition = TermMovePosition.ON;\r
-            if(currentLocation == ViewerDropAdapter.LOCATION_BEFORE) {\r
+            if (currentLocation == ViewerDropAdapter.LOCATION_BEFORE) {\r
                 termMovePosition = TermMovePosition.BEFORE;\r
-            }\r
-            else if(currentLocation == ViewerDropAdapter.LOCATION_AFTER) {\r
+            } else if (currentLocation == ViewerDropAdapter.LOCATION_AFTER) {\r
                 termMovePosition = TermMovePosition.AFTER;\r
             }\r
             result.includeResult(CdmStore.getService(ITermService.class).moveTerm(term, parentUuid, termMovePosition));\r
         }\r
-           Collection<CdmBase> affectedObjects = result.getUpdatedObjects();\r
-           Collection<AbstractTermDto> affectedDtos = new HashSet();\r
-           for (CdmBase base: affectedObjects){\r
-               if (base instanceof TermVocabulary){\r
-                   TermVocabularyDto dto = new TermVocabularyDto(base.getUuid(), ((TermVocabulary)base).getRepresentations(), ((TermVocabulary)base).getTermType(), ((TermVocabulary)base).getTitleCache(), ((TermVocabulary)base).isAllowDuplicates(), ((TermVocabulary)base).isOrderRelevant(), ((TermVocabulary)base).isFlat());\r
-                   affectedDtos.add(dto);\r
-               }\r
-               if (base instanceof DefinedTermBase){\r
-                   TermDto dto = TermDto.fromTerm((DefinedTermBase)base);\r
+        Collection<CdmBase> affectedObjects = result.getUpdatedObjects();\r
+        Collection<AbstractTermDto> affectedDtos = new HashSet<>();\r
+        for (CdmBase base : affectedObjects) {\r
+            if (base instanceof TermVocabulary) {\r
+                TermVocabularyDto dto = new TermVocabularyDto(base.getUuid(),\r
+                        ((TermVocabulary<?>) base).getRepresentations(), ((TermVocabulary) base).getTermType(),\r
+                        ((TermVocabulary) base).getTitleCache(), ((TermVocabulary) base).isAllowDuplicates(),\r
+                        ((TermVocabulary) base).isOrderRelevant(), ((TermVocabulary) base).isFlat());\r
                 affectedDtos.add(dto);\r
-               }\r
-           }\r
-\r
+            }\r
+            if (base instanceof DefinedTermBase) {\r
+                TermDto dto = TermDto.fromTerm((DefinedTermBase) base);\r
+                affectedDtos.add(dto);\r
+            }\r
+        }\r
 \r
-               return postExecute(affectedDtos);\r
-       }\r
+        return postExecute(affectedDtos);\r
+    }\r
 \r
-       @Override\r
-       public IStatus redo(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-               return null;\r
-       }\r
+    @Override\r
+    public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {\r
+        return null;\r
+    }\r
 \r
-       @Override\r
-       public IStatus undo(IProgressMonitor monitor, IAdaptable info)\r
-                       throws ExecutionException {\r
-               return null;\r
-       }\r
+    @Override\r
+    public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {\r
+        return null;\r
+    }\r
 \r
 }\r
index 4ccfb8acc0b24c846f1bf3368677ec136a0ecbd7..20a5a5bcd21c5c6921764b59916d12f78e092b3e 100644 (file)
@@ -50,12 +50,17 @@ public interface WorkbenchEventConstants {
     public static final String REFRESH_DESCRIPTIVE_DATASET = "REFRESH/DESCRIPTIVE_DATASET";
 
     public static final String ADD_SAVE_CANDIDATE = "ADD/SAVE/CANDIDATE";
+
+    public static final String REMOVE_ELEMENT = "REMOVE/ELEMENT";
+
     public static final String ADD_SAVE_CHARACTER = "ADD/SAVE/CHARACTER";
 
     public static final String ADD_TO_MERGE_ROWS = "ADD/TO/MERGE/ROWS";
 
     public static final String UPDATE_LINK_WITH_TAXON = "UPDATE/LINK_WITH_TAXON";
-    
+
     public static final String REFRESH_MATRIX = "REFRESH/MATRIX";
 
+    public static final String NEED_REFRESH_DETAILS = "BLOCK/DETAILS/TAXON";
+
 }
index 1c2799873e288b398501ef9c40e8551551f4bf6a..235c2e9ddde3a5ec578e76bff1e559b2c14ff2a7 100644 (file)
@@ -34,7 +34,7 @@ public class OpenPasswordWizzardHandlerE4 {
 
            if(principal instanceof User){
 
-               PasswordWizard wizard = new PasswordWizard((User)principal, null);
+               PasswordWizard wizard = new PasswordWizard((User)principal);
                WizardDialog dialog = new WizardDialog(shell, wizard);
 
                dialog.open();
index a55c97d4066c1bc23f55feac654b2b6293bed171..84b2cbce23c65e5e983cf4da9287abb31894d321 100644 (file)
@@ -6,7 +6,6 @@
 * 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.handler.e4;
 
 import javax.inject.Named;
index e6eca66b4c568f4fc7128eabfc05e0867294742e..d212e76eace830f17301ebbc5cd78222ee8cea26 100644 (file)
@@ -6,7 +6,6 @@
  * 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.io;
 
 import java.util.List;
@@ -26,50 +25,33 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 
 /**
- * <p>
- * Abstract AbstractIOHandler class.
- * </p>
- *
  * @author n.hoffmann
  * @created Sep 11, 2009
- * @version 1.0
  */
 public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
 
        protected ICdmRepository applicationConfiguration;
 
        public static enum TYPE {
-               Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris, OWL
+               Jaxb, Tcs, Excel_Taxa, Sdd, Abcd, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris, OWL
        }
 
-       /**
-        * <p>
-        * Constructor for AbstractIOHandler.
-        * </p>
-        *
-        * @param applicationController
-        *            a
-        *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
-        *            object.
-        * @param <CONFIGURATOR>
-        *            a CONFIGURATOR object.
-        */
        protected AbstractIOManager(
                        ICdmRepository applicationConfiguration) {
                this.applicationConfiguration = applicationConfiguration;
        }
-
-       /**
-        * Starts the IO process
-        *
-        * @param configurator
-        *            a CONFIGURATOR object.
-        */
-       public void run(final CONFIGURATOR configurator) {
-           // create job
-           Job job = createIOJob(configurator);
-           run(job);
-       }
+//
+//     /**
+//      * Starts the IO process
+//      *
+//      * @param configurator
+//      *            a CONFIGURATOR object.
+//      */
+//     public void run(final CONFIGURATOR configurator) {
+//         // create job
+//         Job job = createIOJob(configurator);
+//         run(job);
+//     }
 
        public void run(Job job) {
            // configure the job
@@ -79,16 +61,16 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
            job.schedule();
        }
 
-       /**
-        * <p>
-        * createIOJob
-        * </p>
-        *
-        * @param configurator
-        *            a CONFIGURATOR object.
-        * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
-        */
-       protected abstract Job createIOJob(CONFIGURATOR configurator);
+//     /**
+//      * <p>
+//      * createIOJob
+//      * </p>
+//      *
+//      * @param configurator
+//      *            a CONFIGURATOR object.
+//      * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
+//      */
+//     protected abstract Job createIOJob(CONFIGURATOR configurator);
 
         /**
      * @param configurator
index 3279d8b49627c945049ddaa89b4f309dde244375..00308aff988ecb11fdc93d64f2afd7d63c344c0d 100644 (file)
@@ -23,7 +23,8 @@ import java.util.UUID;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -34,10 +35,9 @@ import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
 import eu.etaxonomy.cdm.io.cdmLight.CdmLightExportConfigurator;
-import eu.etaxonomy.cdm.io.common.CdmDefaultExport;
+import eu.etaxonomy.cdm.io.coldp.ColDpExportConfigurator;
 import eu.etaxonomy.cdm.io.common.ExportDataWrapper;
 import eu.etaxonomy.cdm.io.common.ExportResult;
 import eu.etaxonomy.cdm.io.common.ExportResultType;
@@ -47,7 +47,7 @@ import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
 import eu.etaxonomy.cdm.io.service.IIOService;
-import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.cdm.io.wfo.out.WfoBackboneExportConfigurator;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -57,7 +57,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
- *
  * @author n.hoffmann
  * @created Sep 11, 2009
  */
@@ -65,7 +64,8 @@ public class ExportManager
         extends AbstractIOManager<IExportConfigurator>
         implements IPostMoniteredOperationEnabled {
 
-    private static final Logger logger = LogManager.getLogger(ExportManager.class);
+    private static final Logger logger = LogManager.getLogger();
+
     /** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
        public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm";
 
@@ -80,84 +80,6 @@ public class ExportManager
                return new ExportManager(applicationConfiguration);
        }
 
-       @Override
-       protected Job createIOJob(final IExportConfigurator configurator) {
-
-               Assert.isNotNull(configurator, "Configuration may not be null");
-
-               final Display display = Display.getCurrent();
-
-               Job job = new Job("Export: " + configurator.getClass().getSimpleName()) {
-                       @Override
-                       protected IStatus run(IProgressMonitor monitor) {
-                               monitor.beginTask(
-                                               "Exporting database. This will take some time.", 100);
-                               monitor.worked(10);
-
-                           /** see ticket # 4456 and */
-//                             display.asyncExec(new Runnable() {
-//
-//                                     @Override
-//                                     public void run() {
-//
-//                                         // terminate any open transactions
-//                                             IConversationEnabled activePart = (IConversationEnabled) StoreUtil
-//                                                             .getActivePage().getActivePart();
-//                                             activePart.getConversationHolder().commit(false);
-//                                     }
-//                             });
-
-//                             monitor.worked(10);
-
-                               CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<>();
-                               configurator.setProgressMonitor(CdmProgressMonitorAdapter
-                                               .CreateSubMonitor(monitor, 80));
-                               exporter.setCdmAppController(applicationConfiguration);
-                               monitor.worked(10);
-
-                               try {
-                                       exporter.invoke(configurator);
-                                       monitor.worked(60);
-                               } catch (RuntimeException e) {
-                                       MessagingUtils.messageDialog("Error exporting data", this,
-                                                       "An error occurred while"
-                                                                       + "exporting to destination '"
-                                                                       + configurator.getDestinationNameString()
-                                                                       + "'.\n"
-                                                                       + "Please check error log for details.", e);
-                               }
-
-                               display.asyncExec(()-> {
-                                       Object activePart = EventUtility.getActivePart();
-                                       if (activePart instanceof IConversationEnabled) {
-                                               // terminate any open transactions
-                                               IConversationEnabled conversationEnabled = (IConversationEnabled) activePart;
-                                               // restarting transaction and committing it to
-                                               // trigger
-                                               // change listener
-                                               // TODO verify correct behaviour
-
-                                               try{
-                                                       conversationEnabled.getConversationHolder()
-                                                               .startTransaction();
-
-                                                       conversationEnabled.getConversationHolder()
-                                                               .commit();
-                                               }catch(RuntimeException e){
-                                                       MessagingUtils.messageDialog("Error starting conversation handling", this, "" +
-                                                                       "Conversation Error: "+ e);
-                                               }
-                                       }
-                               });
-                               monitor.worked(10);
-
-                               return Status.OK_STATUS;
-                       }
-               };
-
-               return job;
-       }
-
        public Job createIOServiceJob(final IExportConfigurator configurator, final File exportFile) {
            Assert.isNotNull(configurator, "Configuration may not be null");
 
@@ -340,7 +262,9 @@ public class ExportManager
                                      Writer out = new BufferedWriter(new OutputStreamWriter(
                                                        stream, "UTF8"));
                                      stream.write(fileData);
+                                     out.flush();
                                      stream.close();
+
                                  }
                                 }
                         }else{
@@ -375,16 +299,32 @@ public class ExportManager
             @Override
             public void run() {
                boolean isZip = false;
-               if (configurator instanceof CdmLightExportConfigurator){
-                       isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile();
+               String urlAddition = "";
+               if (configurator instanceof CdmLightExportConfigurator 
+                               || configurator instanceof ColDpExportConfigurator 
+                               || configurator instanceof WfoBackboneExportConfigurator){
+                       
+                       if (configurator instanceof CdmLightExportConfigurator) {
+                           isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile();
+                       }else if (configurator instanceof ColDpExportConfigurator){
+                           isZip = ((ColDpExportConfigurator)configurator).isCreateZipFile();
+                       }else if (configurator instanceof WfoBackboneExportConfigurator){
+                           isZip = ((WfoBackboneExportConfigurator)configurator).isCreateZipFile();
+                           if (isZip) {
+                               SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
+                            Calendar cal = Calendar.getInstance();
+                               urlAddition = File.separator + ((WfoBackboneExportConfigurator)configurator).getFamilyStr() + "_WFO_" + sdf.format(cal.getTime());
+                           }
+                       }
                 }
-                AbstractUtility.executeMoniteredExport(configurator.getUserFriendlyIOName() != null? configurator.getUserFriendlyIOName(): "Export",
+                AbstractUtility.executeMoniteredExport(
+                               configurator.getUserFriendlyIOName() != null? configurator.getUserFriendlyIOName(): "Export",
                         uuid,
                         1000,
                         true,
                         ExportManager.this,
                         null,
-                        urlString,
+                        urlString+urlAddition,
                         isZip);
             }
         });
index 5faf2a36a5408238d73507af86ea6b46e66af41a..f4643f2e7556ae387ddac1471a612aeef3b22f17 100644 (file)
@@ -23,12 +23,10 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
-import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
@@ -38,23 +36,19 @@ import eu.etaxonomy.cdm.io.distribution.excelupdate.ExcelDistributionUpdateConfi
 import eu.etaxonomy.cdm.io.dwca.in.DwcaImportConfigurator;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbImportConfigurator;
-import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.gbif.in.GbifImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.gbif.in.GbifImportState;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostMoniteredOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 
 /**
  * @author n.hoffmann
@@ -74,82 +68,82 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                return new ImportManager(applicationConfiguration);
        }
 
-       /**
-        * Use when importing data into the current application context
-        *
-        * @param configurator
-        *            a {@link eu.etaxonomy.cdm.io.common.IImportConfigurator}
-        *            object.
-        * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
-        */
-       @Override
-       protected Job createIOJob(final IImportConfigurator configurator) {
-               Assert.isNotNull(configurator, "Configuration may not be null");
-
-               final Display display = Display.getDefault();
-
-               Job job = new Job("Import: " + configurator.getClass().getSimpleName()) {
-
-                       @Override
-                       protected IStatus run(IProgressMonitor monitor) {
-                               monitor.beginTask("Importing data", 100);
-                               configurator.setProgressMonitor(CdmProgressMonitorAdapter
-                                               .CreateSubMonitor(monitor, 70));
-
-                               monitor.worked(5);
-
-                               CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>();
-                               importer.setCdmAppController(applicationConfiguration);
-                               monitor.worked(5);
-                               ImportResult importResult = null;
-                               try {
-                                       importResult = importer.invoke(configurator);
-
-                                       monitor.worked(80);
-                               } catch (RuntimeException e) {
-                                       MessagingUtils.messageDialog(
-                                                       "Error importing data",
-                                                       this,
-                                                       "An error occurred while"
-                                                                       + "importing from source '"
-                                                                       + configurator.getSourceNameString()
-                                                                       + "'.\n"
-                                                                       + "Please check error log for details.", e);
-                               }
-
-                               monitor.worked(5);
-                               monitor.done();
-
-
-                               final StringBuilder reportText = new StringBuilder();
-                               if(importResult!=null){
-                                   List<byte[]> reports = importResult.getReports();
-                                   for (byte[] bs : reports) {
-                        reportText.append(new String(bs));
-                    }
-                               }
-                               display.asyncExec(new Runnable() {
-
-                                       @Override
-                                       public void run() {
-                        // display reports with possibility to save
-                        ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
-                        dialog.setTitle(configurator.getClass().getSimpleName()+" Report");
-                        dialog.setReportText(reportText.toString());
-                        dialog.open();
-
-                                               CdmStore.getContextManager().notifyContextRefresh();
-
-                                       }
-                               });
-
-                               return Status.OK_STATUS;
-                       }
-               };
-
-               return job;
-
-       }
+//     /**
+//      * Use when importing data into the current application context
+//      *
+//      * @param configurator
+//      *            a {@link eu.etaxonomy.cdm.io.common.IImportConfigurator}
+//      *            object.
+//      * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
+//      */
+//     @Override
+//     protected Job createIOJob(final IImportConfigurator configurator) {
+//             Assert.isNotNull(configurator, "Configuration may not be null");
+//
+//             final Display display = Display.getDefault();
+//
+//             Job job = new Job("Import: " + configurator.getClass().getSimpleName()) {
+//
+//                     @Override
+//                     protected IStatus run(IProgressMonitor monitor) {
+//                             monitor.beginTask("Importing data", 100);
+//                             configurator.setProgressMonitor(CdmProgressMonitorAdapter
+//                                             .CreateSubMonitor(monitor, 70));
+//
+//                             monitor.worked(5);
+//
+//                             CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<>();
+//                             importer.setCdmAppController(applicationConfiguration);
+//                             monitor.worked(5);
+//                             ImportResult importResult = null;
+//                             try {
+//                                     importResult = importer.invoke(configurator);
+//
+//                                     monitor.worked(80);
+//                             } catch (RuntimeException e) {
+//                                     MessagingUtils.messageDialog(
+//                                                     "Error importing data",
+//                                                     this,
+//                                                     "An error occurred while"
+//                                                                     + "importing from source '"
+//                                                                     + configurator.getSourceNameString()
+//                                                                     + "'.\n"
+//                                                                     + "Please check error log for details.", e);
+//                             }
+//
+//                             monitor.worked(5);
+//                             monitor.done();
+//
+//
+//                             final StringBuilder reportText = new StringBuilder();
+//                             if(importResult!=null){
+//                                 List<byte[]> reports = importResult.getReports();
+//                                 for (byte[] bs : reports) {
+//                        reportText.append(new String(bs));
+//                    }
+//                             }
+//                             display.asyncExec(new Runnable() {
+//
+//                                     @Override
+//                                     public void run() {
+//                        // display reports with possibility to save
+//                        ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+//                        dialog.setTitle(configurator.getClass().getSimpleName()+" Report");
+//                        dialog.setReportText(reportText.toString());
+//                        dialog.open();
+//
+//                                             CdmStore.getContextManager().notifyContextRefresh();
+//
+//                                     }
+//                             });
+//
+//                             return Status.OK_STATUS;
+//                     }
+//             };
+//
+//             return job;
+//
+//     }
 
        public Job createIOServiceJob(IImportConfigurator configurator, InputStream is, SOURCE_TYPE type) {
 
@@ -282,8 +276,6 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                        return JaxbImportConfigurator.NewInstance(null, null);
                case Tcs:
                        return TcsXmlImportConfigurator.NewInstance(null, null);
-               case Endnote:
-                       return EndnoteImportConfigurator.NewInstance(null, null);
                case Excel_Taxa:
                        return NormalExplicitImportConfigurator.NewInstance(null, null,
                                        null, null);
@@ -291,8 +283,6 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                        return Abcd206ImportConfigurator.NewInstance(null, null);
                case Sdd:
                        return SDDImportConfigurator.NewInstance(null, null);
-               case SpecimenCdmExcel:
-                       return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
                case SpecimenSearch:
                    return Abcd206ImportConfigurator.NewInstance(null, null);
                case Gbif:
@@ -332,18 +322,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                return (TcsXmlImportConfigurator) getConfigurator(TYPE.Tcs);
        }
 
-       /**
-        * <p>
-        * EndnoteConfigurator
-        * </p>
-        *
-        * @return a
-        *         {@link eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator}
-        *         object.
-        */
-       public final EndnoteImportConfigurator EndnoteConfigurator() {
-               return (EndnoteImportConfigurator) getConfigurator(TYPE.Endnote);
-       }
+       
 
        /**
         * <p>
@@ -383,10 +362,6 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
                return (Abcd206ImportConfigurator) getConfigurator(TYPE.Abcd);
        }
 
-       public SpecimenCdmExcelImportConfigurator SpecimenCdmExcelImportConfigurator() {
-               return (SpecimenCdmExcelImportConfigurator) getConfigurator(TYPE.SpecimenCdmExcel);
-       }
-
        public DwcaImportConfigurator DwcaImportConfigurator() {
                return (DwcaImportConfigurator) getConfigurator(TYPE.Gbif);
        }
similarity index 89%
rename from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/AbstractImportWizardE4.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/AbstractImportWizard.java
index d171aba3d38773698adb6732fd89262686763586..15ab33a845a8dcbd3e84a2df039461d57a4067f7 100644 (file)
@@ -6,7 +6,6 @@
 * 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.io.e4.in;
 
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
@@ -23,13 +22,12 @@ import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 
 /**
- *
  * @author pplitzner
  * @since Oct 5, 2017
  *
  * @param <CONFIG>
  */
-public abstract class AbstractImportWizardE4<CONFIG extends IIoConfigurator> extends Wizard {
+public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> extends Wizard {
 
        protected GenericConfiguratorWizardPageE4 pageConfiguration;
        private NomenclaturalCodeWizardPageE4 pageNomenclaturalCode;
@@ -40,17 +38,16 @@ public abstract class AbstractImportWizardE4<CONFIG extends IIoConfigurator> ext
 
     private EPartService partService;
 
-    public AbstractImportWizardE4(IEclipseContext context, EPartService partService) {
+    public AbstractImportWizard(IEclipseContext context, EPartService partService) {
         this(context, partService, null);
     }
 
-    public AbstractImportWizardE4(IEclipseContext context, EPartService partService, IStructuredSelection selection) {
+    public AbstractImportWizard(IEclipseContext context, EPartService partService, IStructuredSelection selection) {
            this.context = context;
            this.partService = partService;
            this.selection = selection;
     }
 
-       /** {@inheritDoc} */
        @Override
        public void addPages() {
                super.addPages();
@@ -99,5 +96,4 @@ public abstract class AbstractImportWizardE4<CONFIG extends IIoConfigurator> ext
        public IStructuredSelection getSelection() {
                return selection;
        }
-
-}
+}
\ No newline at end of file
index 400740bfe70422ca9802cbb03a4dbcc054e33687..11f1cedbd0e9f8c3d5c64aba68172df2519ee514 100644 (file)
@@ -17,18 +17,16 @@ import org.eclipse.swt.widgets.Shell;
 /**
  * @author pplitzner
  * @since Oct 5, 2017
- *
  */
 public abstract class AbstractOpenImportWizard {
     @Execute
-    public void execute(IEclipseContext ctx, Shell s)
-    {
-        AbstractImportWizardE4 wizard = ContextInjectionFactory.make(getImportWizardClass(), ctx);
+    public void execute(IEclipseContext ctx, Shell s){
+        AbstractImportWizard<?> wizard = ContextInjectionFactory.make(getImportWizardClass(), ctx);
         wizard.init();
         WizardDialog dialog = new WizardDialog(s, wizard);
         dialog.open();
     }
 
-    protected abstract Class<? extends AbstractImportWizardE4> getImportWizardClass();
+    protected abstract Class<? extends AbstractImportWizard> getImportWizardClass();
 
 }
\ No newline at end of file
index 8d16488e3dd95d6173d9c64ef1338c0e61bfe15d..636600fe4f6009337727927a187f9d3fdd258a75 100644 (file)
@@ -6,13 +6,11 @@
  * 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.io.e4.in;
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
@@ -32,10 +30,8 @@ import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
- *
  * @author pplitzner
  * @since Oct 5, 2017
- *
  */
 public class GenericConfiguratorWizardPageE4 extends WizardPage {
 
@@ -76,7 +72,6 @@ public class GenericConfiguratorWizardPageE4 extends WizardPage {
         init("Export Configuration", "Configure the export mechanism.", configurator, ignoreMethods);
     }
 
-    /** {@inheritDoc} */
     @Override
     public void createControl(Composite parent) {
 
@@ -88,9 +83,7 @@ public class GenericConfiguratorWizardPageE4 extends WizardPage {
         composite.setLayout(gridLayout);
 
         List<Method> methods = getConfiguratorsBooleanSetMethods(configurator);
-        Collections.sort(methods, new Comparator<Method>() {
-            @Override
-            public int compare(Method o1, Method o2) {
+        Collections.sort(methods, (o1,o2)-> {
                 if (o1.equals(o2)){
                     return 0;
                 }
@@ -108,19 +101,17 @@ public class GenericConfiguratorWizardPageE4 extends WizardPage {
                     return o1.toString().compareTo(o1.toString());
                 }
                 return result;
-            }
         });
 
-               for (Method method : methods) {
-                       if (ignoreMethods != null){
-                           if (!ignoreMethods.contains( method.getName())) {
-                               createCheckbox(composite, method, configurator);
-                           }
-                       }else{
-                               createCheckbox(composite, method, configurator);
-                       }
-
-               }
+        for (Method method : methods) {
+               if (ignoreMethods != null){
+                   if (!ignoreMethods.contains( method.getName())) {
+                       createCheckbox(composite, method, configurator);
+                   }
+               }else{
+                       createCheckbox(composite, method, configurator);
+               }
+        }
 
         setControl(composite);
     }
@@ -138,15 +129,12 @@ public class GenericConfiguratorWizardPageE4 extends WizardPage {
                 + methodName.substring(3));
         checkBox.setSelection(defaultSelection);
         checkBox.addSelectionListener(new SelectionAdapter() {
-
             @Override
             public void widgetSelected(SelectionEvent e) {
                 executeBooleanSetMethod(configurator, methodName,
                         checkBox.getSelection());
             }
-
         });
-
     }
 
     private String getLabel(String methodName){
@@ -165,8 +153,7 @@ public class GenericConfiguratorWizardPageE4 extends WizardPage {
     private boolean executeBooleanGetMethod(IIoConfigurator configurator,
             String methodName) {
 
-        Class<? extends IIoConfigurator> configuratorClass = configurator
-                .getClass();
+        Class<? extends IIoConfigurator> configuratorClass = configurator.getClass();
 
         boolean result = false;
 
index 363cd242e1cf58b1516847728772cf8ed33ff814..0985fcbf39d0bdb2aac3021fe68c8b2d4301376b 100644 (file)
@@ -29,9 +29,9 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wb.swt.ResourceManager;
 
-import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
@@ -59,6 +59,7 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
     private Text textClassification;
     private Button btnBrowseClassification;
     private Button btnClear;
+    private Combo comboAddIndividualsAssociations;
 
     private Text textSource;
     private Button btnBrowseSource;
@@ -74,6 +75,7 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
     private Combo nomenclaturalCodeSelectionCombo;
     private Combo checkBoxMapUnitId;
     private Combo textDNAProviderString;
+    Button checkBoxReuseDescriptiveGroups;
 
        protected AbcdImportConfiguratorWizardPage(String title, String description, Abcd206ImportConfigurator configurator) {
            this(title, description, configurator, false, false);
@@ -133,10 +135,8 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
         textClassification.setEnabled(false);
         textClassification.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
         if (abcdImportConfigurator.getClassificationUuid() != null){
-            if (abcdImportConfigurator.getClassificationName() != null){
-                textClassification.setText(abcdImportConfigurator.getClassificationName());
-            }else{
-                Classification classification = CdmStore.getService(IClassificationService.class).load(abcdImportConfigurator.getClassificationUuid());
+            Classification classification = CdmStore.getService(IClassificationService.class).load(abcdImportConfigurator.getClassificationUuid());
+            if (classification != null){
                 textClassification.setText(classification.getTitleCache());
             }
         }
@@ -247,31 +247,39 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
         labelLinkToTaxon.setText("Link to Taxon");
         labelLinkToTaxon.setFont(font);
 
-        Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK);
+        comboAddIndividualsAssociations = new Combo(composite, SWT.NULL);
         gridData = new GridData();
-        gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
+        gridData.horizontalAlignment=SWT.BEGINNING;
         gridData.horizontalSpan = 2;
-        checkBoxAddIndividualsAssociations.setLayoutData(gridData);
+        comboAddIndividualsAssociations.setLayoutData(gridData);
         GridDataFactory.fillDefaults();
-        checkBoxAddIndividualsAssociations.setSelection(abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
-        checkBoxAddIndividualsAssociations.setText("Create an Individual Association for each Specimen");
-        checkBoxAddIndividualsAssociations
-            .setToolTipText("For each specimen associated to a taxon an indiviadual association to this taxon is created");
-        checkBoxAddIndividualsAssociations.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
-            }
-        });
+        
+        comboAddIndividualsAssociations.add("Add Taxon Facts");
+        comboAddIndividualsAssociations.add("Add Specimen Determination");
+        comboAddIndividualsAssociations.add("Add Both");
+        
+
+        comboAddIndividualsAssociations.addSelectionListener(this);
+        
+        if (abcdImportConfigurator.isAddIndividualsAssociations() ){
+            if (abcdImportConfigurator.isAddDeterminations()) {
+                comboAddIndividualsAssociations.select(2);                
+            }else {
+                comboAddIndividualsAssociations.select(0);
+            }            
+        }else {
+            comboAddIndividualsAssociations.select(1);
+        }
+
 
-        Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK);
+        checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK);
         gridData = new GridData();
         gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
         gridData.horizontalSpan = 2;
         checkBoxReuseDescriptiveGroups.setLayoutData(gridData);
         GridDataFactory.fillDefaults();
         checkBoxReuseDescriptiveGroups.setSelection(abcdImportConfigurator.isReuseExistingDescriptiveGroups());
-        checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group");
+        checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group (only for taxon facts)");
         checkBoxReuseDescriptiveGroups
             .setToolTipText("Reuse one of the existing descriptive groups or create a new one for every import");
         checkBoxReuseDescriptiveGroups.addSelectionListener(new SelectionAdapter() {
@@ -280,6 +288,10 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
                 abcdImportConfigurator.setReuseExistingDescriptiveGroups(!abcdImportConfigurator.isReuseExistingDescriptiveGroups());
             }
         });
+        
+        if (!abcdImportConfigurator.isAddIndividualsAssociations()) {
+            checkBoxReuseDescriptiveGroups.setEnabled(false);
+        }
 
 
         Label labelSpecimen = new Label(composite, SWT.NONE);
@@ -505,6 +517,25 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
         if (e.getSource().equals(nomenclaturalCodeSelectionCombo)){
             this.abcdImportConfigurator.setNomenclaturalCode(NomenclaturalCode.getByKey(nomenclaturalCodeSelectionCombo.getText()));
         }
+        if (e.getSource().equals(comboAddIndividualsAssociations)){
+            int index = comboAddIndividualsAssociations.getSelectionIndex();
+            if (index == 0) {
+                this.abcdImportConfigurator.setAddIndividualsAssociations(true);
+                this.abcdImportConfigurator.setAddDeterminations(false);
+                this.checkBoxReuseDescriptiveGroups.setEnabled(true);
+            }
+            if (index == 1) {
+                this.abcdImportConfigurator.setAddIndividualsAssociations(false);
+                this.abcdImportConfigurator.setAddDeterminations(true);
+                this.checkBoxReuseDescriptiveGroups.setEnabled(false);
+            }
+            if (index == 2) {
+                this.abcdImportConfigurator.setAddIndividualsAssociations(true);
+                this.abcdImportConfigurator.setAddDeterminations(true);
+                this.checkBoxReuseDescriptiveGroups.setEnabled(true);
+            }
+            
+        }
         if (e.getSource().equals(checkBoxMapUnitId)){
             String text = checkBoxMapUnitId.getText();
             if (text.equals(ACCESSION_NUMBER)){
@@ -535,10 +566,8 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i
             try{
                 abcdImportConfigurator.setDnaSoure(URI.create(textDNAProviderString.getText()));
             }catch(IllegalArgumentException e){
-//TODO: check prior or message
                 abcdImportConfigurator.setDnaSoure(null);
             }
-
             PreferencesUtil.setStringValue(IPreferenceKeys.LAST_USED_ABCD_CONFIG, abcdImportConfigurator.toString());
            }
 
index 193baea5e39ac8acbdb37c64acf681a53f830bc5..574364808c5106732a10de9aa294b9ab1f41a79a 100644 (file)
@@ -18,7 +18,7 @@ import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @since Oct 5, 2017
  */
-public class AbcdImportWizardE4 extends AbstractImportWizardE4<Abcd206ImportConfigurator> {
+public class AbcdImportWizardE4 extends AbstractImportWizard<Abcd206ImportConfigurator> {
 
        private Abcd206ImportConfigurator configurator;
        private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
index 3697e167e7c8293f1236a4e2541d18fd117329c7..3d47ca5700642e8629eaa4cd1167fd747d6337f3 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.abcd;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenAbcdImportWizard extends AbstractOpenImportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return AbcdImportWizardE4.class;
     }
 
index cda5f7dfc95c90724d86d6147891f6c5e3a2a141..a0f95e20785344c63d4ac58eeb8a1522ccc80d1a 100644 (file)
@@ -28,7 +28,7 @@ import org.eclipse.e4.ui.workbench.modeling.EPartService;
 import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.distribution.excelupdate.ExcelDistributionUpdateConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileAndChooseVocIdWizardPageE4;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -38,7 +38,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author k.luther
  * @date 03.05.2017
  */
-public class ExcelDistributionUpdateWizardE4 extends AbstractImportWizardE4<ExcelDistributionUpdateConfigurator> {
+public class ExcelDistributionUpdateWizardE4 extends AbstractImportWizard<ExcelDistributionUpdateConfigurator> {
 
 
     private ExcelDistributionUpdateConfigurator configurator;
index ed74576ab3d39f88a115daaad5be2cba8c725b8b..4b5cd9745d415ba1e4a69e2bfbd6c1bcd70e237f 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.excel.distribution;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenExcelDistributionImportWizard extends AbstractOpenImportWizard
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return ExcelDistributionUpdateWizardE4.class;
     }
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/OpenExcelSpecimenImportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/OpenExcelSpecimenImportWizard.java
deleted file mode 100644 (file)
index 8b6b6e4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
-* Copyright (C) 2017 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.io.e4.in.excel.specimen;
-
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
-
-/**
- * @author pplitzner
- * @since Oct 5, 2017
- *
- */
-public class OpenExcelSpecimenImportWizard extends AbstractOpenImportWizard {
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
-        return SpecimenCdmExcelImportWizardE4.class;
-    }
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/SpecimenCdmExcelImportWizardE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/SpecimenCdmExcelImportWizardE4.java
deleted file mode 100644 (file)
index 2619a85..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- *
- */
-package eu.etaxonomy.taxeditor.io.e4.in.excel.specimen;
-
-import eu.etaxonomy.cdm.common.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.contexts.ContextInjectionFactory;
-import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.ui.workbench.modeling.EPartService;
-
-import eu.etaxonomy.cdm.database.DbSchemaValidation;
-import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
-import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
-import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- *
- * @author pplitzner
- * @since Oct 5, 2017
- *
- */
-public class SpecimenCdmExcelImportWizardE4 extends AbstractImportWizardE4<SpecimenCdmExcelImportConfigurator> {
-
-
-    private SpecimenCdmExcelImportConfigurator configurator;
-
-       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
-
-       @Inject
-       public SpecimenCdmExcelImportWizardE4(IEclipseContext context, EPartService partService) {
-           super(context, partService);
-       }
-
-       @Override
-       public SpecimenCdmExcelImportConfigurator getConfigurator() {
-               return configurator;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-    public void init() {
-               configurator =  CdmStore.getImportManager().SpecimenCdmExcelImportConfigurator();
-       }
-
-       @Override
-       public boolean performFinish() {
-               URI source = dataSourcePage.getUri();
-               configurator.setSource(source);
-               configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-
-               CdmStore.getImportManager().run(configurator);
-
-               return true;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public void addPages() {
-               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
-        dataSourcePage.setTitle("Choose Specimen CDM Excel");
-        dataSourcePage.setDescription("Please choose an xls file in the SpecimenCdmExcel format.");
-        dataSourcePage.setExtensions(new String[]{"*.xlsx", "*.xls", "*.*"});
-
-               addPage(dataSourcePage);
-               super.addPages();
-       }
-
-        @Override
-        protected void addConfiguratorPage(){
-            List<String> ignoreMethods = new ArrayList<>();
-         ignoreMethods.add("setIgnoreNull");
-         ignoreMethods.add("setInteractWithUser");
-         ignoreMethods.add("setUseClassification");
-         ignoreMethods.add("setRegisterAuditing");
-         ignoreMethods.add("setDeduplicateAuthors");
-         ignoreMethods.add("setDeduplicateReferences");
-         pageConfiguration = ContextInjectionFactory.make(GenericConfiguratorWizardPageE4.class, context);
-         pageConfiguration.initImport(getConfigurator(), ignoreMethods, Messages.ExcelSpecimenUpdateWizard_ConfiguratorWizard_label);
-         addPage(pageConfiguration);
-    }
-
-}
index 8d8027a8075d506e324621e6fb8ab339f9c11cd3..12eea4399d3b7f2d9f640c4c1302f2af68bb7662 100644 (file)
@@ -34,7 +34,7 @@ import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -45,7 +45,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @since Oct 5, 2017
  */
-public class ExcelNormalExplicitTaxaImportWizardE4 extends AbstractImportWizardE4<NormalExplicitImportConfigurator>{
+public class ExcelNormalExplicitTaxaImportWizardE4 extends AbstractImportWizard<NormalExplicitImportConfigurator>{
 
     private NormalExplicitImportConfigurator configurator;
 
index cfbb0e5b715c73b477bd79ce6bfc10153842428f..551b4024ceb0b42b8c1c4d0bcdbad9c41c7ae32d 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.excel.taxa;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenExcelTaxaImportWizard extends AbstractOpenImportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return ExcelNormalExplicitTaxaImportWizardE4.class;
     }
 
index 5d85927150ff7e43450f333a7f9bb890fc34f438..33c5f99520bace9ccda87047aed3ded2b3de6c2f 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.owl;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -20,7 +20,7 @@ import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 public class OpenOwlImportWizard extends AbstractOpenImportWizard {
 
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return OwlImportWizard.class;
     }
 
index 6e44346a2c89699e2316be4034572457cf363a67..b7c9371c3864be18d2ddd3df81a7d69d0d7b8770 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.descriptive.owl.in.StructureTreeOwlImportConfigurator;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -31,7 +31,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @since Apr 25, 2019
  */
-public class OwlImportWizard extends AbstractImportWizardE4<StructureTreeOwlImportConfigurator> {
+public class OwlImportWizard extends AbstractImportWizard<StructureTreeOwlImportConfigurator> {
 
        private StructureTreeOwlImportConfigurator configurator;
        private ImportFromFileDataSourceWizardPage dataSourcePage;
index bf48670390aede9d08a9496448f123c6fc40090b..66df58b9553a951c3e037fbbce50c7cafd251029 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.ris;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenRisImportWizard extends AbstractOpenImportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return RISImportWizardE4.class;
     }
 
index afb05c4abcfe72f856d2ea38847e37b8f41d9ad5..d721a21355078c1255d6559e12768ef3591b0236 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.reference.ris.in.RisReferenceImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.io.e4.in.excel.distribution.ExcelDistributionUpdateWizardE4;
@@ -38,7 +38,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author k.luther
  * @date 12.05.2017
  */
-public class RISImportWizardE4 extends AbstractImportWizardE4<RisReferenceImportConfigurator>{
+public class RISImportWizardE4 extends AbstractImportWizard<RisReferenceImportConfigurator>{
 
     private RisReferenceImportConfigurator configurator;
 
index 7715e6d3d5c2774206bb63b73c4b4687962bf786..0aa197b1cf1c1650e67c1b90ad00c0aea62ee8c5 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.sdd;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenSddImportWizard extends AbstractOpenImportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return SddImportWizardE4.class;
     }
 
index b78b161c3430e151a92d91193b23914d6a33d40d..41c7d55c27132f9f3a8f71d33a3f5b80c742f751 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -30,7 +30,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @since Oct 5, 2017
  */
-public class SddImportWizardE4 extends AbstractImportWizardE4<SDDImportConfigurator> {
+public class SddImportWizardE4 extends AbstractImportWizard<SDDImportConfigurator> {
 
     private SDDImportConfigurator configurator;
 
index 034cddf671fea4b884dd033fdfa99f75e6d6c9a7..678fc23a97b74b407746c791219790f4a920d515 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.in.tcs;
 
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenTcsImportWizard extends AbstractOpenImportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+    protected Class<? extends AbstractImportWizard> getImportWizardClass() {
         return TcsImportWizardE4.class;
     }
 
index 90d7d539c2e67b34371b150271872039121628eb..500e1a2330e95c473e3116939053dae95517ae32 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
 import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -33,7 +33,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author pplitzner
  * @since Oct 5, 2017
  */
-public class TcsImportWizardE4 extends AbstractImportWizardE4<TcsXmlImportConfigurator> {
+public class TcsImportWizardE4 extends AbstractImportWizard<TcsXmlImportConfigurator> {
 
     private TcsXmlImportConfigurator configurator;
 
similarity index 78%
rename from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/AbstractExportWizardE4.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/AbstractExportWizard.java
index 60995720b9b5eb7fd0b7a9bc30dc80b5a9c9ba56..5fd225d370c2da0054f3825aa67d7baf69a0b029 100644 (file)
@@ -20,21 +20,21 @@ import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
  * @author pplitzner
  * @since Oct 6, 2017
  */
-public abstract class AbstractExportWizardE4<CONFIG extends IIoConfigurator> extends Wizard {
+public abstract class AbstractExportWizard<CONFIG extends IIoConfigurator> extends Wizard {
 
        protected final String CONFIGURATION_PAGE = "CONFIGURATION_PAGE";
 
-       private GenericConfiguratorWizardPageE4 pageConfiguration;
+       protected GenericConfiguratorWizardPageE4 pageConfiguration;
 
     protected IStructuredSelection selection;
 
-    private IEclipseContext context;
+    protected IEclipseContext context;
 
-    public AbstractExportWizardE4(IEclipseContext context) {
+    public AbstractExportWizard(IEclipseContext context) {
         this(context, null);
     }
 
-    public AbstractExportWizardE4(IEclipseContext context, IStructuredSelection selection) {
+    public AbstractExportWizard(IEclipseContext context, IStructuredSelection selection) {
         this.context = context;
         this.selection = selection;
     }
index 2fb2c19d9f2facf0a5446c280941ed46d3bdf0b2..6952944dfeaf2e382e118b8b93b3c92ebe2cda7c 100644 (file)
@@ -24,12 +24,12 @@ public abstract class AbstractOpenExportWizard {
     @Execute
     public void execute(IEclipseContext ctx, Shell s)
     {
-        AbstractExportWizardE4 wizard = ContextInjectionFactory.make(getExportWizardClass(), ctx);
+        AbstractExportWizard wizard = ContextInjectionFactory.make(getExportWizardClass(), ctx);
         wizard.init();
         WizardDialog dialog = new WizardDialog(s, wizard);
         dialog.open();
     }
 
-    protected abstract Class<? extends AbstractExportWizardE4> getExportWizardClass();
+    protected abstract Class<? extends AbstractExportWizard> getExportWizardClass();
 
 }
\ No newline at end of file
index 13704b14d53511591126876219fc50f007cd8920..9d47b4ac120492f0c7f8a4690526c1e601ed43e6 100644 (file)
@@ -10,6 +10,7 @@ package eu.etaxonomy.taxeditor.io.e4.out.cdmlight;
 
 import java.io.File;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.HashSet;
 import java.util.List;
@@ -18,7 +19,8 @@ import java.util.UUID;
 import javax.inject.Inject;
 import javax.inject.Named;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
 import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.e4.core.di.annotations.Optional;
 import org.eclipse.e4.ui.services.IServiceConstants;
@@ -26,13 +28,14 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.swt.widgets.Combo;
 
-import eu.etaxonomy.cdm.ext.geo.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
+import eu.etaxonomy.cdm.format.description.distribution.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.io.cdmLight.CdmLightExportConfigurator;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -42,7 +45,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 21.03.2017
  */
 public class CdmLightExportWizardE4 extends
-AbstractExportWizardE4<CdmLightExportConfigurator> {
+AbstractExportWizard<CdmLightExportConfigurator> {
 
 
     private CdmLightExportConfigurator configurator;
@@ -128,6 +131,8 @@ AbstractExportWizardE4<CdmLightExportConfigurator> {
             }
         }
         configurator.getTaxonNodeFilter().setIncludeUnpublished(page.isExportUnpublishedData());
+        configurator.setDoFactualData(page.isExportFactualData());
+        configurator.setIncludeUnpublishedFacts(page.isExportUnpublishedFactualData());
         CdmStore.getExportManager().runMoniteredOperation(configurator, urlString);
         // create job
 //        Job job = CdmStore.getExportManager().createIOServiceJob(configurator, urlString);
@@ -143,10 +148,16 @@ AbstractExportWizardE4<CdmLightExportConfigurator> {
     @Override
     public void addPages() {
         //standard page
-        page =  ExportToFileDestinationWizardPage.OutputModel(configurator);
+        page =  ExportToFileDestinationWizardPage.CdmLight(configurator);
 
         addPage(page);
-        super.addPages();
+        pageConfiguration = ContextInjectionFactory.make(GenericConfiguratorWizardPageE4.class, context);
+        List<String> ignoreMethods = new ArrayList<>();
+        ignoreMethods.add("setDoFactualData");
+        ignoreMethods.add("setIncludeUnpublishedFacts");
+        pageConfiguration.initExport(getConfigurator(), ignoreMethods);
+        this.addPage(pageConfiguration);
+
         if (PreferencesUtil.showGfbioMetaData()){
             metaDataPage = new MetaDataConfigurationWizardPage("Add Meta Data", configurator);
             addPage(metaDataPage);
index 7f02e537117a16528f3c0f8485422f72e8c9e632..e61d7780be159179e2ceda6ea03595603517b1b0 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.cdmlight;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenCdmLightExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return CdmLightExportWizardE4.class;
     }
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/ColExportWizardE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/ColExportWizardE4.java
new file mode 100644 (file)
index 0000000..de59213
--- /dev/null
@@ -0,0 +1,155 @@
+/**
+ * Copyright (C) 2023 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.io.e4.out.col;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashSet;
+import java.util.List;
+import java.util.UUID;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.widgets.Combo;
+
+import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
+import eu.etaxonomy.cdm.io.coldp.ColDpExportConfigurator;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author katjaluther
+ * @date 01.09.2023
+ */
+public class ColExportWizardE4 extends
+AbstractExportWizard<ColDpExportConfigurator> {
+
+
+    private ColDpExportConfigurator configurator;
+    private ExportToFileDestinationWizardPage page;
+
+    public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm";
+    TaxonNodeDto selectedNode;
+
+    @Inject
+    public ColExportWizardE4(IEclipseContext context,
+            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection) {
+        super(context, selection);
+    }
+
+    @Override
+    public void init() {
+        configurator = ColDpExportConfigurator.NewInstance();
+
+        if (selection instanceof TreeSelection && !selection.isEmpty() &&  selection.getFirstElement() instanceof TaxonNodeDto){
+            selectedNode = (TaxonNodeDto)selection.getFirstElement();
+
+            if (selectedNode.getParentUUID() == null){
+                configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(selectedNode.getClassificationUUID()));
+            }else{
+                configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(selectedNode.getUuid()));
+            }
+        }
+    }
+
+
+    @Override
+    public ColDpExportConfigurator getConfigurator() {
+        return configurator;
+    }
+
+    @Override
+    public boolean performFinish() {
+        String urlString = page.getFolderText() + File.separator ;
+        if (configurator.isCreateZipFile()){
+            SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
+            Calendar cal = Calendar.getInstance();
+
+            if (!configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()){
+                urlString +=  selectedNode.getNameCache().replace(" ", "_")+"_colDP_"+sdf.format(cal.getTime());
+            }else if (!configurator.getTaxonNodeFilter().getClassificationFilter().isEmpty()){
+                urlString += page.getSelectedClassification().getTitleCache().replace(" ", "_")+"_colDP_"+sdf.format(cal.getTime());
+                page.getSelectedClassification();
+            }
+
+        }
+
+        //+ page.getExportFileName();
+
+        final Combo combo = page.getCombo();
+
+
+        final List<Classification> listClassifications = CdmStore.getCurrentApplicationConfiguration().getClassificationService().listClassifications(null, null, null, null);
+        if(combo != null){
+            int selectionIndex = combo.getSelectionIndex();
+            HashSet<UUID> set = new HashSet<UUID>();
+            if(selectionIndex == -1){
+                for(Classification c:listClassifications){
+                    set.add(c.getUuid());
+                }
+            }else{
+                for(Classification c:listClassifications){
+                    if(c.getTitleCache().equalsIgnoreCase(combo.getItem(selectionIndex))){
+                        set.add(c.getUuid());
+
+                        if (!page.getCheckUseSelectedTaxonNode()){
+                            configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(c.getUuid()));
+                        }
+                    }
+                }
+
+
+            }
+        }
+        configurator.getTaxonNodeFilter().setIncludeUnpublished(page.isExportUnpublishedData());
+        configurator.setDoFactualData(page.isExportFactualData());
+        configurator.setIncludeUnpublishedFacts(page.isExportUnpublishedFactualData());
+        CdmStore.getExportManager().runMoniteredOperation(configurator, urlString);
+        // create job
+//        Job job = CdmStore.getExportManager().createIOServiceJob(configurator, urlString);
+//        // configure the job
+//        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
+//        job.setUser(true);
+//        // schedule job
+//        job.schedule();
+        PreferencesUtil.setStringValue("exportFolder", page.getFolderText());
+        return true;
+    }
+
+    @Override
+    public void addPages() {
+        //standard page
+        page =  ExportToFileDestinationWizardPage.ColDp(configurator);
+
+        addPage(page);
+        pageConfiguration = ContextInjectionFactory.make(GenericConfiguratorWizardPageE4.class, context);
+        List<String> ignoreMethods = new ArrayList<>();
+        ignoreMethods.add("setDoFactualData");
+        ignoreMethods.add("setIncludeUnpublishedFacts");
+        pageConfiguration.initExport(getConfigurator(), ignoreMethods);
+        this.addPage(pageConfiguration);
+
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/OpenColExportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/col/OpenColExportWizard.java
new file mode 100644 (file)
index 0000000..29b79f9
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+* Copyright (C) 2017 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.io.e4.out.col;
+
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
+
+/**
+ * @author pplitzner
+ * @since Oct 5, 2017
+ *
+ */
+public class OpenColExportWizard extends AbstractOpenExportWizard {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
+        return ColExportWizardE4.class;
+    }
+
+}
index d49d9b2209b8b2a04900b988904b90d7d538d772..592a19cc88385a080dd1498bc50e26517ba436c8 100644 (file)
@@ -23,7 +23,7 @@ import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.csv.redlist.demo.CsvDemoExportConfigurator;
 import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Nov. 11, 2014
  * @version 1.0
  */
-public class CsvExportWizardE4 extends AbstractExportWizardE4<CsvDemoExportConfigurator> {
+public class CsvExportWizardE4 extends AbstractExportWizard<CsvDemoExportConfigurator> {
 
        private CsvDemoExportConfigurator configurator;
        private ExportToFileDestinationWizardPage page;
index 8287f2bc49b6928a3172130492471bd630de90aa..9c6eb1d92a78d87748453399739c4413ab1985c6 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.csv;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenCsvExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return CsvExportWizardE4.class;
     }
 
index 49e3c124300f3e864f2d95c5416258618276e473..f98b337b2806f4d4930aa845e70164b47a45a8e4 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -34,7 +34,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Apr. 12, 2015
  * @version 1.0
  */
-public class CsvNameExportWizardE4 extends AbstractExportWizardE4<CsvNameExportConfigurator> {
+public class CsvNameExportWizardE4 extends AbstractExportWizard<CsvNameExportConfigurator> {
 
 
     protected CsvNameExportConfigurator configurator;
index b5cac94b760df8de02c1ecf035bf3068240e648b..025c5d0fa2dfee4a2cd5662f83fb23ccbd255909 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.csv.name;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenCsvNameExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return CsvNameExportWizardE4.class;
     }
 
index d70df8033557ffd7b57194c9040ac0cd2dd3c86b..59d8644804ea2651a7c1ab8c57db1c776b216ae6 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.csv.print;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenCsvPrintExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return CsvPrintExportWizardE4.class;
     }
 
index 5726adf50ebc71ed1c0b8a1a97e790d1950a199f..9b1c201ea3e2b8e5b06e549388d08ddb37ccadda 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.TreeSelection;
 import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
 import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -36,7 +36,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class DarwinCoreArchiveExportWizardE4 extends
-               AbstractExportWizardE4<DwcaTaxExportConfigurator> {
+               AbstractExportWizard<DwcaTaxExportConfigurator> {
 
     private DwcaTaxExportConfigurator configurator;
        private ExportToFileDestinationWizardPage page;
index a94cb9dfdda0eac51bedfa603c72a6801b102c7a..d45673f76229e04c48a3ff73a8135aef09ad4389 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.dwca;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenDwcaExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return DarwinCoreArchiveExportWizardE4.class;
     }
 
index 8c15f0ac78f065f775a0dd4021e17334dea4553c..795bfd42032429c5448ab7931d890c8e45b19909 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since Oct 6, 2017
  *
  */
-public class JaxbExportWizardE4 extends AbstractExportWizardE4<JaxbExportConfigurator> {
+public class JaxbExportWizardE4 extends AbstractExportWizard<JaxbExportConfigurator> {
 
        private ExportToFileDestinationWizardPage page;
 
index 0201f4b4d719133f95143ca22909a17d92a30086..beec4bbd23164f54d77424c322b8a6ab6aa84198 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.jaxb;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenJaxbExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return JaxbExportWizardE4.class;
     }
 
index 93b313af2e25275bd6055b867c9db8e0539306e3..a19501f93631b505d6df80078633b59b0b7cf2dd 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.owl;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -20,7 +20,7 @@ import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 public class OpenOwlTermExportWizard extends AbstractOpenExportWizard {
 
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return OwlTermExportWizard.class;
     }
 
index 40d6c3fd74c1bd4bfde6ad86541681975bdfdb39..d2e908c4df9b8eac98210bc294df774fccd4bec7 100644 (file)
@@ -21,7 +21,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.descriptive.owl.out.StructureTreeOwlExportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -31,7 +31,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class OwlTermExportWizard extends
-AbstractExportWizardE4<StructureTreeOwlExportConfigurator> {
+AbstractExportWizard<StructureTreeOwlExportConfigurator> {
 
     private StructureTreeOwlExportConfigurator configurator;
     private OwlTermExportWizardPage exportPage;
index ae537a6f4a44ab7df5c4912527b3edd59302a4f0..e02457a653f577d8342077d3310e9a613496b471 100644 (file)
@@ -38,7 +38,8 @@ public class OwlTermExportWizardPage extends WizardPage {
 
     private OwlTermExportComposite composite;
     private DirectoryDialog folderDialog;
-    private static final String EXPORT_FOLDER ="EXPORT_FOLDER";
+    private static final String EXPORT_FOLDER = "EXPORT_FOLDER";
+
     protected OwlTermExportWizardPage(String pageName) {
         super(pageName);
         setTitle("OWL Term Export");
@@ -55,13 +56,14 @@ public class OwlTermExportWizardPage extends WizardPage {
         termTypes.add(TermType.Property);
         termTypes.add(TermType.State);
         termTypes.add(TermType.Character);
-        List<TermVocabularyDto> areaVocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermTypes(termTypes);
+        List<TermVocabularyDto> areaVocabularies = CdmStore.getService(IVocabularyService.class)
+                .findVocabularyDtoByTermTypes(termTypes);
         composite.getSelectVocabularyComposite().getViewer().setInput(areaVocabularies);
-        composite.getSelectVocabularyComposite().getViewer().addCheckStateListener(e->updateButtons());
+        composite.getSelectVocabularyComposite().getViewer().addCheckStateListener(e -> updateButtons());
 
         List<TermTree> trees = CdmStore.getService(ITermTreeService.class).list(TermTree.class, null, null, null, null);
         composite.getSelectFeatureTreeComposite().getViewer().setInput(trees);
-        composite.getSelectFeatureTreeComposite().getViewer().addCheckStateListener(e->updateButtons());
+        composite.getSelectFeatureTreeComposite().getViewer().addCheckStateListener(e -> updateButtons());
 
         folderDialog = new DirectoryDialog(parent.getShell());
         String exportFolder = PreferencesUtil.getStringValue(EXPORT_FOLDER, true);
@@ -78,52 +80,51 @@ public class OwlTermExportWizardPage extends WizardPage {
                     updateButtons();
                 }
 
-
-//                FileDialog dialog = new FileDialog(parent.getShell());
-//                String[] filterNames = {
-//                        "Web Ontology Language (*.owl)",
-//                        "Extensible Markup Language (*.xml)",
-//                        "All files (*.*)"
-//                        };
-//                String[] filterExtensions = { "*.owl", "*.xml", "*.*"};
-//
-//                dialog.setOverwrite(true);
-//                dialog.setFilterNames(filterNames);
-//                dialog.setFilterExtensions(filterExtensions);
-//                String fileString = dialog.open();
-//                if(fileString!=null){
-//                    composite.getTxtExportDirectory().setText(fileString);
-//
-//                }
+                // FileDialog dialog = new FileDialog(parent.getShell());
+                // String[] filterNames = {
+                // "Web Ontology Language (*.owl)",
+                // "Extensible Markup Language (*.xml)",
+                // "All files (*.*)"
+                // };
+                // String[] filterExtensions = { "*.owl", "*.xml", "*.*"};
+                //
+                // dialog.setOverwrite(true);
+                // dialog.setFilterNames(filterNames);
+                // dialog.setFilterExtensions(filterExtensions);
+                // String fileString = dialog.open();
+                // if(fileString!=null){
+                // composite.getTxtExportDirectory().setText(fileString);
+                //
+                // }
             }
         });
         setControl(composite);
     }
 
-    private void updateButtons(){
+    private void updateButtons() {
         this.getWizard().getContainer().updateButtons();
     }
 
-    String getExportDirectory(){
+    String getExportDirectory() {
         return composite.getExportDirectory();
     }
 
-    List<UUID> getSelectedTrees(){
+    List<UUID> getSelectedTrees() {
         List<UUID> selectedTrees = new ArrayList<>();
         Object[] checkedElements = composite.getSelectFeatureTreeComposite().getViewer().getCheckedElements();
         for (Object object : checkedElements) {
-            if(object instanceof TermTree) {
+            if (object instanceof TermTree) {
                 selectedTrees.add(((TermTree) object).getUuid());
             }
         }
         return selectedTrees;
     }
 
-    List<UUID> getSelectedVocabularies(){
+    List<UUID> getSelectedVocabularies() {
         List<UUID> vocs = new ArrayList<>();
         Object[] checkedElements = composite.getSelectVocabularyComposite().getViewer().getCheckedElements();
         for (Object object : checkedElements) {
-            if(object instanceof TermVocabularyDto){
+            if (object instanceof TermVocabularyDto) {
                 vocs.add(((TermVocabularyDto) object).getUuid());
             }
         }
@@ -132,8 +133,7 @@ public class OwlTermExportWizardPage extends WizardPage {
 
     @Override
     public boolean isPageComplete() {
-        return !getSelectedVocabularies().isEmpty()
-                || !getSelectedTrees().isEmpty()
+        return !getSelectedVocabularies().isEmpty() || !getSelectedTrees().isEmpty()
                 || CdmUtils.isNotBlank(getExportDirectory());
     }
 
index f14f755c556d29a6c6dccb6b6e75c5b94fbec0d6..91a8036b0d2a2a9d5ed776b0d54f93eb46bf65af 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.io.e4.out.sdd;
 
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
 
 /**
@@ -22,7 +22,7 @@ public class OpenSddExportWizard extends AbstractOpenExportWizard {
      * {@inheritDoc}
      */
     @Override
-    protected Class<? extends AbstractExportWizardE4> getExportWizardClass() {
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
         return SddExportWizardE4.class;
     }
 
index 6882726cd5a86ec00d3f72d6c23685e93c566fc2..ee80cf1f4b7ec141394591d031538d9cca4f6ec4 100644 (file)
@@ -18,7 +18,7 @@ import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
 import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since Oct 6, 2017
  *
  */
-public class SddExportWizardE4 extends AbstractExportWizardE4<SDDExportConfigurator> {
+public class SddExportWizardE4 extends AbstractExportWizard<SDDExportConfigurator> {
 
        private ExportToFileDestinationWizardPage page;
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/OpenWfoBackboneExportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/OpenWfoBackboneExportWizard.java
new file mode 100644 (file)
index 0000000..768be34
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+* Copyright (C) 2017 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.io.e4.out.wfo;
+
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractOpenExportWizard;
+
+/**
+ * @author k.luther
+ * @since Jan 2024
+ */
+public class OpenWfoBackboneExportWizard extends AbstractOpenExportWizard {
+
+    @Override
+    protected Class<? extends AbstractExportWizard> getExportWizardClass() {
+        return WfoBackboneExportWizard.class;
+    }
+
+    @Override
+    @Execute
+    public void execute(IEclipseContext ctx, Shell s){
+
+        AbstractExportWizard<?> wizard = ContextInjectionFactory.make(getExportWizardClass(), ctx);
+        wizard.init();
+        WizardDialog dialog = new WizardDialog(s, wizard);
+        dialog.open();
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/WfoBackboneExportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/wfo/WfoBackboneExportWizard.java
new file mode 100644 (file)
index 0000000..9d92c72
--- /dev/null
@@ -0,0 +1,120 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+
+package eu.etaxonomy.taxeditor.io.e4.out.wfo;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+
+import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
+import eu.etaxonomy.cdm.io.wfo.out.WfoBackboneExportConfigurator;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
+import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizard;
+import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @since Jan 23, 2024
+ */
+public class WfoBackboneExportWizard extends
+               AbstractExportWizard<WfoBackboneExportConfigurator> {
+
+    private WfoBackboneExportConfigurator configurator;
+       private ExportToFileDestinationWizardPage page;
+
+    @Inject
+       public WfoBackboneExportWizard(IEclipseContext context,
+               @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection) {
+           super(context, selection);
+       }
+
+       @Override
+       public void init() {
+               configurator = WfoBackboneExportConfigurator.NewInstance();
+               if (selection instanceof TreeSelection && !selection.isEmpty()){
+                       Iterator<?> it = selection.iterator();
+
+                       while(it.hasNext()){
+                               Object obj = it.next();
+                               if (obj instanceof TaxonNodeDto){
+                                       TaxonNodeDto node = (TaxonNodeDto) obj;
+                                       if (node.getParentUUID() == null){
+                                               //configurator = null;
+                                       }else{
+                                               if (configurator.getTaxonNodeFilter() == null){
+                                                       configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(node.getUuid()));
+                                               }else{
+                                                       configurator.getTaxonNodeFilter().orSubtree(node.getUuid());
+                                               }
+
+                                       }
+                               }
+                       }
+               }
+       }
+
+       @Override
+       public WfoBackboneExportConfigurator getConfigurator() {
+               return configurator;
+       }
+
+       @Override
+       public boolean performFinish() {
+               String urlString = page.getFolderText();// + File.separator
+                               //+ page.getExportFileName();
+
+
+               if (StringUtils.isNotBlank(page.getFamilyString())) {
+                   configurator.setFamilyStr(page.getFamilyString());
+               }
+               if (StringUtils.isNotBlank(page.get_baseUrl())) {
+            configurator.setSourceLinkBaseUrl(page.get_baseUrl());
+        }
+        CdmStore.getExportManager().runMoniteredOperation(configurator, urlString);
+
+               return true;
+       }
+
+       @Override
+       public void addPages() {
+           if (configurator == null) {
+               //don't call the export on classifications
+               this.setWindowTitle("Please select a subtree for WFO Backbone export, not a classification");
+           }
+               page = ExportToFileDestinationWizardPage.WFO(configurator);
+               addPage(page);
+               pageConfiguration = ContextInjectionFactory.make(GenericConfiguratorWizardPageE4.class, context);
+               List<String> ignoreMethods = new ArrayList<>();
+        ignoreMethods.add("setDoFactualData");
+        pageConfiguration.initExport(getConfigurator(), ignoreMethods);
+        this.addPage(pageConfiguration);
+       }
+        @Override
+           public boolean canFinish() {
+               boolean canFinish = super.canFinish();
+               if (configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()) {
+                   return false;
+               }
+               return canFinish;
+           }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java
deleted file mode 100644 (file)
index 37c4cb5..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.io.wizard;
-
-import java.io.File;
-
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.ui.workbench.modeling.EPartService;
-
-import eu.etaxonomy.cdm.common.URI;
-import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
-import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPage;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * <p>EndnoteImportWizard class.</p>
- *
- * @author n.hoffmann
- * @created Sep 18, 2009
- */
-public class EndnoteImportWizard extends AbstractImportWizardE4<EndnoteImportConfigurator>  {
-
-       private EndnoteImportConfigurator configurator;
-
-       private ImportFromFileDataSourceWizardPage dataSourcePage;
-
-       @Inject
-    public EndnoteImportWizard(IEclipseContext context, EPartService partService) {
-        super(context, partService);
-    }
-
-       @Override
-       public boolean performFinish() {
-
-               File file = dataSourcePage.getFile();
-               configurator.setSource(URI.fromFile(file));
-
-               CdmStore.getImportManager().run(configurator);
-
-               return true;
-       }
-
-       @Override
-       public void addPages() {
-               super.addPages();
-
-               dataSourcePage = new ImportFromFileDataSourceWizardPage();
-               addPage(dataSourcePage);
-       }
-
-       @Override
-    public void init() {
-               configurator =  CdmStore.getImportManager().EndnoteConfigurator();
-       }
-
-       @Override
-       public EndnoteImportConfigurator getConfigurator() {
-               return configurator;
-       }
-
-
-
-}
\ No newline at end of file
index e38da72bb27932d9a0206e7ecc1bdf5d222ffa77..38f53deea8421ee31cf7a4b97242277ef1e4a78a 100644 (file)
@@ -6,13 +6,12 @@
  * The content 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.io.wizard;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -30,6 +29,7 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
@@ -39,6 +39,7 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.filter.LogicFilter;
 import eu.etaxonomy.cdm.io.cdmLight.CdmLightExportConfigurator;
+import eu.etaxonomy.cdm.io.coldp.ColDpExportConfigurator;
 import eu.etaxonomy.cdm.io.common.ExportConfiguratorBase;
 import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;
 import eu.etaxonomy.cdm.io.csv.redlist.demo.CsvDemoExportConfigurator;
@@ -46,7 +47,9 @@ import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.out.TcsXmlExportConfigurator;
+import eu.etaxonomy.cdm.io.wfo.out.WfoBackboneExportConfigurator;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDtoByNameComparator;
@@ -65,47 +68,52 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class ExportToFileDestinationWizardPage extends WizardPage implements SelectionListener {
 
-       /** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
-       public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm";
+    /** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
+    public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm";
 
-       /** Constant <code>JAXB_EXPORT="JAXB_EXPORT"</code> */
-       public static final String JAXB_EXPORT = "JAXB_EXPORT";
+    /** Constant <code>JAXB_EXPORT="JAXB_EXPORT"</code> */
+    public static final String JAXB_EXPORT = "JAXB_EXPORT";
 
-       /** Constant <code>TCS_EXPORT="TCS_EXPORT"</code> */
-       public static final String TCS_EXPORT = "TCS_EXPORT";
+    /** Constant <code>TCS_EXPORT="TCS_EXPORT"</code> */
+    public static final String TCS_EXPORT = "TCS_EXPORT";
 
-       /** Constant <code>SDD_EXPORT="SDD_EXPORT"</code> */
-       public static final String SDD_EXPORT = "SDD_EXPORT";
+    /** Constant <code>SDD_EXPORT="SDD_EXPORT"</code> */
+    public static final String SDD_EXPORT = "SDD_EXPORT";
 
-       public static final String DWCA_EXPORT = "DWCA_EXPORT";
-       public static final String OUTPUT_MODEL_EXPORT = "CDM_LIGHT(CSV)";
-       public static final String CSV_EXPORT = "CSV_EXPORT";
-       public static final String CSV_NAME_EXPORT = "CSV_NAME_EXPORT";
-       private static final String CSV_PRINT_EXPORT ="CSV_PRINT_EXPORT";
-       private static final String EXPORT_FOLDER ="EXPORT_FOLDER";
-       public static final String XML = "xml";
+    public static final String DWCA_EXPORT = "DWCA_EXPORT";
+    public static final String WFO_BACKBONE_EXPORT = "WFO_BACKBONE_EXPORT";
+    public static final String CDM_LIGHT_EXPORT = "CDM_LIGHT(CSV)";
+    public static final String COL_DP_EXPORT = "COL DP";
+    public static final String CSV_EXPORT = "CSV_EXPORT";
+    public static final String CSV_NAME_EXPORT = "CSV_NAME_EXPORT";
+    private static final String CSV_PRINT_EXPORT = "CSV_PRINT_EXPORT";
+    private static final String EXPORT_FOLDER = "EXPORT_FOLDER";
+    public static final String XML = "xml";
 
-       public static final String CSV = "csv";
+    public static final String CSV = "csv";
 
-       public static final String ZIP = "zip";
+    public static final String ZIP = "zip";
 
     private boolean csvExport = false;
 
     private boolean csvNameExport = false;
 
-       private boolean csvPrintExport = false;
+    private boolean csvPrintExport = false;
+
+    private boolean cdmLightExport = false;
 
-       private boolean outputModelExport = false;
-       private boolean dwcaExport = false;
+    private boolean colDPExport = false;
+    private boolean dwcaExport = false;
+    private boolean wfoBackboneExport = false;
 
-       private DirectoryDialog folderDialog;
-       private Text text_exportFileName;
+    private DirectoryDialog folderDialog;
+    private Text text_exportFileName;
 
-       private Text text_folder;
+    private Text text_folder;
 
-       private final String type;
+    private final String type;
 
-       private final String extension;
+    private final String extension;
 
     private Combo classificationSelectionCombo;
 
@@ -113,278 +121,339 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel
 
     private Classification selectedClassification;
 
-    private Label classificationLabel;
-
-    private ExportConfiguratorBase configurator;
-    private Button checkUseSelectedtaxonNode;
+    private ExportConfiguratorBase<?, ?, ?> configurator;
+    private Button checkUseSelectedTaxonNode;
 
     private Button checkUseSelectedClassification;
     private Button checkUseAllClassification;
 
     private Button checkExportUnpublished;
-    Combo orderSelectionCombo;
-
-
-       protected ExportToFileDestinationWizardPage(String pageName, String type,
-                       String title, String description, String extension, ExportConfiguratorBase configurator) {
-               super(pageName);
-               this.configurator = configurator;
-               this.type = type;
-               switch(type) {
-                  case CSV_EXPORT :
-                          csvExport = true;
-                          break;
-                  case CSV_NAME_EXPORT:
-                          csvNameExport = true;
-                          break;
-                  case OUTPUT_MODEL_EXPORT:
-                          outputModelExport = true;
-                          break;
-                  case CSV_PRINT_EXPORT:
-                          csvPrintExport = true;
-                          break;
-                  case DWCA_EXPORT:
-                          dwcaExport = true;
-                          break;
-               }
-               this.extension = extension;
-               this.setTitle(title);
-               this.setDescription(description);
-       }
-
-       public static ExportToFileDestinationWizardPage Jaxb(JaxbExportConfigurator configurator) {
-               return new ExportToFileDestinationWizardPage(
-                               JAXB_EXPORT,
-                               "jaxb",
-                               "JAXB Export",
-                               "Exports the content of the currently selected database into the cdm jaxb format.",
-                               XML, configurator);
-       }
-
-       public static ExportToFileDestinationWizardPage Tcs(TcsXmlExportConfigurator config) {
-               return new ExportToFileDestinationWizardPage(
-                               TCS_EXPORT,
-                               "tcs",
-                               "Tcs Export",
-                               "Export the content of the currently selected database into TCS format.",
-                               XML, config);
-       }
-
-       public static ExportToFileDestinationWizardPage Sdd(SDDExportConfigurator config) {
-               return new ExportToFileDestinationWizardPage(
-                               SDD_EXPORT,
-                               "sdd",
-                               "Sdd Export",
-                               "Export the content of the currently selected database into SDD format.",
-                               XML, config);
-       }
-
-       public static ExportToFileDestinationWizardPage Dwca(DwcaTaxExportConfigurator config) {
-               return new ExportToFileDestinationWizardPage(
-                               DWCA_EXPORT,
-                               DWCA_EXPORT,
-                               "DwC-Archive Export",
-                               "Export the content of the currently selected database into Darwin Core Archive format.",
-                               ZIP, config);
-       }
-
-    public static ExportToFileDestinationWizardPage OutputModel(CdmLightExportConfigurator config) {
-
-        return new ExportToFileDestinationWizardPage(
-                OUTPUT_MODEL_EXPORT,
-                OUTPUT_MODEL_EXPORT,
-                "CDM Light Export (csv)",
-                "Export the content of the currently selected database into the CDM light (csv) format.",
-                CSV,config);
+    private Button checkExportFactualData;
+    private Button checkExportUnpublishedFactualData;
+
+    private Combo orderSelectionCombo;
+
+    private Text text_familyString;
+
+    private Text text_baseUrl;
+
+    protected ExportToFileDestinationWizardPage(String pageName, String type, String title, String description,
+            String extension, ExportConfiguratorBase<?, ?, ?> configurator) {
+        super(pageName);
+        this.configurator = configurator;
+        this.type = type;
+        switch (type) {
+        case CSV_EXPORT:
+            csvExport = true;
+            break;
+        case CSV_NAME_EXPORT:
+            csvNameExport = true;
+            break;
+        case CDM_LIGHT_EXPORT:
+            cdmLightExport = true;
+            break;
+        case COL_DP_EXPORT:
+            colDPExport = true;
+            break;
+        case CSV_PRINT_EXPORT:
+            csvPrintExport = true;
+            break;
+        case DWCA_EXPORT:
+            dwcaExport = true;
+            break;
+        case WFO_BACKBONE_EXPORT:
+            wfoBackboneExport = true;
+            break;
+        default:
+            throw new RuntimeException("Export type not yet handeled: " + type);
+        }
+        this.extension = extension;
+        this.setTitle(title);
+        this.setDescription(description);
     }
 
-    public static ExportToFileDestinationWizardPage Csv(CsvDemoExportConfigurator config) {
+    public static ExportToFileDestinationWizardPage Jaxb(JaxbExportConfigurator configurator) {
+        return new ExportToFileDestinationWizardPage(JAXB_EXPORT, "jaxb", "JAXB Export",
+                "Exports the content of the currently selected database into the cdm jaxb format.", XML, configurator);
+    }
+
+    public static ExportToFileDestinationWizardPage Tcs(TcsXmlExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(TCS_EXPORT, "tcs", "Tcs Export",
+                "Export the content of the currently selected database into TCS format.", XML, config);
+    }
 
-        return new ExportToFileDestinationWizardPage(
-                CSV_EXPORT,
-                CSV_EXPORT,
-                "CSV Export",
-                "Export the content of the currently selected database into Comma Separated Value format.",
+    public static ExportToFileDestinationWizardPage Sdd(SDDExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(SDD_EXPORT, "sdd", "Sdd Export",
+                "Export the content of the currently selected database into SDD format.", XML, config);
+    }
+
+    public static ExportToFileDestinationWizardPage Dwca(DwcaTaxExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(DWCA_EXPORT, DWCA_EXPORT, "DwC-Archive Export",
+                "Export the content of the currently selected database into Darwin Core Archive format.", ZIP, config);
+    }
+    
+    public static ExportToFileDestinationWizardPage WFO(WfoBackboneExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(WFO_BACKBONE_EXPORT, WFO_BACKBONE_EXPORT, "WFO Backbone Export",
+                "Export the content of the currently selected database into WFO Backbone format."
+                , CSV, config);
+    }
+
+    public static ExportToFileDestinationWizardPage CdmLight(CdmLightExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(CDM_LIGHT_EXPORT, CDM_LIGHT_EXPORT, "CDM Light Export (csv)",
+                "Export the content of the currently selected database into the CDM light (csv) format.", 
                 CSV, config);
     }
 
-    public static ExportToFileDestinationWizardPage CsvNames(CsvNameExportConfigurator config) {
+    public static ExportToFileDestinationWizardPage ColDp(ColDpExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(COL_DP_EXPORT, COL_DP_EXPORT, "Col DP Export (zip)",
+                "Export the content of the currently selected database into the Catalogue of Life Data Package (Col DP) format.", 
+                ZIP, config);
+    }
 
-        return new ExportToFileDestinationWizardPage(
-                CSV_NAME_EXPORT,
-                CSV_NAME_EXPORT,
-                "CSV Name Export",
-                "Export the names of the currently selected database into Semicolon Separated Value format.",
+    public static ExportToFileDestinationWizardPage Csv(CsvDemoExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(CSV_EXPORT, CSV_EXPORT, "CSV Export",
+                "Export the content of the currently selected database into Comma Separated Value format.", 
                 CSV, config);
     }
 
-    public static ExportToFileDestinationWizardPage CsvPrint(CsvNameExportConfigurator config) {
+    public static ExportToFileDestinationWizardPage CsvNames(CsvNameExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(CSV_NAME_EXPORT, CSV_NAME_EXPORT, "CSV Name Export",
+                "Export the names of the currently selected database into Semicolon Separated Value format.", 
+                CSV, config);
+    }
 
-        return new ExportToFileDestinationWizardPage(
-                CSV_PRINT_EXPORT,
-                CSV_NAME_EXPORT,
-                "CSV Print Export",
-                "Export the content of the currently selected database into Semicolon Separated Value format.",
+    public static ExportToFileDestinationWizardPage CsvPrint(CsvNameExportConfigurator config) {
+        return new ExportToFileDestinationWizardPage(CSV_PRINT_EXPORT, CSV_NAME_EXPORT, "CSV Print Export",
+                "Export the content of the currently selected database into Semicolon Separated Value format.", 
                 CSV, config);
     }
 
-       /** {@inheritDoc} */
-       @Override
+    @Override
     public void createControl(Composite parent) {
 
-               setPageComplete(false);
+        setPageComplete(false);
 
-               Composite composite = new Composite(parent, SWT.NONE);
-               GridLayout gridLayout = new GridLayout();
+        Composite composite = new Composite(parent, SWT.NONE);
+        GridLayout gridLayout = new GridLayout();
 
-               gridLayout.numColumns = 2;
-               TaxonNode node = null;
+        gridLayout.numColumns = 2;
+        TaxonNode node = null;
 
-               composite.setLayout(gridLayout);
-               if (outputModelExport || dwcaExport){
-            checkExportUnpublished = new Button(composite,  SWT.CHECK);
+        composite.setLayout(gridLayout);
+        if (cdmLightExport || dwcaExport || colDPExport) {
+            checkExportUnpublished = new Button(composite, SWT.CHECK);
             checkExportUnpublished.setText("Export unpublished taxa");
+            Label emptyLabel = new Label(composite, SWT.NONE);
+            checkExportFactualData = new Button(composite, SWT.CHECK);
+            checkExportFactualData.setText("Export factual data");
+            checkExportFactualData.setSelection(true);
+            checkExportFactualData.addListener(SWT.Selection, e -> {
+                Button b = (Button) e.widget;
+                GridData data = (GridData) checkExportUnpublishedFactualData.getLayoutData();
+                data.exclude = b.getSelection();
+                checkExportUnpublishedFactualData.setEnabled(data.exclude);
+            });
+            if (cdmLightExport || colDPExport) {
+                emptyLabel = new Label(composite, SWT.NONE);
+
+                checkExportUnpublishedFactualData = new Button(composite, SWT.CHECK);
+                checkExportUnpublishedFactualData.setText("Export unpublished factual data");
+                checkExportUnpublishedFactualData.setSelection(false);
+                GridData gridData = new GridData();
+                gridData.horizontalIndent = 20;
+                checkExportUnpublishedFactualData.setLayoutData(gridData);
+            }
+
             @SuppressWarnings("unused")
             Label nope = new Label(composite, SWT.NONE);
 
             Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
-            GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
-            gridData.horizontalSpan = 2;
-            separator.setLayoutData(gridData);
+            GridData gridDataSep = new GridData(GridData.FILL_HORIZONTAL);
+            gridDataSep.horizontalSpan = 2;
+            separator.setLayoutData(gridDataSep);
         }
-               if(classifications == null){
-                       classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
-                       Collections.sort(classifications, new Comparator<Classification>() {
-
-                @Override
-                public int compare(Classification o1, Classification o2) {
-                    if (o1.equals(o2)){
-                        return 0;
-                    }
-                    int result = o1.getTitleCache().compareTo(o2.getTitleCache());
-                    if (result == 0){
-                        return o1.getUuid().compareTo(o2.getUuid());
-                    }
-                    return result;
+        if (classifications == null && !wfoBackboneExport) {
+            classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
+            Collections.sort(classifications, (o1, o2) -> {
+                if (o1.equals(o2)) {
+                    return 0;
                 }
+                int result = o1.getTitleCache().compareTo(o2.getTitleCache());
+                if (result == 0) {
+                    return o1.getUuid().compareTo(o2.getUuid());
+                }
+                return result;
             });
-                       if (!configurator.getTaxonNodeFilter().getClassificationFilter().isEmpty()){
-                               selectedClassification = CdmStore.getService(IClassificationService.class).load(configurator.getTaxonNodeFilter().getClassificationFilter().get(0).getUuid());
-                       }else{
-
-                               selectedClassification = classifications.iterator().next();
-                       }
-               }
+            if (!configurator.getTaxonNodeFilter().getClassificationFilter().isEmpty()) {
+                selectedClassification = CdmStore.getService(IClassificationService.class)
+                        .load(configurator.getTaxonNodeFilter().getClassificationFilter().get(0).getUuid());
+            } else {
 
+                selectedClassification = classifications.iterator().next();
+            }
+        }
 
-               if(csvExport || csvPrintExport || outputModelExport|| csvNameExport || dwcaExport){
+        if (csvExport || csvPrintExport || cdmLightExport || csvNameExport || dwcaExport || colDPExport || wfoBackboneExport) {
 
-//                 Label comboBoxLabel = new Label(composite, SWT.NONE);
-//                 comboBoxLabel.setText("Classification");
-                       Composite selectNodeOrClassification = new Composite(composite, SWT.NONE);
-                       GridLayout grid = new GridLayout();
+            // Label comboBoxLabel = new Label(composite, SWT.NONE);
+            // comboBoxLabel.setText("Classification");
+            Composite selectNodeOrClassification = new Composite(composite, SWT.NONE);
+            GridLayout grid = new GridLayout();
             grid.numColumns = 1;
+            GridData gridDataNode = new  GridData(SWT.FILL, SWT.FILL, true, false);
+            gridDataNode.horizontalSpan = 2;
+
             selectNodeOrClassification.setLayout(grid);
-                       if ((outputModelExport || dwcaExport)&& !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()){
-                               checkUseSelectedtaxonNode= new Button(selectNodeOrClassification,  SWT.RADIO);
-                               String taxonStr = "";
-                               int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size();
-                               for (LogicFilter<TaxonNode> filter: configurator.getTaxonNodeFilter().getSubtreeFilter()){
-                                       node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(filter.getUuid());
-                                       count--;
-                                       if (node.hasTaxon()){
-                                               taxonStr += node.getTaxon().getName().getTitleCache();
-                                               if (count>0){
-                                                       taxonStr += ", ";
-                                               }
-                                       }
-                               }
-
-                               checkUseSelectedtaxonNode.setText("Export selected subtree(s) ("+  taxonStr+")");
-                               checkUseSelectedtaxonNode.addListener(SWT.Selection, new Listener() {
-                                       @Override
-                                       public void handleEvent(Event e) {
-                                               Button b = (Button) e.widget;
-                               GridData data = (GridData)  classificationSelectionCombo.getLayoutData();
-                               data.exclude = b.getSelection();
-                               classificationSelectionCombo.setEnabled(!data.exclude);
-
-                               }
-                               });
-                                 checkUseSelectedtaxonNode.setSelection(true);
-                       }
-                       if(outputModelExport || dwcaExport){
-                                 if (dwcaExport){
-                                         checkUseAllClassification= new Button(selectNodeOrClassification,  SWT.RADIO);
-                                         checkUseAllClassification.setText("Export all classifications");
-                                         checkUseAllClassification.addListener(SWT.Selection, new Listener() {
-                                      @Override
-                                      public void handleEvent(Event e) {
-                                          Button b = (Button) e.widget;
-                                              GridData data = (GridData)  classificationSelectionCombo.getLayoutData();
-                                              data.exclude = b.getSelection();
-                                              classificationSelectionCombo.setEnabled(!data.exclude);
-
-                                      }
-                                               });
-                                 }
-                                 checkUseSelectedClassification= new Button(selectNodeOrClassification,  SWT.RADIO);
-                                 checkUseSelectedClassification.setText("Export selected classification");
-                                 checkUseSelectedClassification.addListener(SWT.Selection, new Listener() {
-                              @Override
-                              public void handleEvent(Event e) {
-                                  Button b = (Button) e.widget;
-                                  GridData data = (GridData)  classificationSelectionCombo.getLayoutData();
-                                  data.exclude = b.getSelection();
-                                  classificationSelectionCombo.setEnabled(data.exclude);
-
-                                 }
-                                       });
-                       }
-
-                       if (node!= null){
-                               selectedClassification = node.getClassification();
-                       }
-                       createClassificationSelectionCombo(selectNodeOrClassification);
-                       if (outputModelExport){
-                           Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
-                           GridData gridDataSep = new GridData();
-                           gridDataSep = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
-                           gridDataSep.horizontalSpan = 2;
+            selectNodeOrClassification.setLayoutData(gridDataNode);
+            if ((cdmLightExport || dwcaExport || colDPExport || wfoBackboneExport) && !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()) {
+                if (!wfoBackboneExport) {
+                    checkUseSelectedTaxonNode = new Button(selectNodeOrClassification, SWT.RADIO);
+                }
+                String taxonStr = "";
+                int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size();
+                List<TaxonNode> selectedNodes = new ArrayList<>();
+                for (LogicFilter<TaxonNode> filter : configurator.getTaxonNodeFilter().getSubtreeFilter()) {
+                    node = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(filter.getUuid());
+                    selectedNodes.add(node);
+                    count--;
+                    if (node.hasTaxon()) {
+                        taxonStr += node.getTaxon().getName().getTitleCache();
+                        if (count > 0) {
+                            taxonStr += ", ";
+                        }
+                    }
+                }
+                if (!wfoBackboneExport) {
+                    checkUseSelectedTaxonNode.setText("Export all selected subtree(s) (" + taxonStr + ")");
+                    checkUseSelectedTaxonNode.addListener(SWT.Selection, e -> {
+                        Button b = (Button) e.widget;
+                        GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+                        data.exclude = b.getSelection();
+                        if (classificationSelectionCombo != null) {
+                            classificationSelectionCombo.setEnabled(!data.exclude);
+                        }
+                    });
+                    checkUseSelectedTaxonNode.setSelection(true);
+                }else {
+                    Composite wfoComp = new Composite(selectNodeOrClassification, SWT.NONE);
+                    grid = new GridLayout();
+                    grid.numColumns = 2;
+                    GridData gridDataWfo = new GridData(SWT.FILL, SWT.FILL, true, false);
+                    gridDataWfo.grabExcessHorizontalSpace=true;
+                   // gridDataWfo.horizontalSpan=2;
+                    wfoComp.setLayout(grid);
+                    wfoComp.setLayoutData(gridDataWfo);
+
+                    Label label = new Label(wfoComp, SWT.NONE);
+                    label.setText("Export all selected subtree(s) (" + taxonStr + ")");
+                    GridData gridData = new GridData();
+                    gridData.horizontalSpan = 3;
+                    gridData.grabExcessHorizontalSpace = true;
+                    label.setLayoutData(gridData);
+
+                    Label familyString = new Label(wfoComp, SWT.NONE);
+                    familyString.setText("Family");
+                    text_familyString = new Text(wfoComp, SWT.BORDER);
+                    text_familyString.setText(generateFamilyName(selectedNodes));
+                    GridData gridFamily = new GridData(SWT.FILL, SWT.FILL, true, false);
+
+                    text_familyString.setLayoutData(gridFamily);
+
+
+                    Label baseUrlString = new Label(wfoComp, SWT.NONE);
+                    baseUrlString.setText("Base url");
+                    text_baseUrl = new Text(wfoComp, SWT.BORDER);
+
+                    GridData gridDataBaseUrl = new GridData(SWT.FILL, SWT.FILL, true, false);
+
+                    text_baseUrl.setLayoutData(gridDataBaseUrl);
+                    text_baseUrl.setToolTipText("The base url without /cdm_dataportal/taxon/{uuid}  e.g. https://portal.cybertaxonomy.org/salvador");
+
+
+
+                }
+            }else if (wfoBackboneExport) {
+
+                Label label = new Label(composite, SWT.NONE);
+                label.setText("WFO Backbone export is only available for subtrees, not for classifications");
+                GridData gridData = new GridData();
+                gridData.horizontalSpan = 2;
+                gridData.grabExcessHorizontalSpace = true;
+                label.setLayoutData(gridData);
+                label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+            }
+
+            if (cdmLightExport || dwcaExport || colDPExport ) {
+                if (dwcaExport) {
+                    checkUseAllClassification = new Button(selectNodeOrClassification, SWT.RADIO);
+                    checkUseAllClassification.setText("Export all classifications");
+                    checkUseAllClassification.addListener(SWT.Selection, new Listener() {
+                        @Override
+                        public void handleEvent(Event e) {
+                            Button b = (Button) e.widget;
+                            GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+                            data.exclude = b.getSelection();
+                            classificationSelectionCombo.setEnabled(!data.exclude);
+
+                        }
+                    });
+                }
+                checkUseSelectedClassification = new Button(selectNodeOrClassification, SWT.RADIO);
+                checkUseSelectedClassification.setText("Export selected classification");
+                checkUseSelectedClassification.addListener(SWT.Selection, e -> {
+                    Button b = (Button) e.widget;
+                    GridData data = (GridData) classificationSelectionCombo.getLayoutData();
+                    data.exclude = b.getSelection();
+                    classificationSelectionCombo.setEnabled(data.exclude);
+                });
+            }
+
+            if (node != null && !wfoBackboneExport) {
+                selectedClassification = node.getClassification();
+            }
+            if (!wfoBackboneExport) {
+                createClassificationSelectionCombo(selectNodeOrClassification);
+            }
+            if (cdmLightExport) {
+                Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
+                GridData gridDataSep = new GridData();
+                gridDataSep = new GridData(GridData.BEGINNING, GridData.CENTER, true, true);
+                gridDataSep.horizontalSpan = 2;
                 separator.setLayoutData(gridDataSep);
 
                 Composite comp = new Composite(composite, SWT.NONE);
 
                 GridData gridData = new GridData();
-                   gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
-                   gridData.horizontalSpan = 2;
-                   comp.setLayoutData(gridData);
+                gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
+                gridData.horizontalSpan = 2;
+                comp.setLayoutData(gridData);
 
-                   Label label = new Label(comp, SWT.NONE);
+                Label label = new Label(comp, SWT.NONE);
                 label.setText("Sorting of taxa");
 
-                           orderSelectionCombo = new Combo(comp, SWT.BORDER| SWT.READ_ONLY);
+                orderSelectionCombo = new Combo(comp, SWT.BORDER | SWT.READ_ONLY);
 
-                           GridLayoutFactory.fillDefaults().applyTo(comp);
-                   for(NavigatorOrderEnum display: NavigatorOrderEnum.values()){
-                       orderSelectionCombo.add(display.getLabel());
-                   }
-
-                   int index = 0;
-                   if (PreferencesUtil.getStringValue(PreferencePredicate.TaxonNodeOrder.getKey()) != null){
-                       NavigatorOrderEnum orderInNavigator = NavigatorOrderEnum.valueOf(PreferencesUtil.getStringValue(PreferencePredicate.TaxonNodeOrder.getKey()));
+                GridLayoutFactory.fillDefaults().applyTo(comp);
+                for (NavigatorOrderEnum display : NavigatorOrderEnum.values()) {
+                    orderSelectionCombo.add(display.getLabel());
+                }
 
-                       for (String itemLabel : orderSelectionCombo.getItems()){
-                           if (itemLabel.equalsIgnoreCase(orderInNavigator.getLabel())){
-                               orderSelectionCombo.select(index);
-                               setComparatorToConfig();
-                               break;
-                           }
-                           index++;
-                       }
-                   }
+                int index = 0;
+                if (PreferencesUtil.getStringValue(PreferencePredicate.TaxonNodeOrder.getKey()) != null) {
+                    NavigatorOrderEnum orderInNavigator = NavigatorOrderEnum
+                            .valueOf(PreferencesUtil.getStringValue(PreferencePredicate.TaxonNodeOrder.getKey()));
+
+                    for (String itemLabel : orderSelectionCombo.getItems()) {
+                        if (itemLabel.equalsIgnoreCase(orderInNavigator.getLabel())) {
+                            orderSelectionCombo.select(index);
+                            setComparatorToConfig();
+                            break;
+                        }
+                        index++;
+                    }
+                }
 
-                   orderSelectionCombo.addSelectionListener(new SelectionListener() {
+                orderSelectionCombo.addSelectionListener(new SelectionListener() {
 
                     @Override
                     public void widgetSelected(SelectionEvent e) {
@@ -396,188 +465,217 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel
                         // TODO Auto-generated method stub
                     }
                 });
-                       }
-
-                       if (checkUseSelectedtaxonNode != null){
-                               if (checkUseSelectedtaxonNode.getSelection()){
-                                        classificationSelectionCombo.setEnabled(false);
-                               }
-                       }else{
-                           classificationSelectionCombo.setEnabled(true);
-                           classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
-                      true, false, 2, 1));
-                       }
-                        Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
+            }
+
+            if (classificationSelectionCombo != null) {
+                if (checkUseSelectedTaxonNode != null) {
+                    if (checkUseSelectedTaxonNode.getSelection()) {
+                        classificationSelectionCombo.setEnabled(false);
+                    }
+                } else {
+                    classificationSelectionCombo.setEnabled(true);
+                    classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+                }
+            }
+            Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
             GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
             gridData.horizontalSpan = 2;
             separator.setLayoutData(gridData);
 
-               }
-
-               Label folderLabel = new Label(composite, SWT.NONE);
-               folderLabel.setText("Select Folder for exported files");
-               folderLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
-        true, false, 2, 1));
-               folderDialog = new DirectoryDialog(parent.getShell());
-               String exportFolder = PreferencesUtil.getStringValue(EXPORT_FOLDER, true);
-               folderDialog.setFilterPath(exportFolder);
-
-               text_folder = new Text(composite, SWT.BORDER);
-               text_folder.setEditable(false);
-               text_folder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
-                               false));
-               if (exportFolder != null){
-                       text_folder.setText(exportFolder);
-                       setPageComplete(true);
-               }
-
-               Button button = new Button(composite, SWT.PUSH);
-               button.setText("Browse...");
-
-               button.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               super.widgetSelected(e);
-
-                               String path = folderDialog.open();
-                               if (path != null) { // a folder was selected
-                                       text_folder.setText(path);
-                                       PreferencesUtil.setStringValue(EXPORT_FOLDER, path);
-                                       setPageComplete(true);
-                               }
-                       }
-               });
-               if (!outputModelExport){
-
-                        Label fileLabel = new Label(composite, SWT.NONE);
-                       fileLabel.setText("File");
-                       text_exportFileName = new Text(composite, SWT.BORDER);
-                       text_exportFileName.setText(generateFilename());
-                       text_exportFileName.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
-                                       true, false));
-               }
-
-               // make the composite the wizard pages control
-               setControl(composite);
-       }
+        }
+
+        Label folderLabel = new Label(composite, SWT.NONE);
+        folderLabel.setText("Select Folder for exported files");
+        folderLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+        folderDialog = new DirectoryDialog(parent.getShell());
+        String exportFolder = PreferencesUtil.getStringValue(EXPORT_FOLDER, true);
+        folderDialog.setFilterPath(exportFolder);
+
+        text_folder = new Text(composite, SWT.BORDER);
+        text_folder.setEditable(false);
+        text_folder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+        if (exportFolder != null) {
+            text_folder.setText(exportFolder);
+            setPageComplete(true);
+        }
+
+        Button button = new Button(composite, SWT.PUSH);
+        button.setText("Browse...");
+
+        button.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                super.widgetSelected(e);
+
+                String path = folderDialog.open();
+                if (path != null) { // a folder was selected
+                    text_folder.setText(path);
+                    PreferencesUtil.setStringValue(EXPORT_FOLDER, path);
+                    setPageComplete(true);
+                }
+            }
+        });
+        if (!cdmLightExport && !wfoBackboneExport) {
+
+            Label fileLabel = new Label(composite, SWT.NONE);
+            fileLabel.setText("Filename");
+            text_exportFileName = new Text(composite, SWT.BORDER);
+            text_exportFileName.setText(generateFilename());
+            text_exportFileName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+        }
+
+        // make the composite the wizard pages control
+        setControl(composite);
+    }
+
+    /**
+     * @return
+     */
+    private String generateFamilyName(List<TaxonNode> nodes) {
+        if (nodes.size() == 1){
+            TaxonNode node = nodes.get(0);
+            if (node.getTaxon() != null) {
+                if(node.getTaxon().getName().getRank().getOrderIndex() >= Rank.FAMILY().getOrderIndex()) {
+                    TaxonNode familyNode = node.getAncestorOfRank(Rank.FAMILY());
+                    if (familyNode != null && familyNode.getTaxon() != null) {
+                        return familyNode.getTaxon().getName().getNameCache();
+                    }
+
+                }
+            }
+
+        }
+        return "";
+    }
 
     protected void setComparatorToConfig() {
-        if (orderSelectionCombo.getText().equals(NavigatorOrderEnum.NaturalOrder.getLabel())){
-            ((CdmLightExportConfigurator)configurator).setComparator(new TaxonNodeDtoNaturalComparator());
-        } else if (orderSelectionCombo.getText().equals(NavigatorOrderEnum.AlphabeticalOrder.getLabel())){
-            ((CdmLightExportConfigurator)configurator).setComparator(new TaxonNodeDtoByNameComparator());
-        }else {
-            ((CdmLightExportConfigurator)configurator).setComparator(new TaxonNodeDtoByRankAndNameComparator());
+        if (orderSelectionCombo.getText().equals(NavigatorOrderEnum.NaturalOrder.getLabel())) {
+            ((CdmLightExportConfigurator) configurator).setTaxonNodeComparator(new TaxonNodeDtoNaturalComparator());
+        } else if (orderSelectionCombo.getText().equals(NavigatorOrderEnum.AlphabeticalOrder.getLabel())) {
+            ((CdmLightExportConfigurator) configurator).setTaxonNodeComparator(new TaxonNodeDtoByNameComparator());
+        } else {
+            ((CdmLightExportConfigurator) configurator)
+                    .setTaxonNodeComparator(new TaxonNodeDtoByRankAndNameComparator());
+        }
+    }
+
+    protected String generateFilename() {
+        StringBuffer buffer = new StringBuffer();
+
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
+        buffer.append(sdf.format(cal.getTime()));
+
+        buffer.append("-");
+        buffer.append(type + "_");
+
+        String source = ((ICdmRemoteSource) CdmStore.getActiveCdmSource()).toString();
+        source = source.substring(source.indexOf("/") + 1);
+        buffer.append(source);
+
+        buffer.append(".");
+        buffer.append(extension);
+
+        return buffer.toString();
+    }
+
+    public String getExportFileName() {
+        return text_exportFileName.getText();
+    }
+
+    public String getFamilyString() {
+        return text_familyString.getText();
+    }
+
+    public String getFolderText() {
+        return text_folder.getText();
+    }
+
+    public String get_baseUrl() {
+        return text_baseUrl.getText();
+    }
+
+    public Text getFolderComposite() {
+        return text_folder;
+    }
+
+    public boolean isExportUnpublishedData() {
+        return checkExportUnpublished.getSelection();
+    }
+
+    public boolean isExportFactualData() {
+        return checkExportFactualData.getSelection();
+    }
+
+    public boolean isExportUnpublishedFactualData() {
+        return checkExportUnpublishedFactualData.getSelection();
+    }
+
+    private void createClassificationSelectionCombo(Composite parent) {
+
+        GridData gridData = new GridData();
+        gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
+        gridData.horizontalIndent = 5;
+
+        classificationSelectionCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+        classificationSelectionCombo.setLayoutData(gridData);
+        for (Classification tree : classifications) {
+            classificationSelectionCombo.add(tree.getTitleCache(), classifications.indexOf(tree));
+        }
+
+        classificationSelectionCombo.select(classifications.indexOf(selectedClassification));
+
+        // TODO remember last selection
+        classificationSelectionCombo.addSelectionListener(this);
+
+    }
+
+    public Combo getCombo() {
+        return classificationSelectionCombo;
+    }
+
+    @Override
+    public void widgetSelected(SelectionEvent e) {
+        selectedClassification = classifications.get(classificationSelectionCombo.getSelectionIndex());
+    }
+
+    public Classification getSelectedClassification() {
+        return selectedClassification;
+    }
+
+    @Override
+    public void widgetDefaultSelected(SelectionEvent e) {
+        // not needed here
+    }
+
+    public UUID getSelectedClassificationUUID() {
+        return selectedClassification.getUuid();
+    }
+
+    public boolean getCheckUseSelectedTaxonNode() {
+        if (checkUseSelectedTaxonNode == null) {
+            return false;
+        }
+        return checkUseSelectedTaxonNode.getSelection();
+    }
+
+    public boolean getCheckUseAllClassifications() {
+        if (checkUseAllClassification == null) {
+            return false;
+        }
+        return checkUseAllClassification.getSelection();
+    }
+
+    public Set<UUID> getAllClassificationUuids() {
+        Set<UUID> allClassificationUuids = new HashSet<>();
+        for (Classification classification : this.classifications) {
+            allClassificationUuids.add(classification.getUuid());
         }
+        return allClassificationUuids;
     }
 
-       protected String generateFilename() {
-               StringBuffer buffer = new StringBuffer();
-
-               Calendar cal = Calendar.getInstance();
-               SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
-               buffer.append(sdf.format(cal.getTime()));
-
-               buffer.append("-");
-               buffer.append(type +"_");
-
-               String source = ((ICdmRemoteSource)CdmStore.getActiveCdmSource()).toString();
-               source = source.substring(source.indexOf("/")+1);
-               buffer.append(source);
-
-               buffer.append(".");
-               buffer.append(extension);
-
-               return buffer.toString();
-       }
-
-       public String getExportFileName() {
-               return text_exportFileName.getText();
-       }
-
-       public String getFolderText() {
-               return text_folder.getText();
-       }
-
-       public Text getFolderComposite() {
-               return text_folder;
-       }
-
-       public boolean isExportUnpublishedData(){
-           return checkExportUnpublished.getSelection();
-       }
-
-       private void createClassificationSelectionCombo(Composite parent){
-
-//             Composite classificationSelection = new Composite(parent, SWT.NULL);
-//             classificationSelection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
-
-//             GridLayout layout = new GridLayout();
-//             classificationSelection.setLayout(layout);
-               GridData gridData = new GridData();
-               gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
-               gridData.horizontalIndent = 5;
-//             classificationSelection.setLayoutData(gridData);
-
-               classificationSelectionCombo = new Combo(parent, SWT.BORDER| SWT.READ_ONLY);
-               classificationSelectionCombo.setLayoutData(gridData);
-               for(Classification tree : classifications){
-                       classificationSelectionCombo.add(tree.getTitleCache(), classifications.indexOf(tree));
-               }
-
-               classificationSelectionCombo.select(classifications.indexOf(selectedClassification));
-
-               // TODO remember last selection
-               classificationSelectionCombo.addSelectionListener(this);
-
-               //return classificationSelection;
-       }
-
-       public Combo getCombo(){
-           return classificationSelectionCombo;
-       }
-
-       @Override
-       public void widgetSelected(SelectionEvent e) {
-               selectedClassification = classifications.get(classificationSelectionCombo.getSelectionIndex());
-       }
-
-       public Classification getSelectedClassification(){
-           return selectedClassification;
-       }
-
-       @Override
-       public void widgetDefaultSelected(SelectionEvent e) {
-               //not needed here
-       }
-
-       public UUID getSelectedClassificationUUID() {
-               return selectedClassification.getUuid();
-       }
-
-       public boolean getCheckUseSelectedTaxonNode() {
-               if (checkUseSelectedtaxonNode== null){
-                       return false;
-               }
-               return checkUseSelectedtaxonNode.getSelection();
-       }
-       public boolean getCheckUseAllClassifications() {
-               if (checkUseAllClassification== null){
-                       return false;
-               }
-               return checkUseAllClassification.getSelection();
-       }
-
-       public Set<UUID> getAllClassificationUuids(){
-               Set<UUID> allClassificationUuids = new HashSet<>();
-               for (Classification classification: this.classifications){
-                       allClassificationUuids.add(classification.getUuid());
-               }
-               return allClassificationUuids;
-       }
-
-       @Override
-       public boolean canFlipToNextPage() {
-        return getFolderText() != null;
+    @Override
+    public boolean canFlipToNextPage() {
+        return getFolderText() != null && !(wfoBackboneExport && configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty());
     }
 }
index 41d3e8083456329845a6bfc324fb3815e84124c4..54a1a2dd64db55493ce8e5c712a6b21e9c5bf2e8 100644 (file)
@@ -32,7 +32,7 @@ public class Messages extends NLS {
 
     public static String LanguageRepresentationPreferencePage_global;
     public static String LanguageRepresentationPreferencePage_enable;
-
+    public static String LanguageRepresentationPreferencePage_not_available;
     public static String ListComponent_ADD_PROVIDER;
     public static String ListComponent_NO_PROVIDER_AVAILABLE;
     public static String ListComponent_REMOVE_PROVIDER;
@@ -136,6 +136,10 @@ public class Messages extends NLS {
     public static String DefinedTermDropAdapterE4_MOVE_FAILED;
     public static String DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE;
     public static String DefinedTermDropAdapterE4_MOVE_FAILED_SAVE_MESSAGE;
+    public static String DefinedTermDropAdapterE4_MOVE_FAILED_STANDARD_TERM;
+    public static String DefinedTermDropAdapterE4_MOVE_FAILED_TO_STANDARD_VOC;
+    public static String DefinedTermDropAdapterE4_MOVE_FAILED_TO_MANAGED_VOC;
+    public static String DefinedTermDropAdapterE4_MOVE_FAILED_MANAGED_TERM;
 
     public static String DebugPreferences_0;
     public static String DebugPreferences_1;
@@ -161,6 +165,7 @@ public class Messages extends NLS {
     public static String EditPasswordElement_USERNAME_DOES_NOT_EXIST;
 
     public static String EmptySection_NO_VIEW_IMPLEMENTED;
+    public static String More_than_one_distribution;
 
     public static String PasswordWizard_COULD_NOT_CHANGE_PWD;
     public static String PasswordWizard_OLD_PWD_INCORRECT;
@@ -380,6 +385,7 @@ public class Messages extends NLS {
     public static String NameDetailsViewComposite_Show_AtomisedEpithets;
     public static String NameDetailsViewComposite_Show_AuthorCache;
     public static String NameDetailsViewComposite_Show_Author;
+    public static String NameDetailsViewComposite_Show_In_Author;
     public static String NameDetailsViewComposite_Show_NomenclaturalReference;
     public static String NameDetailsViewComposite_Show_NomenclaturalStatus;
     public static String NameDetailsViewComposite_Show_Protologue;
@@ -553,6 +559,10 @@ public class Messages extends NLS {
     public static String TypeDesignationSection_NO_TYPES_YET;
     public static String TypeDesignationSection_TYPE_DESIGNATIONS;
 
+    public static String TaxonNodeSelectionDialog_0;
+
+    public static String TaxonNodeSelectionDialog_1;
+
     public static String TaxonNodeWizardPage_edit;
     public static String TaxonNodeWizardPage_new;
     public static String TaxonNodeWizardPage_no_classification;
@@ -656,7 +666,7 @@ public class Messages extends NLS {
 
     public static String TaxonPreference_local_not_allowed;
     public static String TaxonPreference_description;
-    
+
     public static String TermOrder_idInVoc;
     public static String TermOrder_Title;
     public static String TermOrder_natural;
@@ -681,6 +691,8 @@ public class Messages extends NLS {
 
     public static String FactualData_showModifier;
     public static String FactualData_showModifier_FreeText;
+    public static String FactualData_showSpecimenAsSource;
+
     public static String FactualData_description;
     public static String FactualData_showIdInVocabulary;
     public static String FactualData_showIdInVocabulary_tooltip;
@@ -740,6 +752,11 @@ public class Messages extends NLS {
     public static String SecundumPreference_description;
     public static String SecundumPreferenceSwap_description;
 
+    public static String MediaMetadataPreferenceDescription;
+    public static String Show;
+    public static String OriginalLabel;
+    public static String DisplayedLabel;
+
     public static String Tree;
 
     public static String Computed_factualData_handling_description;
index 749cd3623afd52b633c3f684236e27d4d1eef1fb..e10b086837a651e8175d061cb94578ab68086ed2 100644 (file)
@@ -18,6 +18,7 @@ LanguageMenuPreferences_warning=\ - Warning: no description - not shown in menus
 CommonNameLanguageMenuPreferences_configure=Choose available languages for common names
 LanguageRepresentationPreferencePage_global=Choose the global language that will be used throughout the editor to get representations in
 LanguageRepresentationPreferencePage_enable=Enable Multiple Language Editing Capability
+LanguageRepresentationPreferencePage_not_available=Changing the term language is not possible in local preferences. \nIf you want to change the preference, please contact an administrator.
 ListComponent_ADD_PROVIDER=Add Provider
 ListComponent_NO_PROVIDER_AVAILABLE=No Providers available
 ListComponent_REMOVE_PROVIDER=Remove Provider
@@ -155,6 +156,7 @@ RemotingLoginDialog_MISSING_PERMISSION=Your credentials are valid but you are no
 EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Please create or save user '%s' before changing password
 EditPasswordElement_USERNAME_DOES_NOT_EXIST=Username does not exist
 EmptySection_NO_VIEW_IMPLEMENTED=Unknown element. Details can not be shown.
+More_than_one_distribution=More than one distributions exist for this area. Please edit it in the taxon editor.
 PasswordWizard_COULD_NOT_CHANGE_PWD=Could not change password
 PasswordWizard_OLD_PWD_INCORRECT=The old password is not correct.
 PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Problem with changing password
@@ -179,6 +181,11 @@ DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE=Cannot move term onto itself or its
 DefinedTermDropAdapterE4_MOVE_FAILED_SAVE_MESSAGE=Moving the term failed. Try saving before.
 DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE=The term type of the dropped term does not match the target term type.
 DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE=Term types do not match
+DefinedTermDropAdapterE4_MOVE_FAILED_STANDARD_TERM=Standard terms are not allowed to be moved
+DefinedTermDropAdapterE4_MOVE_FAILED_TO_STANDARD_VOC=Terms are not allowed to be moved to standard vocabularies
+DefinedTermDropAdapterE4_MOVE_FAILED_MANAGED_TERM=Managed terms are not allowed to move
+DefinedTermDropAdapterE4_MOVE_FAILED_TO_MANAGED_VOC=Terms are not allowed to be moved to managed vocabularies
+
 
 DebugPreferences_0=Show up widget is disposed error messages
 DebugPreferences_1=Disable services api timestamp check
@@ -275,6 +282,8 @@ ImportFromFileAndChooseVocIdWizardPage_AreaVoc=Area Vocabulary
 ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip=Please choose a vocabulary for the used areas.
 ExcelDistributionUpdateWizard_ConfiguratorWizard_label=Configure Excel distribution update
 AbstractImportWizard_ConfigurationLabel=Configure the Import
+TaxonNodeSelectionDialog_0=Create new factual data set (otherwise add to default description, if exists)
+TaxonNodeSelectionDialog_1=Select Classification
 TaxonNodeWizardPage_edit=Edit Taxon Node
 TaxonNodeWizardPage_new=New Taxon
 TaxonNodeWizardPage_no_classification=No classification set.
@@ -337,6 +346,7 @@ NameDetailsViewComposite_Show_Rank=Rank of the name
 NameDetailsViewComposite_Show_AtomisedEpithets=Atomised epithets
 NameDetailsViewComposite_Show_AuthorCache=Authorship cache
 NameDetailsViewComposite_Show_Author=Whole authorship section
+NameDetailsViewComposite_Show_In_Author=In-authors
 NameDetailsViewComposite_Show_NomenclaturalReference=Nomenclatural reference section
 NameDetailsViewComposite_Show_NomenclaturalStatus=Nomenclatural status section
 NameDetailsViewComposite_Show_Protologue=Protologue section
@@ -454,8 +464,8 @@ ChecklistEditorGeneralPreference_show_symbol2=Symbol 2
 ChecklistEditorGeneralPreference_show_title=Lable
 ChecklistEditorGeneralPreference_show_symbol=Show symbol of the status, if existing
 ChecklistEditorGeneralPreference_STATUS_DISPLAY_TEXT=Configure how the status should be displayed
-ChecklistEditorGeneralPreference_own_Description=Create own fact dataset for distributions created by the Distribution Editor
-ChecklistEditorGeneralPreference_own_DescriptionToolTip=Entries created with the Distribution Editor, saved in an own Taxon Description
+ChecklistEditorGeneralPreference_own_Description=Add to default factual data set
+ChecklistEditorGeneralPreference_own_DescriptionToolTip=Entries created with the Distribution Editor, always added to the default factual data set. If no default set exists, a new one is created.
 GeneralPreference_override=Override
 ChecklistEditorGeneralPreference_Configure_display_of_Areas=Display of areas in the header
 ChecklistEditorGeneralPreference_Configure_display_of_Status=Display of distribution status in the table
@@ -575,6 +585,7 @@ Delete=Delete
 Preference_update=Update
 FactualData_showModifier=Show modifier
 FactualData_showModifier_FreeText=Show modifier freetext
+FactualData_showSpecimenAsSource=Show specimen as source
 FactualData_description=If a preference is not selectable, there is a serverside preference not allowed to override.
 FactualData_showIdInVocabulary=Show id in vocabulary in area text field
 FactualData_showIdInVocabulary_tooltip=Show id in vocabulary in area text field of details view
@@ -632,4 +643,8 @@ Computed_factualData_handling_description=This preference defines whether comput
 FactualData_EnableComputedFactualData=Handling of computed factual data
 
 TextWithAddNull_ToolTip_null=Remove the value
-TextWithAddNull_ToolTip_NotNull=No value, to add a new value, uncheck the checkbox
\ No newline at end of file
+TextWithAddNull_ToolTip_NotNull=No value, to add a new value, uncheck the checkbox
+MediaMetadataPreferenceDescription=Define metadata shown in the universal viewer in the dataportal.\nAlternative attribute labels can be added in the right column.
+Show=Show
+OriginalLabel=Original label in metadata
+DisplayedLabel=Displayed label
\ No newline at end of file
index 053879606c6badaadecadbcf20fd4ef1212e3fd4..678bad28a69cf6342a60d192a21467fdfeec26b8 100644 (file)
@@ -18,6 +18,7 @@ LanguageMenuPreferences_warning=\ - Warnung: keine Beschreibung - wird nicht in
 CommonNameLanguageMenuPreferences_configure=Auswahl der für Trivialnamen zur Verf\u00FCgung stehenden Sprachen
 LanguageRepresentationPreferencePage_global=Wählen Sie die Sprache, für die im gesamten Editor die Repräsentationen ausgewählt werden soll (sofern vorhanden).
 LanguageRepresentationPreferencePage_enable=Aktiviere mehrsprachige Editierbarkeit
+LanguageRepresentationPreferencePage_not_available=Es dürfen keine lokalen Ã„nderungen an der Term Sprache vorgenommen werden.\nWenn Sie die Präferenz dennoch Ã¤ndern wollen, wenden Sie sich bitte an einen Administrator.
 ListComponent_ADD_PROVIDER=Provider hinzufügen
 ListComponent_NO_PROVIDER_AVAILABLE=Keine Provider verfügbar
 ListComponent_REMOVE_PROVIDER=Provider entfernen
@@ -154,6 +155,7 @@ RemotingLoginDialog_MISSING_PERMISSION="Die Anmeldedaten sind korrekt, aber Sie
 EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER=Bitte erstellen oder speichern sie den Nutzer '%s', bevor Sie das Kennwort Ã¤ndern
 EditPasswordElement_USERNAME_DOES_NOT_EXIST=Nutzername existiert nicht
 EmptySection_NO_VIEW_IMPLEMENTED=Unbekanntes Objekt. Details können nicht angezeigt werden.
+More_than_one_distribution=Es existieren mehr als eine Verbreitung für dieses Areal. Bitte bearbeiten Sie die Verbreitung im Taxon Editor.
 PasswordWizard_COULD_NOT_CHANGE_PWD=Konnte das Kennwort nicht Ã¤ndern
 PasswordWizard_OLD_PWD_INCORRECT=Das alte Kennwort ist inkorrekt
 PasswordWizard_PROBLEM_WITH_CHANGING_PWD=Fehler beim Ã„ndern des Kennworts
@@ -178,6 +180,11 @@ DefinedTermDropAdapterE4_MOVE_FAILED_MESSAGE=Terme k
 DefinedTermDropAdapterE4_MOVE_FAILED_SAVE_MESSAGE=Das Verschieben des Terms ist fehlgeschlagen. Versuchen Sie vorher zu speichern.
 DefinedTermDropAdapterE4_TERM_TYPE_ERROR_MESSAGE=Der Termtyp des verschobenen Terms stimmt nicht mit dem des Ziels Ã¼berein.
 DefinedTermDropAdapterE4_TERM_TYPE_ERROR_TITLE=Termtypen stimmen nicht Ã¼berein
+DefinedTermDropAdapterE4_MOVE_FAILED_STANDARD_TERM=Standard Terme können nicht verschoben werden
+DefinedTermDropAdapterE4_MOVE_FAILED_TO_STANDARD_VOC=Terme dürfen nich in Standard Vokabulare verschoben werden
+DefinedTermDropAdapterE4_MOVE_FAILED_MANAGED_TERM=Externe Terme können nicht verschoben werden
+DefinedTermDropAdapterE4_MOVE_FAILED_TO_MANAGED_VOC=Terme dürfen nich in Externe Vokabulare verschoben werden
+
 
 DebugPreferences_0=\"Widget is disposed\" Fehler Meldungen anzeigen
 DebugPreferences_1=Deaktiviere die Ãœberprüfung des API Timestamp
@@ -274,6 +281,8 @@ ImportFromFileAndChooseVocIdWizardPage_AreaVoc=Gebiets Vokabular
 ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip=Bitte wählen Sie ein Vokabular für die genutzten Areas aus.
 ExcelDistributionUpdateWizard_ConfiguratorWizard_label=Konfiguration des Excel Distribution Updates
 AbstractImportWizard_ConfigurationLabel=Konfiguration des Imports
+TaxonNodeSelectionDialog_0=Erzeuge neues Faktendaten Set (sonst füge es dem default Set hinzu)
+TaxonNodeSelectionDialog_1=Wähle Klassifikation
 TaxonNodeWizardPage_edit=Bearbeite Taxon Knoten
 TaxonNodeWizardPage_new=Neues Taxon
 TaxonNodeWizardPage_no_classification=Keine Klassifikation ausgewählt
@@ -337,6 +346,7 @@ NameDetailsViewComposite_Show_Rank=Rang
 NameDetailsViewComposite_Show_AtomisedEpithets=Atomisierte Epithete
 NameDetailsViewComposite_Show_AuthorCache=Autoren Cache
 NameDetailsViewComposite_Show_Author=Alle Autoreninformationen
+NameDetailsViewComposite_Show_In_Author=In-Autoren
 NameDetailsViewComposite_Show_NomenclaturalReference=Nomenklatorische Referenz
 NameDetailsViewComposite_Show_NomenclaturalStatus=Nomenklatorischer Status
 NameDetailsViewComposite_Show_Protologue=Protologue
@@ -454,8 +464,8 @@ ChecklistEditorGeneralPreference_show_symbol2=Symbol 2
 ChecklistEditorGeneralPreference_show_title=Label
 ChecklistEditorGeneralPreference_show_symbol=Symbol des Status anzeigen, wenn es existiert
 ChecklistEditorGeneralPreference_STATUS_DISPLAY_TEXT=Einstellung für die Anzeige des Status
-ChecklistEditorGeneralPreference_own_Description=Erstelle eigenes Fakten-Datenset für Verbreitungs-Editor Daten
-ChecklistEditorGeneralPreference_own_DescriptionToolTip=Einträge, die mit dem Distribution Editor erstellt werden, \nwerden in einer eigenen TaxonDescription gespeichert
+ChecklistEditorGeneralPreference_own_Description=Nutze die default Beschreibung
+ChecklistEditorGeneralPreference_own_DescriptionToolTip=Einträge, die mit dem Distribution Editor erstellt werden, \nwerden immer im default Taxon Fakten Set gespeichert, wenn noch kein default Set besteht, wird ein neues erstellt.
 GeneralPreference_override=Ãœberschreiben
 ChecklistEditorGeneralPreference_Configure_display_of_Areas=Darstellung der Areale in der Kopfzeile
 ChecklistEditorGeneralPreference_Configure_display_of_Status=Darstellung der Verbreitung-Status in Tabelle
@@ -572,6 +582,7 @@ Delete=L
 Preference_update=Aktualisieren
 FactualData_showModifier=Zeige Modifier
 FactualData_showModifier_FreeText=Zeige Freitext-Modifier
+FactualData_showSpecimenAsSource=Zeige Specimen als Quelle
 FactualData_description=Wenn die Präferenz nicht ausgewählt werden kann, dann gibt es eine serverseitige Präferenz, die das Ãœberschreiben nicht erlaubt.
 FactualData_showIdInVocabulary=Zeige Id im Vokabular im Areal-Textfeld
 FactualData_showIdInVocabulary_tooltip=Zeige die Id im Vokabular im Areal-Textfeld des Details View
@@ -630,4 +641,8 @@ Computed_factualData_handling_description=Diese Einstellung gibt an, ob berechne
 FactualData_EnableComputedFactualData=Umgang mit berechneten Faktendaten
 
 TextWithAddNull_ToolTip_null=Entferne den Wert aus dem Feld
-TextWithAddNull_ToolTip_NotNull=Kein Wert, um einen Wert einzufügen, bitte das Häkchen entfernen
\ No newline at end of file
+TextWithAddNull_ToolTip_NotNull=Kein Wert, um einen Wert einzufügen, bitte das Häkchen entfernen
+MediaMetadataPreferenceDescription=Definiere Metadaten, die im Universalviewer im Datenportal angezeigt werden sollen. \nIn der rechten Spalte können alternative Attributname eingetragen werden. \nMit den Buttons können weitere Attribute zugefügt oder entfernt werden.
+Show=Anzeigen
+OriginalLabel=Ursprüngliches Label in den Metadaten
+DisplayedLabel=Angezeigtes Label
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractDataChangeBehaviour.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractDataChangeBehaviour.java
deleted file mode 100644 (file)
index 0e28349..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.model;
-
-import java.util.Vector;
-
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-
-/**
- * Reactions on specific EventyTypes are overridden here for convenience.
- *
- * @author n.hoffmann
- * @created 09.04.2009
- * @version 1.0
- */
-public abstract class AbstractDataChangeBehaviour implements IDataChangeBehavior {
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.model.IDataChangeBehavior#reactOnDataChange(java.lang.Object, java.util.List)
-        */
-       /** {@inheritDoc} */
-       public abstract void reactOnDataChange(CdmDataChangeMap events);
-
-       /**
-        * {@inheritDoc}
-        *
-        * Implementors should overwrite this method if needed
-        * @see eu.etaxonomy.taxeditor.model.IDataChangeBehavior#reactOnDelete(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent)
-        */
-       public void reactOnDelete(Vector<CdmDataChangeEvent> event) {}
-
-       /**
-        * {@inheritDoc}
-        *
-        * Implementors should overwrite this method if needed
-        * @see eu.etaxonomy.taxeditor.model.IDataChangeBehavior#reactOnInsert(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent)
-        */
-       public void reactOnInsert(Vector<CdmDataChangeEvent> event) {}
-
-       /**
-        * {@inheritDoc}
-        *
-        * Implementors should overwrite this method if needed
-        * @see eu.etaxonomy.taxeditor.model.IDataChangeBehavior#reactOnUpdate(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent)
-        */
-       public void reactOnUpdate(Vector<CdmDataChangeEvent> event) {}
-}
index e85ea17a02061f2070c12982cb021735236ab8a7..56acc988fc19cb225e441b7da54324160a1f58e7 100644 (file)
@@ -28,7 +28,8 @@ import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.AbstractOperation;
 import org.eclipse.core.commands.operations.IOperationHistory;
@@ -804,14 +805,20 @@ public abstract class AbstractUtility {
                          Calendar cal = Calendar.getInstance();
                          String fileEnding = ".csv";
 
-                         if (createZip){
+                         if (createZip || urlString.endsWith("zip")){
 //                             File file = new File(urlString+File.separator +  sdf.format(cal.getTime())+ ".zip");
-                             File file = new File(urlString+ ".zip");
+                             if (!urlString.endsWith("zip")) {
+                                 urlString += ".zip";
+                             }
+                             File file = new File(urlString);
                              FileOutputStream stream = new FileOutputStream(file);
                              ZipOutputStream zos = new ZipOutputStream(stream);
                              for (String key: keySet){
                                 byte[] fileData = resultMap.get(key);
-                                ZipEntry entry = new ZipEntry( key + fileEnding);
+                                if (!(key.endsWith("txt") || key.endsWith("xml"))) {
+                                    key += fileEnding;
+                                }
+                                ZipEntry entry = new ZipEntry(key);
                                 zos.putNextEntry(entry);
                                 zos.write(fileData);
                                 zos.closeEntry();
@@ -848,6 +855,7 @@ public abstract class AbstractUtility {
                      }
                  } catch(Exception e){
                      logger.error(e.getStackTrace());
+                     e.printStackTrace();
                  }
             }
         }
index a9817cb3239ca374b1fb42324ea0e18de689982e..8336475651e9f40291a334ba4d78d35d164c80c4 100644 (file)
@@ -20,10 +20,10 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  * @author n.hoffmann
  * @date Jan 18, 2012
- *
  */
 public class DefaultTermComparator<T extends DefinedTermBase> implements Comparator<T> {
-       @Override
+
+    @Override
        public int compare(T o1, T o2) {
                if (o1 == o2){
                        return 0;
@@ -42,4 +42,4 @@ public class DefaultTermComparator<T extends DefinedTermBase> implements Compara
                }
                return result;
        }
-};
+}
\ No newline at end of file
index 5d57510df83a326e5b26be91397a7d6bd0e9d242..a6a07de2ef32106a02b8caff9338b014b5cdc5a5 100644 (file)
@@ -13,9 +13,9 @@ import java.util.List;
 
 import org.apache.commons.lang3.StringUtils;
 
-import eu.etaxonomy.cdm.format.DescriptionElementFormatter;
 import eu.etaxonomy.cdm.format.common.ExtendedTimePeriodFormatter;
 import eu.etaxonomy.cdm.format.description.CategoricalDataFormatter;
+import eu.etaxonomy.cdm.format.description.DescriptionElementFormatter;
 import eu.etaxonomy.cdm.format.description.QuantitativeDataFormatter;
 import eu.etaxonomy.cdm.model.common.ExtendedTimePeriod;
 import eu.etaxonomy.cdm.model.common.Language;
@@ -37,6 +37,7 @@ import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -115,7 +116,7 @@ public class DescriptionHelper {
         */
        public static void setCache(DescriptionElementBase element,
                        String value) {
-               setCache(element, value, CdmStore.getDefaultLanguage());
+               setCache(element, value, PreferencesUtil.getGlobalLanguage());
        }
 
 //     public static String getObjectClassname(Object element) {
@@ -129,9 +130,8 @@ public class DescriptionHelper {
        public static String getFeatureNodeContainerText(FeatureNodeContainer element) {
                String result = null;
                if(element.getFeatureNode() != null && element.getFeatureNode().getTerm() != null){
-                       
-                       result = element.getFeatureNode().getTerm().getPreferredRepresentation(CdmStore.getDefaultLanguage()).getLabel();
-                       
+
+                       result = element.getFeatureNode().getTerm().getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel();
                } else{
                        return "No label set";
                }
@@ -153,7 +153,7 @@ public class DescriptionHelper {
        }
 
        private static List<Language> getLanguageList(){
-               return Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
+               return Arrays.asList(new Language[]{PreferencesUtil.getGlobalLanguage()});
        }
 
        public static String getDistributionText(Distribution element) {
@@ -165,12 +165,12 @@ public class DescriptionHelper {
                NamedArea area = distribution.getArea();
                if(area != null){
 
-                       text = NamedArea.labelWithLevel(area, CdmStore.getDefaultLanguage());
+                       text = NamedArea.labelWithLevel(area, PreferencesUtil.getGlobalLanguage());
 
                        PresenceAbsenceTerm status = distribution.getStatus();
 
                        if (status != null) {
-                               text += ", " + status.getPreferredRepresentation(CdmStore.getDefaultLanguage()).getLabel();
+                               text += ", " + status.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel();
                        }else{
                                text += ", NO STATUS";
                        }
@@ -179,7 +179,7 @@ public class DescriptionHelper {
        }
 
        public static  String getImageText(Media media) {
-                LanguageString title = media.getTitle(CdmStore.getDefaultLanguage());
+                LanguageString title = media.getTitle(PreferencesUtil.getGlobalLanguage());
                if (title != null) {
                        return title.getText();
                }
@@ -202,7 +202,7 @@ public class DescriptionHelper {
                                text = "No sources provided";
                        }
                }else{
-                       List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
+                       List<Language> languages = Arrays.asList(new Language[]{PreferencesUtil.getGlobalLanguage()});
                        LanguageString languageString = element.getPreferredLanguageString(languages);
                        text = languageString != null ? languageString.getText() : null;
                }
@@ -226,15 +226,18 @@ public class DescriptionHelper {
                if (name == null || name.length() == 0) {
                        name = "No name provided";
                }
+               if (commonName.getTransliteration()!= null && !StringUtils.isBlank(commonName.getTransliteration())) {
+                   name += "/" +commonName.getTransliteration() + " ";
+               }
                Language language = commonName.getLanguage();
                NamedArea area = commonName.getArea();
                String areaLabel = null;
                String languageLabel = null;
                if (area != null){
-                       areaLabel = area.getPreferredRepresentation(CdmStore.getDefaultLanguage()).getLabel();                  
-               } 
-               if (language != null){                  
-                       languageLabel = language.getPreferredRepresentation(CdmStore.getDefaultLanguage()).getLabel();
+                       areaLabel = area.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel();
+               }
+               if (language != null){
+                       languageLabel = language.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage()).getLabel();
                }
                if (areaLabel != null || languageLabel != null){
                        name += " (" ;
@@ -249,8 +252,8 @@ public class DescriptionHelper {
                        }
                        name +=  ")";
                }
-               
-               
+
+
                return name;
        }
 
@@ -259,7 +262,7 @@ public class DescriptionHelper {
                if (text == null || text.length() == 0) {
                        text = "No label provided";
                }
-
+               
                return text;
        }
 
index 98785ed13436098231f35e9da2d0377e65b67554..102b4651183342cc5eba2fd2feef95ec82dc84ed 100644 (file)
@@ -31,7 +31,7 @@ import eu.etaxonomy.cdm.model.term.TermTree;
 public class FeatureNodeContainerTree {
 
        /** Constant <code>comparator</code> */
-       // TODO we will do this with a ViewerSorter
+       // TODO we will do this with a ViewerComparator
        public static Comparator<DescriptionElementBase> comparator = new Comparator<DescriptionElementBase>() {
 
                @Override
index 5a742448168e443ce5e9817ae460d6095216a2b3..ee97480d84b8d27aa8c76ff7ac02e5ade807894f 100644 (file)
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.model;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 
@@ -18,7 +18,6 @@ import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
  *
  * @author pplitzner
  * @date Dec 3, 2014
- *
  */
 public interface IDerivedUnitFacadePart {
 
index 5cc3c37c783bae459910afdb29c8c9b307737c70..74a81ac4d98c8d1c6e94fb88072c77764210447f 100644 (file)
@@ -6,17 +6,14 @@
 * 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.model;
 
-
 /**
  * Interface for handling the current "dirty" state of an object. An object is
  * dirty when changes are done but not saved/persisted yet.
- * 
+ *
  * @author n.hoffmann
  * @created Mar 8, 2010
- * @version 1.0
  */
 public interface IDirtyMarkable {
 
index 4decc4f65caf4f4cf7e491364b5b77f9e2bbe98e..fd3cfc9fc9c91a60a4e152f0cd07cb7d16e8dff8 100644 (file)
@@ -193,6 +193,8 @@ public class ImageResources {
     public static final String FUNNEL_ICON = "FUNNEL_ICON";
     public static final String FUNNEL_ICON_EXCLAMATION = "FUNNEL_ICON_EXCLAMATION";
 
+    public static final String PROHIBITED = "prohibited";
+
 
 
        /***************************************************************************
@@ -469,6 +471,8 @@ public class ImageResources {
                        "funnel-icon.png");
                registerImage(registry, FUNNEL_ICON_EXCLAMATION,
                        "funnel-exclamation-icon.png");
+               registerImage(registry, PROHIBITED,
+                "no_entry.png");
 
        }
 
index 48ce6465bc7fe847a7c154dcaa8cea28b6e10ffd..059dc4235634dec68ce19d4a3601716447557fee 100644 (file)
@@ -8,7 +8,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.core.runtime.Platform;
@@ -203,8 +204,11 @@ public class MessagingUtils {
         LocalDateTime date = LocalDateTime.now();
         String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
 
-        if(RemoteExecutionTimestampsUtil.getLastServiceMethod() != null){
-            contextInfo.add("last remote method : " + RemoteExecutionTimestampsUtil.getLastServiceMethod());
+        if(RemoteExecutionTimestampsUtil.getLastService() != null){
+            contextInfo.add("last remote service : " + RemoteExecutionTimestampsUtil.getLastService());
+        }
+        if(RemoteExecutionTimestampsUtil.getLastMethod() != null){
+            contextInfo.add("last remote method : " + RemoteExecutionTimestampsUtil.getLastMethod());
         }
         if(RemoteExecutionTimestampsUtil.getLastRequestClientTime() != null){
             contextInfo.add("last remote request client time : " + RemoteExecutionTimestampsUtil.getLastRequestClientTime());
index 70bfa7b97fba97864217f18249fd891ca5802392..dee0978a7e8bd89c828cbe78c31bfc4fef788ea2 100644 (file)
@@ -13,10 +13,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 
 /**
@@ -24,10 +20,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  * @created Jun 1, 2010
  */
 public abstract class AbstractNewEntityWizard<T>
-        extends Wizard
-        implements IConversationEnabled {
-
-       protected ConversationHolder conversation;
+        extends Wizard {
 
        protected CdmFormFactory formFactory;
 
@@ -47,10 +40,6 @@ public abstract class AbstractNewEntityWizard<T>
        @Override
        public boolean performFinish() {
                saveEntity();
-
-               conversation.commit();
-               conversation.close();
-               conversation = null;
                return true;
        }
 
@@ -69,7 +58,6 @@ public abstract class AbstractNewEntityWizard<T>
 
        public void init(IWorkbench workbench, IStructuredSelection selection) {
            formFactory = new CdmFormFactory(Display.getCurrent(), null);
-           conversation = CdmStore.createConversation();
            this.selection = selection;
                entity = createNewEntity();
 
@@ -77,14 +65,6 @@ public abstract class AbstractNewEntityWizard<T>
 
        protected abstract T createNewEntity();
 
-       @Override
-    public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {}
-
        public IStructuredSelection getSelection() {
                return selection;
        }
old mode 100755 (executable)
new mode 100644 (file)
index cd6ed01..606f5a7
@@ -14,8 +14,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -26,10 +24,7 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public abstract class AbstractNewEntityWizardParentChild<T> extends Wizard implements
-               IConversationEnabled {
-
-       private ConversationHolder conversation;
+public abstract class AbstractNewEntityWizardParentChild<T> extends Wizard {
 
        protected CdmFormFactory formFactory;
 
@@ -58,11 +53,6 @@ public abstract class AbstractNewEntityWizardParentChild<T> extends Wizard imple
                return true;
            }
                saveEntity();
-
-               conversation.commit();
-               conversation.close();
-               conversation = null;
-
                finished = true;
                return true;
        }
@@ -92,7 +82,6 @@ public abstract class AbstractNewEntityWizardParentChild<T> extends Wizard imple
        /** {@inheritDoc} */
        public void init(IWorkbench workbench, IStructuredSelection selection) {
            formFactory = new CdmFormFactory(Display.getCurrent(), null);
-           conversation = CdmStore.createConversation();
            this.selection = selection;
 
            createParentEntity();
@@ -100,19 +89,8 @@ public abstract class AbstractNewEntityWizardParentChild<T> extends Wizard imple
 
        }
 
-
-
        protected abstract void createParentEntity();
 
-       @Override
-    public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {}
-
        public IStructuredSelection getSelection() {
                return selection;
        }
index bc1f0011b223da65a055d8ee233c5f6e354a0215..7a968133d315e4336006b411f01401b9404fe9be 100644 (file)
@@ -8,7 +8,6 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -28,9 +27,8 @@ public class AmplificationGeneralWizardPage extends AbstractCdmEntityWizardPage<
      * @param conversation
      * @param entity
      */
-    public AmplificationGeneralWizardPage(CdmFormFactory formFactory,
-            ConversationHolder conversation, Amplification entity) {
-        super(formFactory, conversation, entity);
+    public AmplificationGeneralWizardPage(CdmFormFactory formFactory, Amplification entity) {
+        super(formFactory, entity);
         setTitle("General Amplification Data");
     }
 
index 0718bb4ded574fb2376ad9a4820203a421dedfcf..bb825f494099d5eff71290c0c910ec60edde264c 100644 (file)
@@ -1,12 +1,11 @@
 /**
 * 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.newWizard;
 
 import java.util.List;
@@ -26,8 +25,6 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.ext.ipni.IIpniService;
 import eu.etaxonomy.cdm.ext.ipni.IpniService;
 import eu.etaxonomy.cdm.model.reference.Reference;
@@ -36,60 +33,47 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 
 /**
- * <p>ExternalReferenceServiceWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Sep 16, 2010
- * @version 1.0
  */
 public class ExternalReferenceServiceWizardPage extends WizardPage implements SelectionListener, ISelectionChangedListener {
 
-       private ConversationHolder conversation;
        private CdmFormFactory formFactory;
        private Reference entity;
        private Composite control;
        private ListViewer viewer;
-       
+
        private IIpniService ipniService;
        private Text text_query;
        private Button button_search;
 
-       /**
-        * <p>Constructor for ExternalReferenceServiceWizardPage.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        */
-       protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
+       protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, Reference entity) {
                super("ExternalReferenceServiceWizardPage");
                this.formFactory = formFactory;
                this.entity = entity;
-               this.conversation = conversation;
                ipniService = new IpniService();
-               
+
                setDescription("Query IPNI service for references");
        }
-       
-       /** {@inheritDoc} */
+
        @Override
        public void createControl(Composite parent) {
                control = formFactory.createComposite(parent);
-               
+
                control.setLayout(LayoutConstants.LAYOUT(2, false));
-               
+
                text_query = new Text(control, SWT.SINGLE | SWT.BORDER);
                text_query.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
-               
+
                button_search = new Button(control, SWT.PUSH);
                button_search.setLayoutData(LayoutConstants.RIGHT());
                button_search.setText("Search");
-               
+
                button_search.addSelectionListener(this);
-               
+
                viewer = new ListViewer(control);
                viewer.getControl().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2,1));
-               
+
                viewer.setContentProvider(new IStructuredContentProvider(){
 
                        @Override
@@ -99,14 +83,14 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
                                }
                                return null;
                        }
-                       
+
                        @Override
                        public void inputChanged(Viewer viewer, Object oldInput,
                                        Object newInput) {}
-                       
+
                        @Override
                        public void dispose() {}
-                       
+
                });
                viewer.setLabelProvider(new LabelProvider(){
                        @Override
@@ -117,34 +101,29 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
                                return "Element is not a reference";
                        }
                });
-               
+
                viewer.addSelectionChangedListener(this);
-               
+
                setControl(control);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void widgetSelected(SelectionEvent e) {
                String query = text_query.getText();
-               List<Reference> publications = ipniService.getPublications(query, null, (ICdmRepository) CdmStore.getCurrentApplicationConfiguration(), null);
+               List<Reference> publications = ipniService.getPublications(query, null, CdmStore.getCurrentApplicationConfiguration(), null);
                viewer.setInput(publications);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void widgetDefaultSelected(SelectionEvent e) {}
 
-       /** {@inheritDoc} */
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
-               
+
                Reference selectedReference = (Reference) selection.getFirstElement();
                if(selectedReference != null){
                        ((AbstractNewEntityWizard) getWizard()).setEntity(selectedReference);
                }
        }
-       
-       
-}
+}
\ No newline at end of file
index 78b79339fa3c1c713eac78b51efca613c3182dbf..b8577246b376e8a6354931b965e2c100d6e3ac1f 100644 (file)
@@ -24,7 +24,7 @@ public class NewAmplificationWizard  extends AbstractNewEntityWizard<Amplificati
     /** {@inheritDoc} */
     @Override
     public void addPages() {
-        amplificationGeneralPage = new AmplificationGeneralWizardPage(formFactory, getConversationHolder(), getEntity());
+        amplificationGeneralPage = new AmplificationGeneralWizardPage(formFactory, getEntity());
         addPage(amplificationGeneralPage);
     }
 
index 7085e5554946a84a12a1c8824a805b322836d797..90a39cf776bf6c647709a4ad1c8eba1db4042a51 100644 (file)
@@ -41,7 +41,7 @@ public class NewClassificationWizard extends AbstractNewEntityWizard<Classificat
 
        @Override
        public void addPages() {
-               classificationWizardPage = new ClassificationWizardPage(formFactory, getConversationHolder(), getEntity());
+               classificationWizardPage = new ClassificationWizardPage(formFactory, getEntity());
                addPage(classificationWizardPage);
        }
 
index 697705e2f54d4108ac0c477fb6e8f20d21bb22d8..1b2d132aaebd1bd5f5dde76f814e09f02589caed 100644 (file)
@@ -26,7 +26,7 @@ public class NewCollectionWizard extends AbstractNewEntityWizard<Collection> {
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               addPage(new CollectionWizardPage(formFactory, getConversationHolder(), getEntity()));
+               addPage(new CollectionWizardPage(formFactory,  getEntity()));
        }
 
        /* (non-Javadoc)
index 513f38bd031982cc98171c5cd126548bafb42312..68b77953211edfb56d3c7ac5aa70d42d9919f174 100644 (file)
@@ -6,12 +6,11 @@
  * 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.newWizard;
 
-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.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
@@ -30,9 +29,11 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
 /**
  * @author n.hoffmann
  * @created Jun 16, 2010
- * @version 1.0
  */
-public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOrObservationBase> implements IDerivedUnitFacadePart{
+public class NewDerivedUnitBaseWizard
+        extends AbstractNewEntityWizard<SpecimenOrObservationBase>
+        implements IDerivedUnitFacadePart{
+
     private SpecimenOrObservationType specOrObsType = null;
 
     public NewDerivedUnitBaseWizard() {
@@ -43,23 +44,23 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
         super();
         this.specOrObsType = specOrObsType;
     }
-    /** {@inheritDoc} */
+
     @Override
     public void addPages() {
         DerivedUnitFacade facade = null;
         try {
             if(getEntity() instanceof DerivedUnit) {
                 facade = DerivedUnitFacade.NewInstance((DerivedUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
-                addPage(new DerivedUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
-                addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
-                addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
-                addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new DerivedUnitGeneralWizardPage(formFactory, facade));
+                addPage(new GatheringEventWizardPage(formFactory, facade));
+                addPage(new FieldUnitWizardPage(formFactory, facade));
+                addPage(new DerivedUnitBaseWizardPage(formFactory, facade));
             }
             else if(getEntity() instanceof FieldUnit){
                 facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
-                addPage(new FieldUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
-                addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
-                addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
+                addPage(new FieldUnitGeneralWizardPage(formFactory, facade));
+                addPage(new GatheringEventWizardPage(formFactory, facade));
+                addPage(new FieldUnitWizardPage(formFactory, facade));
             }
         } catch (DerivedUnitFacadeNotSupportedException e) {
             // we should never get here
@@ -67,9 +68,8 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
         }
     }
 
-    /** {@inheritDoc} */
     @Override
-    protected SpecimenOrObservationBase createNewEntity() {
+    protected SpecimenOrObservationBase<?> createNewEntity() {
         if (specOrObsType == null) {
             return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
         } else {
@@ -87,18 +87,13 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
         }
     }
 
-
-       /** {@inheritDoc} */
        @Override
        protected void saveEntity() {
            setEntity(CdmStore.getService(IOccurrenceService.class).merge(getEntity()));
-
        }
 
-
     @Override
     protected String getEntityName() {
         return "Specimen";
     }
-
-}
+}
\ No newline at end of file
index 1134ce0da956ba82c900a3d93db44c0a1cc3dd28..f04e20116b0e8b53302b7062750ba96d306d4325 100644 (file)
@@ -31,7 +31,7 @@ public class NewFeatureVocabularyWizard  extends AbstractNewEntityWizard<TermVoc
 
     @Override
     public void addPages() {
-        vocabularyPage = new VocabularyWizardPage(formFactory, getConversationHolder(), getEntity());
+        vocabularyPage = new VocabularyWizardPage(formFactory, getEntity());
         addPage(vocabularyPage);
     }
 
index 54efda3b6494ae6b33af3a8b74d3e1cbda06035a..233983cad0d237fd58de2189228dc86a6e2c14d9 100644 (file)
@@ -26,7 +26,7 @@ public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard<GrantedAu
 
        @Override
        public void addPages() {
-               authorityPage = new GrantedAuthorityDetailWizardPage(formFactory, getConversationHolder(), getEntity());
+               authorityPage = new GrantedAuthorityDetailWizardPage(formFactory, getEntity());
                super.addPage(authorityPage);
        }
 
index 015a2e8a8bf2ee6586cef2c1382c97d285a1d1da..7f9d877cdf2b3212c500c58433a14b72654cc61c 100644 (file)
@@ -28,7 +28,7 @@ public class NewGroupWizard extends AbstractNewEntityWizard<Group> {
         */
        @Override
        public void addPages() {
-               groupPage = new GroupDetailWizardPage(formFactory, getConversationHolder(), getEntity());
+               groupPage = new GroupDetailWizardPage(formFactory, getEntity());
                super.addPage(groupPage);
        }
 
index 8d532da19e90ea7266d662c4bb15b9c8d5ca4560..afa55f54ae915a0abe4f6896d9fe618892f8773b 100644 (file)
@@ -21,7 +21,7 @@ public class NewInstitutionWizard extends AbstractNewEntityWizard<Institution> {
 
        @Override
        public void addPages() {
-               addPage(new InstitutionWizardPage(formFactory, getConversationHolder(), getEntity()));
+               addPage(new InstitutionWizardPage(formFactory, getEntity()));
        }
 
        @Override
index 023b13b428e0f2f75f595669a52b9cfdbfe1da26..4ae3567895dc702e12f5a95e6184ee8221b3e117 100644 (file)
@@ -29,7 +29,7 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard<TaxonName> {
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), getEntity()));
+               addPage(new NonViralNameWizardPage(formFactory, getEntity()));
        }
 
        /** {@inheritDoc} */
index 3b396913eb7971ddd752b639042dfcf12beaec76..127b5277cd380d823ccc80b1ac641cc58046d094 100644 (file)
@@ -26,7 +26,7 @@ public class NewPersonWizard extends AbstractNewEntityWizard<Person> {
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               addPage(new PersonWizardPage(formFactory, getConversationHolder(), getEntity()));
+               addPage(new PersonWizardPage(formFactory, getEntity()));
        }
 
        /** {@inheritDoc} */
index 23cca956bb89108af50e040f2ae967318db5345a..9bb11dea9e90ce1d917f46a712ba57e2cd2e58ee 100644 (file)
@@ -18,7 +18,7 @@ public class NewPolytomousKeyWizard extends AbstractNewEntityWizard<PolytomousKe
 
        @Override
        public void addPages() {
-               polytomousKeyPage = new PolytomousKeyWizardPage(formFactory, getConversationHolder(), getEntity());
+               polytomousKeyPage = new PolytomousKeyWizardPage(formFactory, getEntity());
                super.addPage(polytomousKeyPage);
        }
 
index a00e275d9198a72179604691c824c5e5eeca7e7c..c4e980bd6f9523b7ea278f6cc8c8fd47caf0dcbf 100644 (file)
@@ -24,7 +24,7 @@ public class NewPrimerWizard  extends AbstractNewEntityWizard<Primer> {
     /** {@inheritDoc} */
     @Override
     public void addPages() {
-        primerPage = new PrimerWizardPage(formFactory, getConversationHolder(), getEntity());
+        primerPage = new PrimerWizardPage(formFactory, getEntity());
         addPage(primerPage);
     }
 
index 70f37d6edc8d0b17ec61496c564d258cdebe8d99..752bcf5df156a834e2dde38d5931cfb516a5ec0d 100644 (file)
@@ -39,7 +39,6 @@ public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
        @Override
        public void init(IWorkbench workbench, IStructuredSelection selection) {
         formFactory = new CdmFormFactory(Display.getCurrent(), null);
-        conversation = CdmStore.createConversation();
         this.selection = selection;
         setEntity(createNewEntity());
 
@@ -48,8 +47,8 @@ public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
        @Override
        public void addPages() {
                // TODO disabling external service wizard page for now
-//             addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity));
-               referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), getEntity(), false);
+//             addPage(new ExternalReferenceServiceWizardPage(formFactory, entity));
+               referencePage = new ReferenceWizardPage(formFactory, getEntity(), false);
                addPage(referencePage);
        }
 
index 9526758c7a0822b25aae12ecfb86aa5934545fd7..206eb8a1d9d35ea69d771c07c9b23cf4b491556f 100644 (file)
@@ -25,7 +25,6 @@ import eu.etaxonomy.cdm.model.reference.NamedSource;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus;
-import eu.etaxonomy.cdm.persistence.dto.MergeResult;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -55,7 +54,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizardParentChild<Taxon
 
     @Override
     public void addPages() {
-        taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getParentEntity(), wizardPageListener, true);
+        taxonNodePage = new TaxonNodeWizardPage(formFactory, getParentEntity(), wizardPageListener, true);
         addPage(taxonNodePage);
     }
 
@@ -65,8 +64,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizardParentChild<Taxon
         if(taxon == null ){
             openEmptyEditor = true;
         }else{
-            getConversationHolder().bind();
-            try{
+           try{
                UpdateResult result;
                TaxonNode parent = getParentEntity();
 
index a3aa31281a13aaccd197d5e0641e48db09065f87..f130e43241e5c673f6f6fdf1058994e0db837266 100644 (file)
@@ -33,8 +33,8 @@ public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-           addPage(new TaxonWizardPage(formFactory, getConversationHolder(), getEntity()));
-           addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), getEntity().getName()));
+           addPage(new TaxonWizardPage(formFactory, getEntity()));
+           addPage(new NonViralNameWizardPage(formFactory, getEntity().getName()));
        }
 
        /** {@inheritDoc} */
@@ -52,11 +52,11 @@ public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
             Set<TaxonName> namesToSave = new HashSet<>();
             for (HybridRelationship hybridRelationship: taxon.getName().getHybridChildRelations()){
                 if (hybridRelationship.getParentName() != taxon.getName()){
-                    if (!hybridRelationship.getParentName().isPersited()){
+                    if (!hybridRelationship.getParentName().isPersisted()){
                         namesToSave.add(hybridRelationship.getParentName());
                     }
                }else if (hybridRelationship.getHybridName() != taxon.getName()){
-                   if (!hybridRelationship.getHybridName().isPersited()){
+                   if (!hybridRelationship.getHybridName().isPersisted()){
                        namesToSave.add(hybridRelationship.getHybridName());
                    }
                 }
@@ -65,11 +65,11 @@ public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
 
             for (HybridRelationship hybridRelationship: taxon.getName().getHybridParentRelations()){
                 if (hybridRelationship.getParentName() != taxon.getName()){
-                    if (!hybridRelationship.getParentName().isPersited()){
+                    if (!hybridRelationship.getParentName().isPersisted()){
                         namesToSave.add(hybridRelationship.getParentName());
                     }
                }else if (hybridRelationship.getHybridName() != taxon.getName()){
-                   if (!hybridRelationship.getHybridName().isPersited()){
+                   if (!hybridRelationship.getHybridName().isPersisted()){
                        namesToSave.add(hybridRelationship.getHybridName());
                    }
                 }
index b513886f27e84e58de23fb9850aa04626db3785d..09ef95411a2b41c880ba42dae1a3ecf83d5677c4 100644 (file)
@@ -37,7 +37,7 @@ public class NewTeamWizard extends AbstractNewEntityWizard<Team> {
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               addPage(new TeamWizardPage(formFactory, getConversationHolder(), getEntity(), isNomenclaturalTeam, isCollectorTeam));
+               addPage(new TeamWizardPage(formFactory, getEntity(), isNomenclaturalTeam, isCollectorTeam));
        }
 
        /* (non-Javadoc)
index 95baf5fe82c35d133e4b097259d2dd29e8cd6b98..4f6de340403aa1974d92bd8ca30d36fc51f3708b 100644 (file)
@@ -18,7 +18,7 @@ public class NewUserWizard extends AbstractNewEntityWizard<User> {
 
        @Override
        public void addPages() {
-               userPage = new UserDetailWizardPage(formFactory, getConversationHolder(), getEntity());
+               userPage = new UserDetailWizardPage(formFactory, getEntity());
                addPage(userPage);
        }
 
index c4248413cede4919ff5940f006c0588161632b9d..41d4bcdf38411c7fce88d0de92ae44274ee7e425 100644 (file)
@@ -3,7 +3,6 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -17,9 +16,8 @@ import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailElement;
  */
 public class PolytomousKeyWizardPage extends AbstractCdmEntityWizardPage<PolytomousKey> {
 
-       public PolytomousKeyWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, PolytomousKey entity) {
-               super(formFactory, conversation, entity);
+       public PolytomousKeyWizardPage(CdmFormFactory formFactory, PolytomousKey entity) {
+               super(formFactory, entity);
        }
 
        @Override
index f9874848d1a3a87cbba90fcc0c60753f86116888..2a0becbdb2fa7a00db5ad07a471facf781bad340 100644 (file)
@@ -8,7 +8,6 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Primer;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -28,9 +27,8 @@ public class PrimerWizardPage extends AbstractCdmEntityWizardPage<Primer> {
      * @param conversation
      * @param entity
      */
-    public PrimerWizardPage(CdmFormFactory formFactory,
-            ConversationHolder conversation, Primer entity) {
-        super(formFactory, conversation, entity);
+    public PrimerWizardPage(CdmFormFactory formFactory, Primer entity) {
+        super(formFactory, entity);
         setTitle("General Primer Data");
     }
 
index 3344a7ab806134620063710a45bcf00f7a57ea50..1f6b658dacc602e7820d8c50de305c82d372315f 100644 (file)
@@ -8,7 +8,6 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -23,9 +22,8 @@ import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
  */
 public class VocabularyWizardPage extends AbstractCdmEntityWizardPage<TermVocabulary> {
 
-    public VocabularyWizardPage(CdmFormFactory formFactory,
-            ConversationHolder conversation, TermVocabulary entity) {
-        super(formFactory, conversation, entity);
+    public VocabularyWizardPage(CdmFormFactory formFactory, TermVocabulary entity) {
+        super(formFactory, entity);
         setTitle("General Vocabulary Data");
     }
 
index 7c949d73115b821cc5a7efdcb0ce15b90a23d1ae..499a34ec71234f8c07cab1a8aca5117b751b06f6 100644 (file)
 package eu.etaxonomy.taxeditor.operation;
 
 import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
@@ -29,8 +27,6 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
  * @version 1.0
  */
 public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonOperation {
-       private final IConversationEnabled conversationEnabled;
-
        protected TaxonNodeDto parentNode;
 
           /**
@@ -39,12 +35,10 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
      * @param label a {@link java.lang.String} object.
      * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
      * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-     * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
      */
     protected AbstractPersistentPostOperation(String label, IUndoContext undoContext,
-            IPostOperationEnabled postOperationEnabled,
-            IConversationEnabled conversationEnabled) {
-        this(label, undoContext, postOperationEnabled, conversationEnabled, null);
+            IPostOperationEnabled postOperationEnabled) {
+        this(label, undoContext, postOperationEnabled, null);
     }
 
        /**
@@ -53,14 +47,11 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         * @param label a {@link java.lang.String} object.
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        protected AbstractPersistentPostOperation(String label, IUndoContext undoContext,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
                        ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
                super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
-               this.conversationEnabled = conversationEnabled;
        }
 
        /**
@@ -70,16 +61,12 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param taxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public AbstractPersistentPostOperation(String label,
                        IUndoContext undoContext, TaxonNodeDto taxonNode,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
                        ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
                super(label, undoContext, taxonNode, postOperationEnabled, cdmEntitySessionEnabled);
-               this.conversationEnabled = conversationEnabled;
-
        }
 
        /**
@@ -88,18 +75,14 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         * @param label a {@link java.lang.String} object.
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         */
        public AbstractPersistentPostOperation(String label,
                        IUndoContext undoContext,
                        IPostOperationEnabled postOperationEnabled,
-                       IConversationEnabled conversationEnabled,
-            ICdmEntitySessionEnabled cdmEntitySessionEnabled, TaxonNodeDto parentNode) {
+                       ICdmEntitySessionEnabled cdmEntitySessionEnabled, TaxonNodeDto parentNode) {
                super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
                this.parentNode = parentNode;
-               this.conversationEnabled = conversationEnabled;
-
        }
 
        /* (non-Javadoc)
@@ -108,15 +91,7 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
        /** {@inheritDoc} */
        @Override
     protected IStatus postExecute(Object objectAffectedByOperation) {
-               Assert.isNotNull(conversationEnabled, "Operation has to have a valid conversation attached.");
-
-
-               if (!conversationEnabled.getConversationHolder().isClosed()){
-                       conversationEnabled.getConversationHolder().bind();
-                       conversationEnabled.getConversationHolder().commit(true);
-               }
                IStatus status = super.postExecute(objectAffectedByOperation);
-
                return status;
        }
 
@@ -124,7 +99,6 @@ public abstract class AbstractPersistentPostOperation extends AbstractPostTaxonO
         * Binds the conversation that was attached to this operation.
         */
        public void bind(){
-               conversationEnabled.getConversationHolder().bind();
                if(getCdmEntitySessionEnabled() != null && getCdmEntitySessionEnabled().getCdmEntitySession()!=null) {
                    getCdmEntitySessionEnabled().getCdmEntitySession().bind();
         }
index ca015334f7776b466082d42fafd9eabbccd4a2b7..ff3b2ddf0ae14cf8fb87df0e81304409a42a2b82 100644 (file)
@@ -104,14 +104,14 @@ public abstract class CdmUpdateOperation extends CdmOperation {
 
             Status[] childStatus = new Status[exceptions.size()];
             int count = 0;
-            Set<String> messages = new HashSet<>();
+            //Set<String> messages = new HashSet<>();
             for(Exception ex : exceptions) {
                 Status status = new Status(statusFlag,
                         "unknown",
                         statusFlag,
-                        ex.getLocalizedMessage(),
+                        null,
                         ex);
-                messages.add(ex.getLocalizedMessage());
+               // messages.add(ex.getLocalizedMessage());
                 childStatus[count] = status;
                 count++;
             }
index 3b9342f82fabfdbd7a3f24fa5a021e828808c6ba..7e9279c2911b32f0ccaa572a3108ff593a5ee35c 100644 (file)
@@ -72,7 +72,7 @@ public abstract class CdmHandlerE4 {
             ErrorDialog.openError(null, "Operation successful but with warnings", null, status);
             break;
         case IStatus.ERROR:
-            ErrorDialog.openError(null, "Error executing operation", null, status);
+            //MessagingUtils.error(null, "Error executing operation", null, status);
             break;
         default:
         }
index 7f7d8c8098ed094917487e8d4dc5944c7f4d00a2..263531f90a28802b1035d3e3fec329ea988af6c3 100644 (file)
@@ -16,6 +16,7 @@ import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logge
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.name.ITaxonNameBase;
 import eu.etaxonomy.cdm.model.name.Rank;
old mode 100755 (executable)
new mode 100644 (file)
index 1e417cf..a515266
@@ -189,7 +189,7 @@ public class AbcdImportPreference extends CdmPreferencePage implements IE4Prefer
         checkBoxAddIndividualsAssociations.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
-                configurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
+                configurator.setAddIndividualsAssociations(!configurator.isAddIndividualsAssociations());
                 setApply(true);
             }
         });
@@ -450,7 +450,7 @@ public class AbcdImportPreference extends CdmPreferencePage implements IE4Prefer
 
         checkBoxRemoveCountry.setSelection(configurator.isRemoveCountryFromLocalityText());
         checkBoxImportSiblings.setSelection(configurator.isGetSiblings());
-        checkBoxAddIndividualsAssociations.setSelection(configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
+        checkBoxAddIndividualsAssociations.setSelection(configurator.isAddIndividualsAssociations());
         checkBoxReuseDescriptiveGroups.setSelection(configurator.isReuseExistingDescriptiveGroups());
         checkBoxReuseExistingTaxa.setSelection(configurator.isReuseExistingTaxaWhenPossible());
 
old mode 100755 (executable)
new mode 100644 (file)
index f982990..2ecb04d
@@ -48,28 +48,24 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author k.luther
  * @since 05.06.2019
- *
  */
-abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> extends CdmPreferencePage implements ISelectionChangedListener, SelectionListener{
+public abstract class AbstractGeneralTermPreference<T extends AbstractTermDto> extends CdmPreferencePage
+        implements ISelectionChangedListener, SelectionListener {
 
     protected CheckBoxTreeComposite treeComposite;
     protected List<TermVocabularyDto> vocabularies = new ArrayList<>();
-    protected Combo useLocalOrAdmin ;
+    protected Combo useLocalOrAdmin;
 
     protected boolean isOverride;
     protected boolean allowOverride;
     protected CdmPreference pref;
     protected IPreferencePredicate predicate;
 
-
-    public AbstractGeneralTermPreference(){
+    public AbstractGeneralTermPreference() {
         super();
 
     }
 
-    /**
-     * @param title
-     */
     public AbstractGeneralTermPreference(String title) {
         super(title);
     }
@@ -78,7 +74,6 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         return !isAdminPreference;
     }
 
-
     protected TermType type;
 
     public List<TermVocabularyDto> getVocabularies() {
@@ -101,14 +96,11 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         return treeComposite;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected Control createContents(Composite parent) {
         Composite container = new Composite(parent, SWT.NULL);
         getPreferenceValues();
-        if (isLocalPref() && !allowOverride){
+        if (isLocalPref() && !allowOverride) {
             final CLabel description = new CLabel(parent, SWT.NULL);
             description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
             this.setDefaultButtonActivated(false);
@@ -120,36 +112,37 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         container.setLayout(gridLayout);
         parent.setLayout(new GridLayout());
         useLocalOrAdmin = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
-        if (!isAdminPreference){
+        if (!isAdminPreference) {
             useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel(), 1);
 
-        }else{
+        } else {
             useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel(), 1);
         }
 
-
-        treeComposite = new CheckBoxTreeComposite(container, new TermDtoContentProvider(), new TermDtoLabelProvider(), SWT.SCROLL_PAGE);
+        treeComposite = new CheckBoxTreeComposite(container, new TermDtoContentProvider(), new TermDtoLabelProvider(),
+                SWT.SCROLL_PAGE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         rememberCheckedValues(getCheckedValuesFromPreferences());
 
-        if (isLocalPref()){
-            if (isOverride){
+        if (isLocalPref()) {
+            if (isOverride) {
                 useLocalOrAdmin.select(1);
-            }else{
+            } else {
                 useLocalOrAdmin.select(0);
-                if (treeComposite.getViewer().getTree() != null && treeComposite.getViewer().getTree().getTopItem() != null) {
+                if (treeComposite.getViewer().getTree() != null
+                        && treeComposite.getViewer().getTree().getTopItem() != null) {
                     treeComposite.getViewer().getTree().setSelection(treeComposite.getViewer().getTree().getTopItem());
                 }
                 treeComposite.setEnabled(false);
 
-                //treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
+                // treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
             }
-        }else{
-            if (allowOverride){
+        } else {
+            if (allowOverride) {
                 useLocalOrAdmin.select(0);
-            }else{
+            } else {
                 useLocalOrAdmin.select(1);
             }
         }
@@ -161,41 +154,36 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         treeComposite.getViewer().addSelectionChangedListener(this);
 
         return container;
-
     }
 
-    public String getCheckedValuesFromPreferences(){
+    public String getCheckedValuesFromPreferences() {
         String values;
-        if (!isAdminPreference && isOverride){
+        if (!isAdminPreference && isOverride) {
             values = PreferencesUtil.getStringValue(predicate.getKey(), true);
-        }else{
-            values = pref != null ?pref.getValue(): null;
+        } else {
+            values = pref != null ? pref.getValue() : null;
         }
         return values;
     }
 
     protected void rememberCheckedValues(String checkedValues) {
         initialiseVocabularies();
-        treeComposite.getViewer().getTree().deselectAll();
-        treeComposite.getViewer().refresh();
-        treeComposite.getViewer().setInput(getVocabularies());
-        Object o =treeComposite.getViewer().getInput();
-
+        setInput();
 
         if (checkedValues != null && checkedValues != "") { //$NON-NLS-1$
             String[] listChecked = checkedValues.split(";"); //$NON-NLS-1$
             String[] listCheckedComma = checkedValues.split(","); //$NON-NLS-1$
             List<String> checked = new ArrayList<>();
-            if (listChecked != null ){
+            if (listChecked != null{
                 checked = Arrays.asList(listChecked);
             }
-            if (listCheckedComma != null && checkedValues.contains(",")){ //$NON-NLS-1$
+            if (listCheckedComma != null && checkedValues.contains(",")) { //$NON-NLS-1$
                 checked = Arrays.asList(listCheckedComma);
             }
             List<T> termsFromStringValues = getTermsFromStringValues(checked);
             treeComposite.setCheckedElements(termsFromStringValues.toArray());
 
-        }else{
+        } else {
             List<T> termsFromStringValues = getTermsFromStringValues(new ArrayList<String>());
             treeComposite.setCheckedElements(termsFromStringValues.toArray());
             treeComposite.getViewer().refresh();
@@ -204,6 +192,12 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         }
     }
 
+    protected void setInput() {
+        treeComposite.getViewer().getTree().deselectAll();
+        treeComposite.getViewer().refresh();
+        treeComposite.getViewer().setInput(getVocabularies());
+    }
+
     protected abstract List<T> getTermsFromStringValues(List<String> listValue);
 
     protected void initialiseVocabularies() {
@@ -216,33 +210,27 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         setVocabularies(vocs);
     }
 
-    protected void getPreferenceValues(){
+    protected void getPreferenceValues() {
         pref = PreferencesUtil.getPreferenceFromDB(predicate);
-        this.allowOverride = pref!= null?pref.isAllowOverride():true;
+        this.allowOverride = pref != null ? pref.isAllowOverride() : true;
         this.isOverride = PreferencesUtil.getOverrideForPreference(predicate.getKey());
-        if (pref == null){
+        if (pref == null) {
             pref = CdmPreference.NewTaxEditorInstance(predicate, null);
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void selectionChanged(SelectionChangedEvent event) {
         this.setApply(true);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetSelected(SelectionEvent e) {
-        if (e.getSource().equals(useLocalOrAdmin)&& !isAdminPreference){
-            if (useLocalOrAdmin.getText().equals(LocalOrDefaultEnum.Default.getLabel())){
+        if (e.getSource().equals(useLocalOrAdmin) && !isAdminPreference) {
+            if (useLocalOrAdmin.getText().equals(LocalOrDefaultEnum.Default.getLabel())) {
                 treeComposite.setEnabled(false);
                 isOverride = false;
-            }else{
+            } else {
                 treeComposite.setEnabled(true);
                 isOverride = true;
             }
@@ -251,36 +239,32 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         this.setApply(true);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetDefaultSelected(SelectionEvent e) {
         // TODO Auto-generated method stub
-
     }
 
     @Override
-    protected void performDefaults(){
-        if (!isLocalPref()){
+    protected void performDefaults() {
+        if (!isLocalPref()) {
             rememberCheckedValues("");
             treeComposite.setEnabled(true);
-        }else{
+        } else {
             isOverride = false;
             rememberCheckedValues(getCheckedValuesFromPreferences());
             treeComposite.setEnabled(false);
         }
-       pref = null;
-       useLocalOrAdmin.select(0);
+        pref = null;
+        useLocalOrAdmin.select(0);
 
-       setApply(true);
-       super.performDefaults();
+        setApply(true);
+        super.performDefaults();
 
     }
 
     @Override
     public boolean performOk() {
-        if (!isApply()){
+        if (!isApply()) {
             return true;
         }
         Object[] checkedElements = treeComposite.getViewer().getCheckedElements();
@@ -288,11 +272,11 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         Collection<TermDto> preferredTermDtos = new ArrayList<>();
         List<DefinedTermBase> preferredTerms = new ArrayList<>();
         for (Object o : checkedElements) {
-            if(o instanceof TermDto){
+            if (o instanceof TermDto) {
                 TermDto termDto = (TermDto) o;
                 listUIIDChecked.add(termDto.getUuid());
                 preferredTermDtos.add(termDto);
-                if (vocabularies.size() > 1){
+                if (vocabularies.size() > 1) {
                     preferredTerms.add(CdmStore.getService(ITermService.class).load(termDto.getUuid()));
                 }
 
@@ -300,18 +284,17 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         }
         String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
 
-
         String text = this.useLocalOrAdmin.getText();
-        if (text.equals(LocalOrDefaultEnum.Database.getLabel()) || text.equals(LocalOrDefaultEnum.Default.getLabel())){
+        if (text.equals(LocalOrDefaultEnum.Database.getLabel()) || text.equals(LocalOrDefaultEnum.Default.getLabel())) {
             PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()), false);
-        }else if (text.equals(LocalOrDefaultEnum.Local.getLabel())){
+        } else if (text.equals(LocalOrDefaultEnum.Local.getLabel())) {
             PreferencesUtil.setStringValue(predicate.getKey(), saveCheckedElements);
             PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()), true);
         }
-        if (type == null){
+        if (type == null) {
             CdmStore.getTermManager().setPreferredTermsByDto(preferredTermDtos, vocabularies.get(0));
 
-        }else{
+        } else {
             CdmStore.getTermManager().setPreferredTermsByType(preferredTermDtos, type);
         }
         PreferencesUtil.firePreferencesChanged(this.getClass());
@@ -319,26 +302,31 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
     }
 
     protected boolean performOkAdmin() {
-        Object[] checkedElements = treeComposite.getViewer().getCheckedElements();
-        List<UUID> listUIIDChecked = new ArrayList<>();
-        List<DefinedTermBase> preferredTerms = new ArrayList<>();
-        for (Object o : checkedElements) {
-            if(o instanceof TermDto){
-                TermDto termDto = (TermDto) o;
-                listUIIDChecked.add(termDto.getUuid());
-                preferredTerms.add(CdmStore.getService(ITermService.class).load(termDto.getUuid()));
+        CdmPreference savePref = CdmPreference.NewTaxEditorInstance(predicate, null);
+        
+        if (pref != null) {
+           
+            Object[] checkedElements = treeComposite.getCheckedElements();
+            List<UUID> listUIIDChecked = new ArrayList<>();
+            List<DefinedTermBase> preferredTerms = new ArrayList<>();
+            for (Object o : checkedElements) {
+                if (o instanceof TermDto) {
+                    TermDto termDto = (TermDto) o;
+                    listUIIDChecked.add(termDto.getUuid());
+                    preferredTerms.add(CdmStore.getService(ITermService.class).load(termDto.getUuid()));
+                }
+            }
+            String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
+            if (StringUtils.isBlank(saveCheckedElements)) {
+                saveCheckedElements = null;
+            }
+            savePref = CdmPreference.NewTaxEditorInstance(predicate, saveCheckedElements);
+            String text = this.useLocalOrAdmin.getText();
+            if (text.equals(LocalOrDefaultEnum.Database.getLabel())) {
+                savePref.setAllowOverride(false);
+            } else if (text.equals(LocalOrDefaultEnum.AllowOverride.getLabel())) {
+                savePref.setAllowOverride(true);
             }
-        }
-        String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
-        if (StringUtils.isBlank(saveCheckedElements)){
-            saveCheckedElements = null;
-        }
-        CdmPreference savePref = CdmPreference.NewTaxEditorInstance(predicate, saveCheckedElements);
-        String text = this.useLocalOrAdmin.getText();
-        if (text.equals(LocalOrDefaultEnum.Database.getLabel()) ){
-            savePref.setAllowOverride(false);
-        }else if (text.equals(LocalOrDefaultEnum.AllowOverride.getLabel())){
-            savePref.setAllowOverride(true);
         }
 
         PreferencesUtil.setPreferenceToDB(savePref);
@@ -346,5 +334,4 @@ abstract public class AbstractGeneralTermPreference<T extends AbstractTermDto> e
         PreferencesUtil.firePreferencesChanged(this.getClass());
         return true;
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 6cc58a1..043303e
@@ -45,36 +45,36 @@ public abstract class AbstractVocabularySelectionPreference extends CdmPreferenc
     /**
     *
     */
-   protected void refresh() {
-       //getValues();
-       if (table != null){
-           table.removeAll();
-           if (pref != null){
-               createTableRow(pref);
-           }
-           table.redraw();
-           table.pack();
+    protected void refresh() {
+        // getValues();
+        if (table != null) {
+            table.removeAll();
+            if (pref != null) {
+                createTableRow(pref);
+            }
+            table.redraw();
+            table.pack();
 
-       }
+        }
 
-   }
+    }
 
-   public abstract void createTableRow(CdmPreference pref) ;
-  // public abstract String getUUIDFromSubject(CdmPreference pref);
+    public abstract void createTableRow(CdmPreference pref);
+    // public abstract String getUUIDFromSubject(CdmPreference pref);
 
-   protected void fillVocabularies(CdmPreference vocPref){
-       List<UUID> uuids = null;
-       if (isAdminPreference){
-           uuids = PreferencesUtil.createUuidList(vocPref.getValue());
-       }else{
-           uuids = PreferencesUtil.createUUIDListFromStringPref(vocPref.getPredicate(), false);
-       }
-       if (uuids == null || uuids.isEmpty()){
-           vocabularies = new ArrayList();
-           vocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
-       }else{
-           vocabularies =  CdmStore.getService(IVocabularyService.class).findVocabularyDtoByVocabularyUuids(uuids);
-       }
-   }
+    protected void fillVocabularies(CdmPreference vocPref) {
+        List<UUID> uuids = null;
+        if (isAdminPreference) {
+            uuids = PreferencesUtil.createUuidList(vocPref.getValue());
+        } else {
+            uuids = PreferencesUtil.createUUIDListFromStringPref(vocPref.getPredicate(), false);
+        }
+        if (uuids == null || uuids.isEmpty()) {
+            vocabularies = new ArrayList();
+            vocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
+        } else {
+            vocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByVocabularyUuids(uuids);
+        }
+    }
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AreaCheckBoxTreeComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AreaCheckBoxTreeComposite.java
new file mode 100644 (file)
index 0000000..a7b7668
--- /dev/null
@@ -0,0 +1,267 @@
+/**
+* Copyright (C) 2023 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.preference;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.Widget;
+
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.taxeditor.preference.wizard.CheckBoxTreeComposite;
+
+/**
+ * @author katjaluther
+ * @since 18.10.2023
+ */
+public class AreaCheckBoxTreeComposite extends CheckBoxTreeComposite {
+    Map<TermDto, Set<TermNodeDto>> mapTermsToNodes = new HashMap<>();
+
+    /**
+     * @param parent
+     * @param contentProvider
+     * @param labelProvider
+     * @param style
+     */
+    public AreaCheckBoxTreeComposite(Composite parent, ITreeContentProvider contentProvider, IBaseLabelProvider labelProvider,
+            int style) {
+        super(parent, contentProvider, labelProvider, style);
+        
+    }
+    
+    @Override
+    protected Tree createTree() {
+        Tree tree = new Tree(this, SWT.BORDER | SWT.CHECK);
+        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        tree.addListener(SWT.Selection, event -> {
+            if (event.detail == SWT.CHECK) {
+                TreeItem item = (TreeItem) event.item;
+                if(!allowTopLevelSelection && item.getParentItem()==null){
+                    // top level selection not allowed
+                    item.setChecked(false);
+                    return;
+                }              
+                if (item.getChecked()){
+                    updateAfterCheckElement(item);                          
+                }else{
+                    if (checkedElements != null){
+                        updateAfterUnCheckElement(item);
+                    }
+                }                
+            }
+        });
+        return tree;
+    }
+
+    
+    
+    /**
+     * @return the mapTermsToNodes
+     */
+    public Map<TermDto, Set<TermNodeDto>> getMapTermsToNodes() {
+        return mapTermsToNodes;
+    }
+
+    /**
+     * @param mapTermsToNodes the mapTermsToNodes to set
+     */
+    public void setMapTermsToNodes(Map<TermDto, Set<TermNodeDto>> mapTermsToNodes) {
+        this.mapTermsToNodes = mapTermsToNodes;
+    }
+
+    /**
+     * @param item
+     */
+    private void updateAfterCheckElement(Object item) {
+        List<Object> tempList = new ArrayList<>();
+        if (checkedElements != null) {
+            Collections.addAll(tempList, checkedElements);
+        }
+        
+        TermNodeDto checkedNode = null;
+        TermDto checkedTerm = null;
+        TreeItem treeItem = null;
+        if (item instanceof TreeItem) {
+             treeItem = (TreeItem) item;   
+             if (treeItem.getData() instanceof TermNodeDto) {
+                 checkedNode = (TermNodeDto)treeItem.getData();
+                 checkedTerm = checkedNode.getTerm();
+             }else if (treeItem.getData() instanceof TermDto) {           
+                 checkedTerm = (TermDto)treeItem.getData();
+             }else {
+                 return;
+             }
+        }else  if (item instanceof TermNodeDto) {
+            checkedNode = (TermNodeDto)item;
+            checkedTerm = checkedNode.getTerm();
+        }else if (item instanceof TermDto) {           
+            checkedTerm = (TermDto)item;
+        }else {
+            return;
+        }
+        
+        
+        Set<TermNodeDto> allRelevantNodes =  this.mapTermsToNodes.get(checkedTerm);
+        if (allRelevantNodes != null) {
+            tempList.addAll(allRelevantNodes);
+        }
+        tempList.add(checkedTerm);
+        
+        setCheckedElements(tempList.toArray());
+        
+    }
+    
+   
+    @Override
+    protected void updateAfterUnCheckElement(Object item) {
+        List<Object> tempList = new ArrayList<>();     
+        List<Object> elementsToUpdate = new ArrayList<>();
+        Collections.addAll(tempList, checkedElements);
+        TermNodeDto checkedNode = null;
+        TermDto checkedTerm = null;
+        if (item instanceof TreeItem) {
+            if (((TreeItem)item).getData() instanceof TermNodeDto) {
+                checkedNode = (TermNodeDto)((TreeItem)item).getData();
+                checkedTerm = checkedNode.getTerm();
+            }else if (((TreeItem)item).getData() instanceof TermDto) {           
+                checkedTerm = (TermDto)((TreeItem)item).getData();
+            }else {
+                return;
+            }
+        }else if (item instanceof TermNodeDto) {
+            checkedNode = (TermNodeDto)item;
+            checkedTerm = checkedNode.getTerm();            
+        }else if (item instanceof TermDto) {
+            checkedTerm = (TermDto) item;
+        }
+        
+        for (Object o:checkedElements){
+            //o can be a termnode dto or a term dto
+            //check whether item.getData is a termDto or a termNodeDto
+            TermNodeDto toCheckNode = null;
+            TermDto toCheckTerm = null;
+            if (o instanceof TermNodeDto) {
+                toCheckNode = (TermNodeDto) o;
+                toCheckTerm = toCheckNode.getTerm();
+            }else if (o instanceof TermDto) {
+                toCheckTerm = (TermDto)o;
+            }else {
+                continue;
+            }
+            
+            if (toCheckNode != null && checkedNode != null && toCheckNode.equals(checkedNode)){
+                tempList.remove(toCheckNode);
+                elementsToUpdate.add(toCheckNode);
+
+            }
+            if (toCheckNode != null && checkedTerm != null && toCheckTerm.equals(checkedTerm)){
+                tempList.remove(toCheckNode);
+                elementsToUpdate.add(toCheckNode);
+                
+            }
+            if (toCheckTerm != null && checkedTerm != null && toCheckTerm.equals(checkedTerm)){
+                tempList.remove(toCheckTerm);
+                elementsToUpdate.add(toCheckTerm);
+                
+            }
+        }
+        setCheckedElements(tempList.toArray());
+    }
+    
+    @Override
+    public void widgetSelected(SelectionEvent e) {
+        ITreeSelection structuredSelection = viewer.getStructuredSelection();
+        Object firstElement = structuredSelection.getFirstElement();
+        if(e.widget == btnCollapse){
+            viewer.collapseAll();
+        }
+        else if(e.widget == btnExpand){
+            viewer.expandToLevel(firstElement, AbstractTreeViewer.ALL_LEVELS);
+        }
+        else if(e.widget == btnSelectDirectChildren){
+            Widget item = viewer.testFindItem(firstElement);
+            if(item instanceof TreeItem){
+                viewer.expandToLevel(firstElement, 1);
+                TreeItem treeItem = (TreeItem) item;
+                TreeItem[] childItems = treeItem.getItems();
+                List<TreeItem> childItemList = Arrays.asList(childItems);
+                boolean allChecked = childItemList.stream().allMatch(childItem->childItem.getChecked());
+                childItemList.stream().forEach(childItem->childItem.setChecked(!allChecked));
+                if (!allChecked) {
+                    for (TreeItem updateItem: childItemList) {
+                        updateAfterCheckElement(updateItem);
+                    }
+                    
+                }else {
+                    for (TreeItem updateItem: childItemList) {
+                        updateAfterUnCheckElement(updateItem);
+                    }
+                }
+               
+            }
+        }
+        else if(e.widget == btnSelectAllChildren){
+            Widget item = viewer.testFindItem(firstElement);
+            if(item instanceof TreeItem){
+                viewer.expandToLevel(firstElement, AbstractTreeViewer.ALL_LEVELS);
+                Set<TreeItem> childrenSet = getSubTreeItems((TreeItem)item);
+                Object[] children = childrenSet.toArray();
+                boolean checked = true;
+                if (children == null) {
+                    return;
+                }
+                if (children != null && ((TreeItem)children[0]).getChecked()) {
+                    checked = false;
+                }
+                viewer.setSubtreeChecked(firstElement, checked);
+                ((TreeItem) item).setChecked(false);
+                Object[] checkedElements = viewer.getCheckedElements();
+                
+                for (Object updateItem: children) {
+                    if (((TreeItem)children[0]).getChecked()) {
+                        updateAfterCheckElement(updateItem);
+                    }else {
+                        updateAfterUnCheckElement(updateItem);
+                    }
+                }
+             
+            }
+        }
+    }
+    
+    private Set<TreeItem> getSubTreeItems(TreeItem parent) {
+        Set<TreeItem> children = new HashSet<>();
+        
+        if (parent.getItems() != null) {            
+            children.addAll(Arrays.asList(parent.getItems()));
+            for(TreeItem child : parent.getItems()) {              
+                children.addAll(getSubTreeItems(child));
+            }
+        }
+        return children;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/BiocaseProvideConfig.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/BiocaseProvideConfig.java
new file mode 100644 (file)
index 0000000..04a9731
--- /dev/null
@@ -0,0 +1,56 @@
+// $Id$
+/**
+* Copyright (C) 2023 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.preference;
+
+import java.util.LinkedHashMap;
+
+/**
+ * @author K.Luther
+ * @date 14.06.2023
+ *
+ */
+public class BiocaseProvideConfig {
+
+    private String[] datasets;
+    private String service_url;
+
+
+    public BiocaseProvideConfig() {
+    }
+
+    public BiocaseProvideConfig(Object[] datasets, String service_url) {
+        this.setDatasets(datasets);
+        this.service_url = service_url;
+    }
+
+
+    public String[] getDatasets() {
+        return datasets;
+    }
+    public void setDatasets(Object[] datasets) {
+        this.datasets = new String[datasets.length];
+        int index = 0;
+        for (Object o:datasets) {
+            LinkedHashMap<String,String> map = (LinkedHashMap<String, String>)o;
+            this.datasets[index] = map.get("title");
+            index++;
+        }
+
+    }
+    public String getService_url() {
+        return service_url;
+    }
+    public void setService_url(String service_url) {
+        this.service_url = service_url;
+    }
+
+
+
+}
old mode 100755 (executable)
new mode 100644 (file)
index 8b83dac..39c4c36
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.preference;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.layout.GridLayoutFactory;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.ext.geo.CondensedDistributionRecipe;
+import eu.etaxonomy.cdm.format.description.distribution.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
old mode 100755 (executable)
new mode 100644 (file)
index efbf991..15f1d45
@@ -15,7 +15,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.api.service.ITermService;
@@ -37,7 +38,7 @@ public class CdmPreferenceCache {
 
     private static CdmPreferenceCache instance;
 
-    private final static Logger logger = LogManager.getLogger(CdmPreferenceCache.class);
+    private final static Logger logger = LogManager.getLogger();
 
     public static CdmPreferenceCache instance(){
         if(instance == null){
index 2d01c06d11eea685b9ab78aff3b552cf4235fb68..7e2ec014d9cfd0b8ee534f5b22c18ef1f36c7bae 100644 (file)
@@ -6,7 +6,6 @@
  * 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.preference;
 
 import org.eclipse.core.expressions.PropertyTester;
@@ -16,13 +15,11 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author n.hoffmann
  * @created Jan 26, 2011
- * @version 1.0
  */
 public class CdmStorePropertyTester extends PropertyTester {
 
     private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
     private static final String IS_REMOTING = "isRemoting";
-    private static final String IS_STANDALONE = "isStandAlone";
     private static final String IS_CONNECTED_AND_NOT_LOCAL_ACTIVATED = "isCdmStoreConnectedAndNotLocalActivated";
     private static final String IS_CONNECTED_AND_LOCAL_ACTIVATED = "isCdmStoreConnectedAndLocalActive";
 
@@ -38,17 +35,10 @@ public class CdmStorePropertyTester extends PropertyTester {
             if(!isCdmStoreConnected()) {
                 return false;
             } else {
-                return isRemoting();
+                return true;
             }
         }
 
-        if(IS_STANDALONE.equals(property)){
-            if(!isCdmStoreConnected()) {
-                return false;
-            } else {
-                return !isRemoting();
-            }
-        }
         if(IS_CONNECTED_AND_NOT_LOCAL_ACTIVATED.equals(property)){
             return isCdmStoreConnectedAndNotLocalActive();
         }
@@ -73,8 +63,4 @@ public class CdmStorePropertyTester extends PropertyTester {
         active = active & PreferencesUtil.getLocalActive();
         return active;
     }
-
-    private boolean isRemoting() {
-        return CdmStore.getCurrentSessionManager().isRemoting();
-    }
 }
index 9f8930c527e94eabc52179a94d935b1ee3461007..ce634987fe97c3892adba1286937009ba4310511 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;\r
 \r
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;\r
+import eu.etaxonomy.cdm.model.metadata.DistributionDescription;\r
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;\r
 import eu.etaxonomy.cdm.model.metadata.TermComboEnum;\r
 import eu.etaxonomy.cdm.model.metadata.TermDisplayEnum;\r
@@ -52,10 +53,10 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
     protected TermDisplayEnum displayStatus;\r
     protected TermComboEnum displayStatusCombo;\r
     protected TermDisplayEnum displayArea;\r
-    protected Boolean ownDescriptionForDistributionEditor;\r
+    protected DistributionDescription descriptionForDistributionEditor;\r
     protected Integer numberOfStatus;\r
 \r
-    protected boolean overrideOwnDescriptionForDistributionEditor;\r
+    protected boolean overrideDescriptionForDistributionEditor;\r
     protected boolean overrideAreaVoc;\r
     protected boolean overrideRank;\r
     protected boolean overrideOrderAreas;\r
@@ -75,7 +76,8 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
     protected Button allowOverrideAreaDisplayButton;\r
     protected Combo statusSortSelectionCombo;\r
     protected Button allowOverrideStatusSortButton;\r
-\r
+    protected Combo descriptionSelectionCombo;\r
+    protected Button allowOverrideDescriptionSelectionButton;\r
 \r
     protected Text numberOfStatusText;\r
     protected Button allowOverrideNumberOfStatusButton;\r
@@ -89,7 +91,7 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
     protected CdmPreference prefStatusDisplayInCombo;\r
     protected CdmPreference prefAreaSort;\r
     protected CdmPreference prefRank;\r
-    protected CdmPreference prefOwnDescription;\r
+    protected CdmPreference prefDescription;\r
     protected CdmPreference prefNumberStatus;\r
     protected CdmPreference prefStatusSort;\r
     Composite child;\r
@@ -387,6 +389,43 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
                 });\r
             }\r
 \r
+            //===\r
+            descriptionSelectionCombo = createCombo(child, DistributionDescription.values(),\r
+                    PreferencePredicate.DescriptionForDistributionEditor, Messages.ChecklistEditorGeneralPreference_own_Description, isAdminPreference);\r
+            index = 0;\r
+            for (String itemLabel : descriptionSelectionCombo.getItems()) {\r
+                if (descriptionForDistributionEditor == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {\r
+                    descriptionSelectionCombo.select(index);\r
+                    break;\r
+                }\r
+                if (descriptionForDistributionEditor != null && descriptionForDistributionEditor.getLabel().equals(itemLabel)){\r
+                    descriptionSelectionCombo.select(index);\r
+                    break;\r
+                }\r
+                \r
+                index++;\r
+            }\r
+            descriptionSelectionCombo.addSelectionListener(this);\r
+            if (isAdminPreference) {\r
+                allowOverrideDescriptionSelectionButton = createAllowOverrideButton(child);\r
+                allowOverrideDescriptionSelectionButton.setSelection(prefDescription != null? prefDescription.isAllowOverride():true);\r
+                allowOverrideDescriptionSelectionButton.addSelectionListener(new SelectionAdapter() {\r
+                    @Override\r
+                    public void widgetSelected(SelectionEvent e) {\r
+                        setApply(true);\r
+                        if (prefDescription == null){\r
+                            prefDescription = CdmPreference.NewTaxEditorInstance(PreferencePredicate.DescriptionForDistributionEditor, PreferencePredicate.DescriptionForDistributionEditor.getDefaultValue() != null ?  PreferencePredicate.DescriptionForDistributionEditor.getDefaultValue().toString(): null);\r
+                        }\r
+                        prefDescription.setAllowOverride(allowOverrideDescriptionSelectionButton.getSelection());\r
+                    }\r
+                });\r
+            }\r
+\r
+\r
+            \r
+            //====\r
+            \r
+            \r
 \r
 \r
             final CLabel description = new CLabel(child, SWT.NULL);\r
@@ -481,6 +520,9 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
                 if (prefNumberStatus != null && !prefNumberStatus.isAllowOverride()){\r
                     numberOfStatusText.setEnabled(false);\r
                 }\r
+                if (prefDescription != null && !prefDescription.isAllowOverride()){\r
+                    descriptionSelectionCombo.setEnabled(false);\r
+                }\r
             }\r
 \r
         }\r
@@ -569,6 +611,14 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
             }\r
             PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(\r
                     PreferencePredicate.NumberOfVisibleStatusInDropDown.getKey()), override);\r
+            \r
+            override = false;\r
+            if (descriptionForDistributionEditor != null) {\r
+                override = true;\r
+                PreferencesUtil.setStringValue(PreferencePredicate.DescriptionForDistributionEditor.getKey(), descriptionForDistributionEditor.getKey());\r
+            }\r
+            PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(\r
+                    PreferencePredicate.DescriptionForDistributionEditor.getKey()), override);\r
 \r
 \r
             PreferencesUtil.firePreferencesChanged(this.getClass());\r
@@ -668,6 +718,20 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
                 isShowRank = false;\r
             }\r
         }\r
+        \r
+        if (e.getSource().equals(this.descriptionSelectionCombo)) {\r
+            String text = descriptionSelectionCombo.getText();\r
+            if(text.startsWith(Messages.Preference_Use_Default)){\r
+                descriptionForDistributionEditor = null;\r
+                return;\r
+            }\r
+            \r
+            if (text.equals(DistributionDescription.AlwaysDefault.getLabel())){\r
+                descriptionForDistributionEditor = DistributionDescription.AlwaysDefault;\r
+            }else{\r
+                descriptionForDistributionEditor = DistributionDescription.UseAlreadyExisting;\r
+            }\r
+        }\r
 \r
 \r
         if (e.getSource().equals(this.activateCombo)) {\r
@@ -919,21 +983,36 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
 \r
         }\r
 \r
-        prefOwnDescription = PreferencesUtil\r
-                .getPreferenceFromDB(PreferencePredicate.OwnDescriptionForDistributionEditor);\r
-        if (prefOwnDescription != null) {\r
-            if (prefOwnDescription.isAllowOverride()) {\r
-                ownDescriptionForDistributionEditor = PreferencesUtil.isOwnDescriptionForChecklistEditor();\r
+        prefDescription = PreferencesUtil\r
+                .getPreferenceFromDB(PreferencePredicate.DescriptionForDistributionEditor);\r
+        overrideDescriptionForDistributionEditor = PreferencesUtil.getBooleanValue(\r
+                PreferencesUtil.prefOverrideKey(PreferencePredicate.DescriptionForDistributionEditor.getKey()), true) != null? PreferencesUtil.getBooleanValue(\r
+                        PreferencesUtil.prefOverrideKey(PreferencePredicate.DescriptionForDistributionEditor.getKey()), true): false;\r
+        if (prefDescription != null) {\r
+            if (prefDescription.isAllowOverride()) {\r
+                if (overrideDescriptionForDistributionEditor) {\r
+                    String str =  PreferencesUtil.getStringValue(PreferencePredicate.DescriptionForDistributionEditor.getKey());\r
+                    if (str == null) {\r
+                        descriptionForDistributionEditor = null;\r
+                    }else {\r
+                        descriptionForDistributionEditor = DistributionDescription.byKey(str);\r
+                    }                \r
+                }\r
             } else {\r
-                ownDescriptionForDistributionEditor = prefOwnDescription.getValue() != null? Boolean.valueOf(prefOwnDescription.getValue().toString()): null;\r
+                descriptionForDistributionEditor = prefDescription.getValue() != null? DistributionDescription.byKey(prefDescription.getValue().toString()): null;\r
             }\r
         } else {\r
-            ownDescriptionForDistributionEditor = PreferencesUtil.isShowRankInChecklistEditor();\r
-            // allowOverrideOwnDescriptionForDistributionEditor = true;\r
-            overrideOwnDescriptionForDistributionEditor = PreferencesUtil.getBooleanValue(\r
-                    PreferencesUtil.prefOverrideKey(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey()), true) != null? PreferencesUtil.getBooleanValue(\r
-                            PreferencesUtil.prefOverrideKey(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey()), true): false;\r
-            //prefOwnDescription = CdmPreference.NewTaxEditorInstance(PreferencePredicate.OwnDescriptionForDistributionEditor, PreferencePredicate.OwnDescriptionForDistributionEditor.getDefaultValue() != null ?  PreferencePredicate.OwnDescriptionForDistributionEditor.getDefaultValue().toString(): null);\r
+            if (overrideDescriptionForDistributionEditor) {\r
+                String str =  PreferencesUtil.getStringValue(PreferencePredicate.DescriptionForDistributionEditor.getKey());\r
+                if (str == null) {\r
+                    descriptionForDistributionEditor = null;\r
+                }else {\r
+                    descriptionForDistributionEditor = DistributionDescription.byKey(str);\r
+                }\r
+            }else {\r
+                descriptionForDistributionEditor = null;\r
+            }\r
+            \r
         }\r
 \r
 \r
@@ -1015,7 +1094,9 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
             index++;\r
         }\r
 \r
-        ownDescriptionForDistributionEditor = null;\r
+        descriptionForDistributionEditor = null;\r
+        descriptionSelectionCombo.select(0);\r
+        \r
         if (prefNumberStatus == null){\r
             numberOfStatusText.setText(PreferencePredicate.NumberOfVisibleStatusInDropDown.getDefaultValue().toString());\r
         }else{\r
@@ -1033,13 +1114,14 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
             allowOverrideOrderAreasButton.setSelection(true);\r
             allowOverrideRankButton.setSelection(true);\r
             allowOverrideNumberOfStatusButton.setSelection(true);\r
+            allowOverrideDescriptionSelectionButton.setSelection(true);\r
         }\r
         overrideActivated = true;\r
         overrideAreaDisplay = true;\r
         overrideStatusDisplay = true;\r
         overrideOrderAreas = true;\r
         overrideRank = true;\r
-        overrideOwnDescriptionForDistributionEditor = true;\r
+        overrideDescriptionForDistributionEditor = true;\r
         overrideNumberOfStatus = true;\r
 \r
         if (!isAdminPreference) {\r
old mode 100755 (executable)
new mode 100644 (file)
index a3455f3..e5966fe
@@ -11,14 +11,13 @@ package eu.etaxonomy.taxeditor.preference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.preference.wizard.GeneralVocabularyPreferencePage;
 
 /**
  * @author k.luther
  * @since 05.10.2018
  *
  */
-public class CommonNameVocabularyPreferencePage extends GeneralVocabularyPreferencePage implements IE4PreferencePage {
+public class CommonNameVocabularyPreferencePage extends NamedAreaVocabularyPreferencePage{//GeneralVocabularyPreferencePage implements IE4PreferencePage {
 
 
     public CommonNameVocabularyPreferencePage(){
old mode 100755 (executable)
new mode 100644 (file)
index 69e6cdd..f6b0044
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.preference;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.layout.GridLayoutFactory;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -19,7 +19,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.ext.geo.CondensedDistributionRecipe;
+import eu.etaxonomy.cdm.format.description.distribution.CondensedDistributionRecipe;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
@@ -31,7 +31,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author k.luther
  * @since 02.07.2019
- *
  */
 public class DistributionGeneralPreference extends CdmPreferencePage implements SelectionListener {
     protected CdmPreference preferenceCondensedDistribtionRecipe;
old mode 100755 (executable)
new mode 100644 (file)
index 751bea6..a9af09d
@@ -8,7 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.preference;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
old mode 100755 (executable)
new mode 100644 (file)
index ed89d33..d924ec2
@@ -48,6 +48,15 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
 
     protected boolean allowOverrideFreeText;
     private boolean isOverrideFreeText = true;
+    
+    protected Boolean isShowSpecimenAsSource;
+
+    protected Combo comboShowSpecimenAsSource;
+    protected CdmPreference prefShowSpecimenAsSource = null;
+    Button allowOverrideShowSpecimenButton;
+
+    protected boolean allowOverrideSpecimen;
+    private boolean isOverrideSpecimen = true;
 
 
 
@@ -134,6 +143,39 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
             comboShowModifierFreeText.setEnabled(allowOverrideFreeText);
         }
 
+        //Show specimen as source
+        comboShowSpecimenAsSource = createBooleanCombo(composite, SHOW, DO_NOT_SHOW, PreferencePredicate.ShowSpecimenInFactSource, Messages.FactualData_showSpecimenAsSource, isAdminPreference);
+        comboShowSpecimenAsSource.addSelectionListener(this);
+        if (this.isAdminPreference){
+            allowOverrideShowSpecimenButton = createAllowOverrideButton(composite);
+            allowOverrideShowSpecimenButton.setSelection(allowOverrideSpecimen);
+            allowOverrideShowSpecimenButton.addSelectionListener(new SelectionAdapter(){
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    allowOverrideSpecimen = !allowOverrideSpecimen;
+                    setApply(true);
+                    }
+            });
+        }
+        index = 0;
+        if(isShowSpecimenAsSource==null){
+               comboShowSpecimenAsSource.select(0);
+        } else{
+            for (String itemLabel : comboShowSpecimenAsSource.getItems()){
+                if (itemLabel.startsWith(this.SHOW) && isShowSpecimenAsSource){
+                       comboShowSpecimenAsSource.select(index);
+                    break;
+                }
+                if (itemLabel.startsWith(DO_NOT_SHOW) && !isShowSpecimenAsSource){
+                       comboShowSpecimenAsSource.select(index);
+                    break;
+                }
+                index++;
+            }
+        }
+        if (!isAdminPreference){
+               comboShowSpecimenAsSource.setEnabled(allowOverrideSpecimen);
+        }
 
         return composite;
 
@@ -157,6 +199,14 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
             }else{
                 PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowModifierFreeText.getKey()), false);
             }
+            
+            if (isShowSpecimenAsSource != null){
+                PreferencesUtil.setStringValue(PreferencePredicate.ShowSpecimenInFactSource.getKey(), Boolean.toString(isShowSpecimenAsSource));
+                PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenInFactSource.getKey()), true);
+
+            }else{
+                PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenInFactSource.getKey()), false);
+            }
 
         }
         return true;
@@ -176,7 +226,7 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
             isShowModifier = Boolean.valueOf(showModifierString);
         }
 
-        isOverride = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowModifier.getKey()));
+        isOverride = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowModifier.getKey()), true);
         if (!isOverride){
            isShowModifier = null;
         }
@@ -193,10 +243,27 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
             isShowModifierFreeText = Boolean.valueOf(showModifierStringFreeText);
         }
 
-        isOverrideFreeText = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowModifierFreeText.getKey()));
+        isOverrideFreeText = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowModifierFreeText.getKey()), true);
         if (!isOverrideFreeText){
            isShowModifierFreeText = null;
         }
+        
+     // get specimen values
+        prefShowSpecimenAsSource = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.ShowSpecimenInFactSource);
+        if (prefShowSpecimenAsSource == null){
+               prefShowSpecimenAsSource = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimenInFactSource, PreferencePredicate.ShowSpecimenInFactSource.getDefaultValue().toString());
+        }
+        allowOverrideSpecimen = prefShowSpecimenAsSource.isAllowOverride();
+        isShowSpecimenAsSource = null;
+        String showSpecimenString = PreferencesUtil.getStringValue(PreferencePredicate.ShowSpecimenInFactSource.getKey(), true);
+        if (showSpecimenString != null){
+               isShowSpecimenAsSource = Boolean.valueOf(showSpecimenString);
+        }
+
+        isOverrideSpecimen = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowSpecimenInFactSource.getKey()), true);
+        if (!isOverrideSpecimen){
+               isShowSpecimenAsSource = null;
+        }
 
 
     }
@@ -218,6 +285,14 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
        if (isAdminPreference){
             allowOverrideFreeTextButton.setSelection(allowOverrideFreeText);
         }
+       
+       isShowSpecimenAsSource = null;
+       allowOverrideSpecimen = true;
+
+       comboShowSpecimenAsSource.select(0);
+       if (isAdminPreference){
+            allowOverrideShowSpecimenButton.setSelection(allowOverrideSpecimen);
+        }
         setApply(true);
         super.performDefaults();
     }
@@ -254,6 +329,23 @@ public class FactualDataPreference extends CdmPreferencePage implements Selectio
             }
 
         }
+        
+        if (e.getSource().equals(this.comboShowSpecimenAsSource)) {
+            String text = comboShowSpecimenAsSource.getText();
+            if (text.startsWith(Messages.Preference_Use_Default)){
+                isOverrideSpecimen = false;
+                isShowSpecimenAsSource = null;
+
+            }else if (text.equals(SHOW)){
+               isShowSpecimenAsSource = true;
+               isOverrideSpecimen = true;
+            }else{
+               isShowSpecimenAsSource = false;
+               isOverrideSpecimen = true;
+            }
+
+        }
+
         setApply(true);
 
     }
index 8c93430c895da64177ab4ce20ba0fa475991860d..bfece848b4c044a819c732b166c426e56c93ec32 100644 (file)
@@ -9,9 +9,7 @@
 package eu.etaxonomy.taxeditor.preference;
 
 import java.io.IOException;
-import java.util.Locale;
 
-import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CCombo;
@@ -24,10 +22,10 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.PlatformUI;
 
-import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.metadata.IKeyLabel;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author n.hoffmann
@@ -36,7 +34,7 @@ import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
 public class LanguageEditorPreferencePage extends CdmPreferencePage {
 
     private CCombo combo;
-    PreferencesUtil preferencesUtil = new PreferencesUtil();
+    
     private boolean isSelectionChanged = false;
     private int initalSelectionIndex;
 
@@ -82,6 +80,7 @@ public class LanguageEditorPreferencePage extends CdmPreferencePage {
 //                    preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
                     if(initalSelectionIndex != combo.getSelectionIndex()) {
                         isSelectionChanged = true;
+                        
                     }else{
                         isSelectionChanged = false;
                     }
@@ -115,11 +114,11 @@ public class LanguageEditorPreferencePage extends CdmPreferencePage {
                 combo.select(0);
             }
         }else{
-            Locale locale = Locale.getDefault();
-            if(locale.getLanguage().equals(new Locale("de").getLanguage())){
+            eu.etaxonomy.cdm.model.common.Language defaultLanguage = CdmStore.getDefaultLanguage();
+            if(defaultLanguage.equals(eu.etaxonomy.cdm.model.common.Language.GERMAN())){
                 initalSelectionIndex = 0;
                 combo.select(0);
-            }else if(locale.getLanguage().equals(new Locale("en").getLanguage())){
+            }else if(defaultLanguage.equals(eu.etaxonomy.cdm.model.common.Language.ENGLISH())){
                 initalSelectionIndex = 1;
                 combo.select(1);
             }
@@ -140,6 +139,7 @@ public class LanguageEditorPreferencePage extends CdmPreferencePage {
         /**
          * @return the label
          */
+        @Override
         public String getLabel() {
             return label;
         }
@@ -152,21 +152,24 @@ public class LanguageEditorPreferencePage extends CdmPreferencePage {
 
        @Override
        public boolean performOk() {
-        try {
-            if(isSelectionChanged){
-               int i = combo.getSelectionIndex();
-                preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
-                String test = combo.getItem(combo.getSelectionIndex());
-                
-                boolean result = MessageDialog.openConfirm(getShell(), Messages.LanguageEditorPreferencePage_PleaseRestart, Messages.LanguageEditorPreferencePage_EditorHasToRestart);
-                if(result){
-                    //Press Ok
-                    PlatformUI.getWorkbench().restart();
-                }
+          
+        if (isSelectionChanged) {
+               
+               try {
+                   PreferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
+               }catch(IOException e) {
+                   e.printStackTrace();
+               }
+               
+            
+            boolean result = MessageDialog.openConfirm(getShell(), Messages.LanguageEditorPreferencePage_PleaseRestart, Messages.LanguageEditorPreferencePage_EditorHasToRestart);
+            if(result){
+                //Press Ok
+                PlatformUI.getWorkbench().restart();
             }
-        } catch (IOException e) {
-            e.printStackTrace();
         }
+        
+      
                return super.performOk();
        }
 }
\ No newline at end of file
index 866e88556db4d5d48d4e43f676249806c4fbf786..57c65d6a1970b6bddd1569bb5b7addc8ca7ac88c 100644 (file)
 package eu.etaxonomy.taxeditor.preference;\r
 \r
 import java.util.List;\r
+import java.util.UUID;\r
 \r
 import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.custom.CLabel;\r
 import org.eclipse.swt.events.SelectionAdapter;\r
 import org.eclipse.swt.events.SelectionEvent;\r
 import org.eclipse.swt.layout.GridLayout;\r
-import org.eclipse.swt.layout.RowLayout;\r
+import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Combo;\r
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Control;\r
 import org.eclipse.swt.widgets.Label;\r
 \r
 import eu.etaxonomy.cdm.model.common.Language;\r
+import eu.etaxonomy.cdm.model.metadata.CdmPreference;\r
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;\r
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
+import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.taxeditor.l10n.Messages;\r
 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
@@ -34,7 +40,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class LanguageRepresentationPreferencePage extends CdmPreferencePage{\r
 \r
 \r
-       private Language globalLanguage;\r
+       protected Language globalLanguage;\r
+       public final static String ID = "eu.etaxonomy.taxeditor.preferences.termLanguages"; //$NON-NLS-1$\r
+\r
+    protected CdmPreference termLanguagePref =null;\r
+    protected boolean overrideActivated;\r
+    protected Button allowOverrideOrderButton;\r
+    private String defaultSettings = "Default settings";\r
+    protected Combo combo_globalLanguage;\r
 \r
 //     private Composite createComposite(Composite parent){\r
 //             Composite composite = new Composite(parent, SWT.NULL);\r
@@ -59,79 +72,150 @@ public class LanguageRepresentationPreferencePage extends CdmPreferencePage{
        }\r
 \r
        private void createSetDefaultLanguage(Composite parent) {\r
-               globalLanguage = PreferencesUtil.getGlobalLanguage();\r
-\r
-               if(globalLanguage == null) {\r
-                   return;\r
-               }\r
+               getValues();\r
 \r
                int curentSelectionIndex = 0;\r
 \r
                final Composite composite = createComposite(parent);\r
-               composite.setLayout(new RowLayout(1));\r
-\r
-               final Label label = new Label(composite, SWT.NONE);\r
-               label.setText(Messages.LanguageRepresentationPreferencePage_global);\r
-\r
-               final Combo combo_globalLanguage = new Combo(composite, SWT.NONE);\r
-\r
-               List<Language> preferredLanguages = CdmStore.getTermManager().getPreferredTerms(Language.class);\r
-\r
-               for(int i = 0; i < preferredLanguages.size(); i++){\r
-                       Language language = preferredLanguages.get(i);\r
-                       combo_globalLanguage.add(language.getLabel(), i);\r
-                       if(language.equals(globalLanguage)){\r
-                               curentSelectionIndex = i;\r
-                       }\r
-               }\r
-\r
-               combo_globalLanguage.select(curentSelectionIndex);\r
+               GridLayout layout = new GridLayout();\r
+           layout.numColumns = 2;\r
+           composite.setLayout(layout);\r
+\r
+           if (isAdminPreference || !isAdminPreference && this.termLanguagePref.isAllowOverride()) {\r
+               final Label label = new Label(composite, SWT.NONE);\r
+               label.setText(Messages.LanguageRepresentationPreferencePage_global);\r
+               final Label labelFree = new Label(composite, SWT.NONE);\r
+           // label.setText(Messages.LanguageRepresentationPreferencePage_global);\r
+\r
+               //combo_globalLanguage = new Combo(composite, SWT.NONE);\r
+               \r
+               List<DefinedTermBase> preferredLanguages = CdmStore.getTermManager().getPreferredTerms(TermType.Language);\r
+               combo_globalLanguage = createComboTerms(composite, preferredLanguages, PreferencePredicate.TermLanguage, "Term Language", Language.getDefaultLanguage() , isAdminPreference);\r
+\r
+\r
+\r
+               for(int i = 0; i < preferredLanguages.size(); i++){\r
+                       Language language = (Language)preferredLanguages.get(i);\r
+                       \r
+                       if(language.equals(globalLanguage)){\r
+                               curentSelectionIndex = i;\r
+                       }\r
+               }\r
+\r
+               if (curentSelectionIndex != 0) {\r
+                   curentSelectionIndex ++;\r
+               }\r
+               combo_globalLanguage.select(curentSelectionIndex);\r
+\r
+               combo_globalLanguage.addSelectionListener(new SelectionAdapter() {\r
+                       /* (non-Javadoc)\r
+                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)\r
+                        */\r
+                       @Override\r
+                       public void widgetSelected(SelectionEvent e) {\r
+\r
+                               int selectionIndex = combo_globalLanguage.getSelectionIndex();\r
+                               if (combo_globalLanguage.getItem(selectionIndex).startsWith(Messages.Preference_Use_Default)){\r
+                                   if (isAdminPreference) {\r
+                                       globalLanguage = null;\r
+                                   }\r
+                           overrideActivated = false;\r
+                       }else {\r
+                           globalLanguage = (Language)combo_globalLanguage.getData(combo_globalLanguage.getItem(selectionIndex));\r
+                           overrideActivated = true;\r
+                       }\r
+                               setApply(true);\r
+                       }\r
+               });\r
+           }else {\r
+               //changing the Term Language locally is not allowed\r
+               final CLabel description = new CLabel(parent, SWT.NULL);\r
+            description.setText(Messages.LanguageRepresentationPreferencePage_not_available);\r
+            this.setDefaultButtonActivated(false);\r
+           }\r
 \r
-               combo_globalLanguage.addSelectionListener(new SelectionAdapter() {\r
-                       /* (non-Javadoc)\r
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)\r
-                        */\r
-                       @Override\r
-                       public void widgetSelected(SelectionEvent e) {\r
 \r
-                               int selectionIndex = combo_globalLanguage.getSelectionIndex();\r
-                               globalLanguage = CdmStore.getCurrentApplicationConfiguration().getTermService().getLanguageByLabel(combo_globalLanguage.getItem(selectionIndex));\r
-                               setApply(true);\r
-                       }\r
-               });\r
+       if (isAdminPreference) {\r
+            allowOverrideOrderButton = createAllowOverrideButton(composite);\r
+            allowOverrideOrderButton.setSelection(termLanguagePref != null? termLanguagePref.isAllowOverride(): true);\r
+            //allowOverrideOrderAreasButton.setEnabled(prefAreaSort != null);\r
+            allowOverrideOrderButton.addSelectionListener(new SelectionAdapter() {\r
+                @Override\r
+                public void widgetSelected(SelectionEvent e) {\r
+                    setApply(true);\r
+                    if (termLanguagePref == null){\r
+                        termLanguagePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, PreferencePredicate.TermLanguage.getDefaultValue() != null ?  PreferencePredicate.TermLanguage.getDefaultValue().toString(): null);\r
+                    }\r
+                    termLanguagePref.setAllowOverride(allowOverrideOrderButton.getSelection());\r
+                }\r
+            });\r
+        }\r
        }\r
 \r
-//     private void createSetMultiLanguageTextEditingCapability(Composite parent) {\r
-//             isMultilanguageTextEditingCapability = PreferencesUtil.getBooleanValue(IPreferenceKeys.MULTILANGUAGE_TEXT_EDITING_CAPABILITY);\r
-//\r
-//             final Composite composite = createComposite(parent);\r
-//\r
-//             final Button button_toggle = new Button(composite, SWT.CHECK);\r
-//\r
-//\r
-//             button_toggle.setText(Messages.LanguageRepresentationPreferencePage_enable);\r
-//\r
-//             button_toggle.setSelection(isMultilanguageTextEditingCapability);\r
-//\r
-//\r
-//             button_toggle.addSelectionListener(new SelectionAdapter(){\r
-//                     /* (non-Javadoc)\r
-//                      * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)\r
-//                      */\r
-//                     @Override\r
-//                     public void widgetSelected(SelectionEvent e) {\r
-//                         setApply(true);\r
-//                             isMultilanguageTextEditingCapability = button_toggle.getSelection();\r
-//                     }\r
-//             });\r
-//     }\r
+\r
+       @Override\r
+    public void getValues() {\r
+        isAdminPreference = false;\r
+        setPreferenceStore(PreferencesUtil.getPreferenceStore());\r
+        termLanguagePref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.TermLanguage);\r
+        overrideActivated = PreferencesUtil.getBooleanValue(\r
+                PreferencesUtil.prefOverrideKey(PreferencePredicate.TermLanguage.getKey()), true) != null? PreferencesUtil.getBooleanValue(\r
+                        PreferencesUtil.prefOverrideKey(PreferencePredicate.TermLanguage.getKey()), true):false;\r
+        if (termLanguagePref != null) {\r
+            if (termLanguagePref.isAllowOverride() && overrideActivated) {\r
+                String globalLanguageUUIDString = PreferencesUtil.getStringValue(PreferencePredicate.TermLanguage.getKey(), true);\r
+                if (globalLanguageUUIDString != null) {\r
+                    globalLanguage = Language.getLanguageFromUuid(UUID.fromString( globalLanguageUUIDString));\r
+                }else {\r
+                    globalLanguage = Language.getDefaultLanguage();\r
+                }\r
+                //globalLanguage = Language.getLanguageFromUuid(UUID.fromString(PreferencesUtil.getStringValue(PreferencePredicate.TermLanguage.getKey(), true)));\r
+            } else {\r
+                if(!overrideActivated){\r
+                    globalLanguage = null;\r
+                }else{\r
+                    globalLanguage = termLanguagePref.getValue() != null? Language.getLanguageFromUuid(UUID.fromString(termLanguagePref.getValue())): CdmStore.getDefaultLanguage();\r
+                }\r
+            }\r
+\r
+        } else {\r
+            if(!overrideActivated){\r
+                globalLanguage = null;\r
+            }else{\r
+                String globalLanguageUUIDString = PreferencesUtil.getStringValue(PreferencePredicate.TermLanguage.getKey(), true);\r
+                if (globalLanguageUUIDString != null) {\r
+                    globalLanguage = Language.getLanguageFromUuid(UUID.fromString( globalLanguageUUIDString));\r
+                }else {\r
+                    globalLanguage = Language.getDefaultLanguage();\r
+                }\r
+            }\r
+            termLanguagePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.TermLanguage, PreferencePredicate.TermLanguage.getDefaultValue() != null ?  PreferencePredicate.TermLanguage.getDefaultValue().toString(): null);\r
+        }\r
+ }\r
 \r
        @Override\r
        public boolean performOk() {\r
            if (!isApply()){\r
                return true;\r
            }\r
+           //check whether a language or the option to use the db selection was chosen\r
            PreferencesUtil.setGlobalLanguage(globalLanguage);\r
+          // if (overrideActivated) {\r
+        PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.TermLanguage.getKey()), overrideActivated);\r
+       // }\r
                return super.performOk();\r
        }\r
+       \r
+       @Override\r
+    protected void performDefaults() {\r
+\r
+           globalLanguage =  null;\r
+           \r
+           combo_globalLanguage.select(0);\r
+           overrideActivated = false;\r
+        \r
+        setApply(true);\r
+\r
+    }\r
+       \r
 }\r
old mode 100755 (executable)
new mode 100644 (file)
index 51fba82..196ba6f
@@ -15,6 +15,7 @@ import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Iterator;
 
 import javax.swing.event.DocumentEvent;
 
@@ -40,9 +41,9 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.List;
 import org.eclipse.swt.widgets.Text;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
@@ -68,7 +69,7 @@ public class ListComponent implements ModifyListener
     CdmPreferencePage preferencePage;
     CdmPreference providerListPreference;
     String providerList;
-    String[] items;
+    java.util.List<String> items;
 
     public CdmPreference getProviderListPreference() {
         return providerListPreference;
@@ -163,29 +164,17 @@ public class ListComponent implements ModifyListener
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
-
-        JSONArray jsonResponseArray;
+        java.util.List<BiocaseProvideConfig> listProvider = null;
+        ObjectMapper mapper = new ObjectMapper();
         try {
-            jsonResponseArray =new JSONArray(response);
-
-            int i = 0;
-            String service_url = null;
-            JSONArray dataSets = null;
-            items = new String[jsonResponseArray.length()];
-            while (i<jsonResponseArray.length()){
-                JSONObject object = jsonResponseArray.getJSONObject(i);
-                service_url = (String) object.get("service_url");
-                dataSets = (JSONArray) object.get("datasets");
-                if (service_url != null){
-                    providerURI.add(service_url);
-                    items[i] = service_url;
-                }
-                i++;
-            }
-
-        } catch (JSONException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            listProvider = mapper.readValue(response, new TypeReference<java.util.List<BiocaseProvideConfig>>(){});
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        items = new ArrayList<>();
+        for (BiocaseProvideConfig conf: listProvider) {
+            items.add(conf.getService_url());
+            providerURI.add(conf.getService_url());
         }
 
         GridData dataProviderUri = new GridData();
@@ -239,14 +228,17 @@ public class ListComponent implements ModifyListener
             @Override
             public IContentProposal[] getProposals(String contents, int position) {
                 //String[] items = getStringItems();
-                if (contents.length() == 0 || items.length == 0) {
+                if (contents.length() == 0 || items.isEmpty()) {
                     return new IContentProposal[0];
                 }
                 StringMatcher matcher = new StringMatcher("*" + contents + "*", true, false); //$NON-NLS-1$ //$NON-NLS-2$
-                ArrayList<String> matches = new ArrayList<String>();
-                for (int i = 0; i < items.length; i++) {
-                    if (matcher.match(items[i])) {
-                        matches.add(items[i]);
+                java.util.List<String> matches = new ArrayList<>();
+                Iterator<String> itemsIterator = items.iterator();
+                String nextItem = null;
+                while (itemsIterator.hasNext()) {
+                    nextItem = itemsIterator.next();
+                    if (matcher.match(nextItem) ) {
+                        matches.add(nextItem);
                     }
                 }
 
index d5db7462be35be9030024f067db7c8450ce8b62f..d08f298593d8a0093f97f579d4c918656ca4544a 100644 (file)
@@ -28,6 +28,7 @@ public class NameDetailsConfigurator {
     boolean isRankActivated = true;
     boolean isAtomisedEpithetsActivated = true;
     boolean isAuthorshipSectionActivated = true;
+    boolean isInAuthorshipActivated = false;
     boolean isAuthorCacheActivated = true;
     boolean isNomenclaturalReferenceSectionActivated = true;
     boolean isNomenclaturalStatusSectionActivated = true;
@@ -120,6 +121,14 @@ public class NameDetailsConfigurator {
         this.isAuthorshipSectionActivated = isAuthorshipSectionActivated;
     }
 
+    public boolean isInAuthorshipActivated() {
+        return isInAuthorshipActivated;
+    }
+
+    public void setInAuthorshipActivated(boolean isInAuthorshipActivated) {
+        this.isInAuthorshipActivated = isInAuthorshipActivated;
+    }
+
     public boolean isNomenclaturalReferenceSectionActivated() {
         return isNomenclaturalReferenceSectionActivated;
     }
index 3440dc1eeb2fceb6325188427246eb417fa5366f..907e072407947c248829149cc5f681ed1ff9a247 100644 (file)
@@ -41,6 +41,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
     protected boolean isShowNomenclaturalStatusRuleConsideredCodeEdition;
     protected boolean isShowNomenclaturalRef;
     protected boolean isShowAuthorship;
+    protected boolean isShowInAuthors;
     protected boolean isShowAuthorCache;
     protected boolean isShowEpithets;
     protected boolean isShowRank;
@@ -67,6 +68,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
     protected Button showEpithets;
     protected Button showAuthorCache;
     protected Button showAuthorship;
+    protected Button showInAuthors;
     protected Button showNomenclaturalRef;
     protected Button showNomenclaturalStatus;
     protected Button showNomenclaturalStatusRuleConsidered;
@@ -258,9 +260,25 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
                      setApply(true);
                      isShowAuthorship = showAuthorship.getSelection();
                      nameDetailsConfig.setAuthorshipSectionActivated(isShowAuthorship);
+                     showInAuthors.setEnabled(isShowAuthorship);
                   }
              });
 
+            showInAuthors = new Button(dbSettings, SWT.CHECK);
+            isShowInAuthors = nameDetailsConfig.isInAuthorshipActivated();
+            showInAuthors.setText(Messages.NameDetailsViewComposite_Show_In_Author);
+            showInAuthors.setSelection(isShowInAuthors);
+            showInAuthors.addSelectionListener(this);
+            showInAuthors.addSelectionListener(new SelectionAdapter(){
+                 @Override
+                 public void widgetSelected(SelectionEvent e) {
+                     setApply(true);
+                     isShowInAuthors = showInAuthors.getSelection();
+                     nameDetailsConfig.setInAuthorshipActivated(isShowInAuthors);
+                  }
+             });
+            showInAuthors.setEnabled(isShowAuthorship);
+
             showNomenclaturalRef = new Button(dbSettings, SWT.CHECK);
             isShowNomenclaturalRef = nameDetailsConfig.isNomenclaturalReferenceSectionActivated();
             showNomenclaturalRef.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalReference);
@@ -501,6 +519,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
         showEpithets.setSelection(isShowEpithets);
         showAuthorCache.setSelection(isShowAuthorCache);
         showAuthorship.setSelection(isShowAuthorship);
+        showInAuthors.setSelection(isShowInAuthors);
         showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
         showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
 
@@ -544,6 +563,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
         isShowAppendedPhrase = nameDetailsConfig.isAppendedPhraseActivated();
         isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
         isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
+        isShowInAuthors = nameDetailsConfig.isInAuthorshipActivated();
         isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
         isShowLSID = nameDetailsConfig.isLSIDActivated();
         isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
old mode 100755 (executable)
new mode 100644 (file)
index 581c0fa..35366af
@@ -8,43 +8,50 @@
 */
 package eu.etaxonomy.taxeditor.preference;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.preference.wizard.GeneralVocabularyPreferencePage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author k.luther
  * @since 12.09.2019
  */
 public class NamedAreaVocabularyPreferencePage extends GeneralVocabularyPreferencePage {
+    List<TermCollectionDto> collList = new ArrayList<>();
 
-    public NamedAreaVocabularyPreferencePage(){
+    public NamedAreaVocabularyPreferencePage() {
         isAdminPreference = false;
         setPredicate(PreferencePredicate.AvailableDistributionAreaVocabularies);
         type = TermType.NamedArea;
-
     }
 
+    @Override
+    protected void initialiseVocabularies() {
 
+        List<TermVocabularyDto> vocs = new ArrayList<>();
+        collList = CdmStore.getService(ITermCollectionService.class).findCollectionDtoByTermType(type);
 
+    }
 
-//    @Override
-//    protected void performDefaults() {
-//        if (!isAdminPreference){
-//            if (!pref.isAllowOverride()) {
-//                button_openSelectAreaVocabularies.setButtonEnabled(false);
-//            }
-//
-//        }
-//
-//        prefAreaVoc = null;
-//        refresh();
-//        setApply(true);
-//
-//    }
-
+    protected List<TermCollectionDto> getCollections() {
 
+        return collList;
+    }
 
+    @Override
+    protected void setInput() {
+        treeComposite.getViewer().getTree().deselectAll();
+        treeComposite.getViewer().refresh();
+        List<TermCollectionDto> collList = new ArrayList<>(getCollections());
 
+        treeComposite.getViewer().setInput(collList);
+    }
 
-}
+}
\ No newline at end of file
index 31da9178aac2fbda404d3448029d4ee2b8bbe9e8..2a3091879ad76f5cbd95b63a285115ff832545c3 100644 (file)
@@ -41,7 +41,7 @@ public class PreferencePropertyTester extends PropertyTester {
                return isChecklistEditorEnabled();
            }
            if(SHOW_IO_MENU.equals(property)){
-               boolean test = isShowIOMenuEnabled();
+//             boolean test = isShowIOMenuEnabled();
             return isShowIOMenuEnabled();
         }
            if(SHOW_SPECIMEN_MENU.equals(property)){
index 50874562b30cb46fbbad417879c7c0b0b3ab088e..b06da701615c8d2e785f582287d7e574d75d028a 100644 (file)
@@ -6,7 +6,6 @@
  * 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.preference;
 
 import java.io.File;
@@ -20,7 +19,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -35,17 +33,13 @@ import org.eclipse.core.runtime.preferences.ConfigurationScope;
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositoryElement;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeConfigurator;
-import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.ITermTreeService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.api.service.config.FindTaxaAndNamesConfiguratorImpl;
@@ -53,13 +47,14 @@ import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeConfigurator;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
-import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
+import eu.etaxonomy.cdm.model.metadata.DistributionDescription;
 import eu.etaxonomy.cdm.model.metadata.EnabledComputedDescription;
 import eu.etaxonomy.cdm.model.metadata.IPreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
@@ -68,10 +63,10 @@ import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingEnum;
 import eu.etaxonomy.cdm.model.metadata.SecReferenceHandlingSwapEnum;
 import eu.etaxonomy.cdm.model.metadata.TermDisplayEnum;
 import eu.etaxonomy.cdm.model.metadata.TermOrder;
+import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.term.IDefinedTerm;
 import eu.etaxonomy.cdm.model.term.ISimpleTerm;
-import eu.etaxonomy.cdm.model.term.TermBase;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
@@ -86,25 +81,22 @@ import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.match.MatchMode;
 import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper;
 import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.TermStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-import eu.etaxonomy.taxeditor.ui.dialog.DefaultLanguageDialog;
 
 /**
- * <p>
- * PreferencesUtil class.
- * </p>
- *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 05.12.2008
  */
 public class PreferencesUtil implements IPreferenceKeys {
+
+    private final static Logger logger = LogManager.getLogger(PreferencesUtil.class);
+
     private final static String EDITOR_PREFERENCES_NODE = "eu.etaxonomy.taxeditor";
 
     public static final String PREFERRED_TERMS_CHANGE = "preferred_terms";
@@ -118,9 +110,6 @@ public class PreferencesUtil implements IPreferenceKeys {
     private static TermTree<Feature> preferredTaxonFeatureTree;
 
 
-
-    private final static Logger logger = LogManager.getLogger(PreferencesUtil.class);
-
     public static IPreferenceStore getPreferenceStore() {
        return TaxeditorStorePlugin.getDefault().getPreferenceStore();
     }
@@ -588,28 +577,21 @@ public class PreferencesUtil implements IPreferenceKeys {
         }
     }
 
-    public static String getPreferredDefaultLangugae(){
-        String preferredLanguage = getStringValue(DEFAULT_LANGUAGE_EDITOR, true);
-        if(StringUtils.isNotEmpty(preferredLanguage) && StringUtils.isNotBlank(preferredLanguage)){
-            return preferredLanguage;
-        }
-        return null;
-    }
 
     public static Language getPreferredDefaultLanguage(){
-        String preferredLanguage = getStringValue(DEFAULT_LANGUAGE_EDITOR, true);
-        if(StringUtils.isNotEmpty(preferredLanguage) && StringUtils.isNotBlank(preferredLanguage)){
-            if (preferredLanguage.equals(Language.uuidEnglish.toString())) {
-               return Language.ENGLISH();
-            }else if (preferredLanguage.equals(Language.uuidGerman.toString())) {
-               return Language.GERMAN();
-            }else {
-               return Language.ENGLISH();
-            }
+
+
+        String prop = System.getProperty("osgi.nl");
+        if (prop.startsWith("de")) {
+            return Language.GERMAN();
+        }else {
+            return Language.ENGLISH();
         }
-        return Language.getDefaultLanguage();
+
+
+
     }
-    
+
     public static boolean isShowMediaPreview(){
         boolean isShowMediaPreview = getBooleanValue(SHOW_MEDIA_PREVIEW, true);
         return isShowMediaPreview;
@@ -697,22 +679,8 @@ public class PreferencesUtil implements IPreferenceKeys {
         return pattern;
     }
 
-    public static <T extends TermBase> void addTermToPreferredTerms(T term) {
-
-        // VocabularyEnum vocabulary =
-        // VocabularyEnum.getVocabularyEnum(term.getClass());
-        //
-        // getPreferenceStore().setValue(getPreferenceKey(term),
-        // VocabularyStore.getTermVocabulary(vocabulary).getTerms().contains(term));
-        //
-        // firePreferencesChanged(term.getClass());
-    }
-
     /**
      * Construct a unique key using the CdmBase object's uuid
-     *
-     * @param cdmBase
-     * @return
      */
     public static String getPreferenceKey(ISimpleTerm<?> simpleTerm) {
         simpleTerm = HibernateProxyHelper.deproxy(simpleTerm);
@@ -924,19 +892,6 @@ public class PreferencesUtil implements IPreferenceKeys {
                 getPreferenceKey(preferredCode));
     }
 
-    public static void checkDefaultLanguage(){
-        if(PreferencesUtil.getPreferredDefaultLangugae() == null){
-           Shell shell = AbstractUtility.getShell();
-           int open = new DefaultLanguageDialog(shell).open();
-           if(open == Window.OK){
-               PlatformUI.getWorkbench().restart();
-           }
-        }else{
-            //TODO:In case of a reinstall, the config.ini will be overwritten
-            //     here you create config.ini with the stored key from preferences
-        }
-    }
-
     public static String getMapServiceAccessPoint() {
         return getStringValue(PreferencePredicate.EditMapServiceAccessPoint.getKey());
     }
@@ -985,26 +940,35 @@ public class PreferencesUtil implements IPreferenceKeys {
     public static Language getGlobalLanguage() {
 
         String languageUuidString = getStringValue(
-                GLOBAL_LANGUAGE_UUID, true);
+                PreferencePredicate.TermLanguage.getKey(), true);
 
-        if(!CdmStore.isActive()) {
-            MessagingUtils.noDataSourceWarningDialog(languageUuidString);
-            return null;
-        }
+        CdmPreference dbPref = getDBPreferenceValue(PreferencePredicate.TermLanguage.getKey());
 
-        if (CdmUtils.isBlank(languageUuidString)) {
-            return Language.getDefaultLanguage();
+        if (dbPref == null || (dbPref != null && dbPref.isAllowOverride() && getOverrideForPreference(PreferencePredicate.TermLanguage.getKey()))) {
+            if (CdmUtils.isBlank(languageUuidString)) {
+                return Language.getDefaultLanguage();
+            }else {
+                return Language.getLanguageFromUuid(UUID.fromString(languageUuidString));
+            }
+        }else {
+            languageUuidString = dbPref.getValue();
         }
-
         UUID languageUuid = UUID.fromString(languageUuidString);
-        return (Language) CdmStore.getService(ITermService.class).load(
-                languageUuid);
+        Language language = (Language)CdmApplicationState.getTermProxy().load(languageUuid);
+        if (language != null){
+            return language;
+        }else{
+            MessagingUtils.noDataSourceWarningDialog(languageUuidString);
+            return null;
+        }
     }
 
     public static void setGlobalLanguage(Language language) {
         if(language != null) {
-            setStringValue(GLOBAL_LANGUAGE_UUID,language.getUuid().toString());
+            setStringValue(PreferencePredicate.TermLanguage.getKey(),language.getUuid().toString());
             CdmStore.setDefaultLanguage(language);
+        }else {
+            CdmStore.setDefaultLanguage(Language.getDefaultLanguage());
         }
     }
 
@@ -1059,13 +1023,14 @@ public class PreferencesUtil implements IPreferenceKeys {
      * @param setLanguage 0 is for german and 1 for english.
      * @throws IOException
      */
-    public void writePropertyToConfigFile(int setLanguage) throws IOException {
+    public static void writePropertyToConfigFile(int setLanguage) throws IOException {
         File file = org.eclipse.core.runtime.preferences.ConfigurationScope.INSTANCE.getLocation().toFile();
         //give warning to user if the directory has no write access
         if(file == null){
             throw new IOException();
         }
-        Properties properties = load(file.getAbsolutePath()+"/config.ini");
+        Properties properties;
+        properties = load(file.getAbsolutePath()+"/config.ini");
         switch(setLanguage){
         case 0:
             properties.setProperty("osgi.nl", "de");
@@ -1079,6 +1044,8 @@ public class PreferencesUtil implements IPreferenceKeys {
             break;
         }
         save(file+"/config.ini", properties);
+
+
     }
 
     /**
@@ -1088,7 +1055,7 @@ public class PreferencesUtil implements IPreferenceKeys {
      * @return
      * @throws IOException
      */
-    private Properties load(String filename) throws IOException {
+    private static Properties load(String filename) throws IOException {
         FileInputStream in = new FileInputStream(filename);
         Properties prop = new Properties();
         prop.load(in);
@@ -1103,7 +1070,7 @@ public class PreferencesUtil implements IPreferenceKeys {
      * @param properties
      * @throws IOException
      */
-    private void save(String filename, Properties properties) throws IOException{
+    private static void save(String filename, Properties properties) throws IOException{
         FileOutputStream fos =  new FileOutputStream(filename);
         properties.store(fos, "");
         fos.close();
@@ -1272,12 +1239,20 @@ public class PreferencesUtil implements IPreferenceKeys {
         setStringValue(PreferencePredicate.DisplayOfAreasInDistributionEditor.getKey(), selection);
     }
 
-    public static void setOwnDescriptionForChecklistEditor(boolean selection) {
-        setBooleanValue(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey(), selection);
+    public static void setDescriptionForChecklistEditor(DistributionDescription selection) {
+        setStringValue(PreferencePredicate.DescriptionForDistributionEditor.getKey(), selection.getKey());
     }
 
-    public static boolean isOwnDescriptionForChecklistEditor() {
-        return getBooleanValue(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey());
+    public static DistributionDescription getDescriptionForChecklistEditor() {
+        String str =  getStringValue(PreferencePredicate.DescriptionForDistributionEditor.getKey());
+
+        DistributionDescription result = null;
+        try {
+            result = DistributionDescription.byKey(str);
+        }catch(IllegalArgumentException e) {
+            result = (DistributionDescription)PreferencePredicate.DescriptionForDistributionEditor.getDefaultValue();
+        }
+        return result;
     }
 
     public static TermDisplayEnum displayAreaInChecklistEditor() {
@@ -1321,7 +1296,7 @@ public class PreferencesUtil implements IPreferenceKeys {
             PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.NameDetailsView);
             preference =  getPreferenceFromDB(PreferencePredicate.NameDetailsView);
             if (preference == null){
-                return null;
+                return  new NameDetailsConfigurator();
             }
 
         //    setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
@@ -1334,10 +1309,8 @@ public class PreferencesUtil implements IPreferenceKeys {
         }
         if (value!= null){
             fillNameDetailsConfigurator(config, value);
-
-
         }else {
-            return null;
+            return new NameDetailsConfigurator();
         }
         return config;
     }
@@ -1371,7 +1344,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         if (value != null){
             fillNameDetailsConfigurator(config, value);
         }else {
-            return null;
+            return new NameDetailsConfigurator();
         }
         return config;
     }
@@ -1476,8 +1449,10 @@ public class PreferencesUtil implements IPreferenceKeys {
                  }
                  if (keyString.equals("ignoreImportOfExistingSpecimen")){
                      config.setIgnoreImportOfExistingSpecimen(Boolean.valueOf(valueString));
-                 }else if (keyString.equals("addIndividualsAssociationsSuchAsSpecimenAndObservations")){
-                     config.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(Boolean.valueOf(valueString));
+                 }else if (keyString.equals("addIndividualsAssociations")){
+                     config.setAddIndividualsAssociations(Boolean.valueOf(valueString));
+                 }else if (keyString.equals("addDeterminations")){
+                     config.setAddDeterminations(Boolean.valueOf(valueString));
                  }else if (keyString.equals("reuseExistingTaxaWhenPossible")){
                      config.setReuseExistingTaxaWhenPossible(Boolean.valueOf(valueString));
                  }else if (keyString.equals("ignoreAuthorship")){
@@ -1561,20 +1536,19 @@ public class PreferencesUtil implements IPreferenceKeys {
     public static Abcd206ImportConfigurator getLastUsedAbcdImportConfigurator(){
         Abcd206ImportConfigurator config = Abcd206ImportConfigurator.NewInstance(null,null);
 
-       String configString = PreferencesUtil.getStringValue(IPreferenceKeys.LAST_USED_ABCD_CONFIG, true);
-       if (configString != null){
-           extractAbcdConfiguratorFromPreferenceString(config, configString);
-           if (config != null){
-               if (config.getNomenclaturalCode() == null){
-                   config.setNomenclaturalCode(getPreferredNomenclaturalCode());
-               }
-           }
-       }else{
-           config = PreferencesUtil.getLocalAbcdImportConfigurator(false);
-       }
+        String configString = PreferencesUtil.getStringValue(IPreferenceKeys.LAST_USED_ABCD_CONFIG, true);
+        if (configString != null){
+            extractAbcdConfiguratorFromPreferenceString(config, configString);
+            if (config != null){
+                if (config.getNomenclaturalCode() == null){
+                    config.setNomenclaturalCode(getPreferredNomenclaturalCode());
+                }
+            }
+        }else{
+            config = PreferencesUtil.getLocalAbcdImportConfigurator(false);
+        }
 
         return config;
-
     }
 
     public static void updateAbcdImportConfigurationPreference() {
@@ -1584,7 +1558,6 @@ public class PreferencesUtil implements IPreferenceKeys {
 
         if (!getBooleanValue(prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey())) || !pref.isAllowOverride()){
             resetToDBPreferenceAbcdCOnfigurator();
-
         }
     }
 
@@ -1646,14 +1619,12 @@ public class PreferencesUtil implements IPreferenceKeys {
                             saveCheckedElements);
                     preference = CdmPreference.NewInstance(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AvailableDistributionAreaTerms, saveCheckedElements);
                     setPreferenceToDB(preference);
-
                 }
             } else{
                 preference = CdmPreference.NewInstance(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AvailableDistributionAreaTerms, saveCheckedElements);
                 setPreferenceToDB(preference);
                 setStringValue(PreferencePredicate.AvailableDistributionAreaTerms.getKey(),
                         saveCheckedElements);
-
             }
         }
     }
@@ -1740,7 +1711,6 @@ public class PreferencesUtil implements IPreferenceKeys {
 
         //Name Details
         NameDetailsConfigurator config = getPreferredNameDetailsConfiguration(false);
-
     }
 
     public static void setPreferencesToDB(List<CdmPreference> preferences) {
@@ -1751,12 +1721,9 @@ public class PreferencesUtil implements IPreferenceKeys {
             for (CdmPreference preference: preferences){
                 if (preference.getValue() == null && preference.isAllowOverride()){
                     controller.getPreferenceService().remove(preference.getKey());
-
                 }else{
                     controller.getPreferenceService().set(preference);
-
                 }
-
             }
             CdmPreferenceCache.instance().getAllTaxEditorDBPreferences();
         }
@@ -1771,10 +1738,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         return getPreferenceStore().contains(prefKey(prefKey));
     }
 
-    /**
-     *
-     */
-    public static TermTree<?> getPreferredFeatureTreeForNameDescription(boolean createNew) {
+    public static TermTree<Feature> getPreferredFeatureTreeForNameDescription(boolean createNew) {
         if(preferredNameFeatureTree != null && !createNew){
             return preferredNameFeatureTree;
         }
@@ -1801,7 +1765,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         if (terms.isEmpty()){
             preferredNameFeatureTree = TermEditorInput.getDefaultNameFeatureTree();
         }else{
-            preferredNameFeatureTree = TermTree.NewInstance(terms);
+            preferredNameFeatureTree = TermTree.NewFeatureInstance(terms);
         }
     }
 
@@ -1857,7 +1821,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         if (terms.isEmpty()){
             preferredTaxonFeatureTree = TermEditorInput.getDefaultFeatureTree();
         }else{
-            preferredTaxonFeatureTree = TermTree.NewInstance(terms);
+            preferredTaxonFeatureTree = TermTree.NewFeatureInstance(terms);
         }
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 16da3b1..ad3a07f
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class RankPreference extends GeneralTermPreferencePage {
 
-    public RankPreference(){
+    public RankPreference() {
         super();
         isAdminPreference = false;
         setPredicate(PreferencePredicate.AvailableRanks);
@@ -49,14 +49,14 @@ public class RankPreference extends GeneralTermPreferencePage {
 
     @Override
     public boolean performOk() {
-        if (!isApply()){
+        if (!isApply()) {
             return true;
         }
         Object[] checkedElements = treeComposite.getViewer().getCheckedElements();
         List<UUID> listUIIDChecked = new ArrayList<>();
         List<TermDto> preferredTerms = new ArrayList<>();
         for (Object o : checkedElements) {
-            if(o instanceof TermDto){
+            if (o instanceof TermDto) {
                 TermDto termDto = (TermDto) o;
                 listUIIDChecked.add(termDto.getUuid());
                 preferredTerms.add(termDto);
@@ -66,10 +66,12 @@ public class RankPreference extends GeneralTermPreferencePage {
 
         PreferencesUtil.setStringValue(PreferencePredicate.AvailableRanks.getKey(), saveCheckedElements);
         String text = this.useLocalOrAdmin.getText();
-        if (text.equals(LocalOrDefaultEnum.Database.getLabel()) || text.equals(LocalOrDefaultEnum.Default.getLabel())){
-            PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableRanks.getKey()), false);
-        }else if (text.equals(LocalOrDefaultEnum.Local.getLabel())){
-            PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableRanks.getKey()), true);
+        if (text.equals(LocalOrDefaultEnum.Database.getLabel()) || text.equals(LocalOrDefaultEnum.Default.getLabel())) {
+            PreferencesUtil.setBooleanValue(
+                    PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableRanks.getKey()), false);
+        } else if (text.equals(LocalOrDefaultEnum.Local.getLabel())) {
+            PreferencesUtil.setBooleanValue(
+                    PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableRanks.getKey()), true);
         }
 
         CdmStore.getTermManager().setPreferredTermsByType(preferredTerms, TermType.Rank);
@@ -78,9 +80,4 @@ public class RankPreference extends GeneralTermPreferencePage {
 
     }
 
-
-
-
-
-
 }
index 6524fcc11aac92a95995f2f25461d80635518c9f..ad346ebe81b9d7bf3878dcdc6e7e203167d7d0b8 100644 (file)
@@ -8,6 +8,8 @@
 */
 package eu.etaxonomy.taxeditor.preference.menu;
 
+import java.util.List;
+
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
@@ -21,6 +23,7 @@ import org.eclipse.swt.widgets.Composite;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.IKeyLabel;
 import eu.etaxonomy.cdm.model.metadata.IPreferencePredicate;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.IE4PreferencePage;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -227,6 +230,54 @@ public abstract class CdmPreferencePage extends PreferencePage implements IE4Pre
 
         return booleanCombo;
     }
+    
+    public Combo createComboTerms(Composite parent, List<DefinedTermBase> values, IPreferencePredicate predicate, String labelText, DefinedTermBase defaultTerm, boolean isAdminPage) {
+        final CLabel description = new CLabel(parent, SWT.NULL);
+        description.setText(labelText);
+        GridData textGrid = createTextGridData();
+        textGrid.verticalSpan = 2;
+        description.setLayoutData(textGrid);
+
+        Combo booleanCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+
+        CdmPreference dbPref = PreferencesUtil.getPreferenceFromDB(predicate);
+        String defaultValue = " - ";
+        if (dbPref != null && !isAdminPage && dbPref.getValue() != null){
+            defaultValue = dbPref.getValue();
+            if (values != null && !values.isEmpty()){
+                for (DefinedTermBase value: values){
+                    if (value.getUuid().toString().equals(defaultValue)){
+                        defaultValue = value.getLabel();
+                    }
+                }
+            }
+        }else {
+            try{
+                Object defaultObject = predicate.getDefaultValue();
+                if (defaultObject != null){
+                    if (defaultObject instanceof DefinedTermBase){
+                        defaultValue = ((DefinedTermBase)defaultObject).getLabel();
+                    }else{
+                        defaultValue = defaultObject.toString();
+                    }
+                }else if (defaultTerm != null) {
+                    defaultValue = defaultTerm.getLabel();
+                }
+            }catch(NullPointerException e){
+                defaultValue = "";
+            }
+        }
+
+        booleanCombo.add(Messages.Preference_Use_Default + " ("+defaultValue+")");
+        if (values != null){
+            for (DefinedTermBase value: values){
+                booleanCombo.add(value.getLabel());
+                booleanCombo.setData(value.getLabel(), value);
+            }
+        }
+
+        return booleanCombo;
+    }
 
     public Boolean getBooleanPrefValue(CdmPreference pref) {
         return pref != null? (pref.getValue()!= null?Boolean.valueOf(pref.getValue()): null): null;
index eb5377d2b22de1f914770e4c10a661bb4e4e8235..11bfd5d544790bb495365a6227dee283ab843d87 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.common.CdmClass;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
@@ -42,20 +43,27 @@ import eu.etaxonomy.taxeditor.preference.wizard.CheckBoxTreeComposite;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FeatureMenuPreferences class.</p>
+ * <p>
+ * FeatureMenuPreferences class.
+ * </p>
  *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 17.09.2008
  * @version 1.0
  */
-public class FeatureMenuPreferences extends GeneralTermPreferencePage{
+public class FeatureMenuPreferences extends GeneralTermPreferencePage {
 
-    /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code> */
+    /**
+     * Constant
+     * <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code>
+     */
     public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.taxonFeature"; //$NON-NLS-1$
 
     /**
-     * <p>Constructor for FeatureMenuPreference.</p>
+     * <p>
+     * Constructor for FeatureMenuPreference.
+     * </p>
      */
     public FeatureMenuPreferences() {
         super();
@@ -68,7 +76,7 @@ public class FeatureMenuPreferences extends GeneralTermPreferencePage{
     protected Control createContents(Composite parent) {
         Composite container = new Composite(parent, SWT.NULL);
         getPreferenceValues();
-        if (isLocalPref() && !allowOverride){
+        if (isLocalPref() && !allowOverride) {
             final CLabel description = new CLabel(parent, SWT.NULL);
             description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
             this.setDefaultButtonActivated(false);
@@ -80,36 +88,37 @@ public class FeatureMenuPreferences extends GeneralTermPreferencePage{
         container.setLayout(gridLayout);
         parent.setLayout(new GridLayout());
         useLocalOrAdmin = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
-        if (!isAdminPreference){
+        if (!isAdminPreference) {
             useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel(), 1);
 
-        }else{
+        } else {
             useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel(), 1);
         }
 
-
-        treeComposite = new CheckBoxTreeComposite(container, new FeatureDtoContentProvider(true, false, false), new TermDtoLabelProvider(), SWT.SCROLL_PAGE);
+        treeComposite = new CheckBoxTreeComposite(container, new FeatureDtoContentProvider(true, false, false),
+                new TermDtoLabelProvider(), SWT.SCROLL_PAGE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         rememberCheckedValues(getCheckedValuesFromPreferences());
 
-        if (isLocalPref()){
-            if (isOverride){
+        if (isLocalPref()) {
+            if (isOverride) {
                 useLocalOrAdmin.select(1);
-            }else{
+            } else {
                 useLocalOrAdmin.select(0);
-                if (treeComposite.getViewer().getTree() != null && treeComposite.getViewer().getTree().getTopItem() != null) {
+                if (treeComposite.getViewer().getTree() != null
+                        && treeComposite.getViewer().getTree().getTopItem() != null) {
                     treeComposite.getViewer().getTree().setSelection(treeComposite.getViewer().getTree().getTopItem());
                 }
                 treeComposite.setEnabled(false);
 
-                //treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
+                // treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
             }
-        }else{
-            if (allowOverride){
+        } else {
+            if (allowOverride) {
                 useLocalOrAdmin.select(0);
-            }else{
+            } else {
                 useLocalOrAdmin.select(1);
             }
         }
@@ -124,13 +133,11 @@ public class FeatureMenuPreferences extends GeneralTermPreferencePage{
 
     }
 
-
-
     @Override
-    public boolean performOk(){
-        if (isApply()){
+    public boolean performOk() {
+        if (isApply()) {
             boolean result = super.performOk();
-            if (result){
+            if (result) {
                 TermEditorInput.getPreferredTaxonFeatureTree(true);
             }
         }
@@ -147,15 +154,14 @@ public class FeatureMenuPreferences extends GeneralTermPreferencePage{
         Set<CdmClass> availableFor = new HashSet<>();
         availableFor.add(CdmClass.TAXON);
         vocs = CdmStore.getService(IVocabularyService.class).findFeatureVocabularyDtoByTermTypes(availableFor);
+        
 
         setVocabularies(vocs);
-//       super.initialiseVocabularies();
-
+        // super.initialiseVocabularies();
 
-
-//       List<TermVocabularyDto> vocs = new ArrayList<>();
-//       vocs.add(CdmStore.getService(IVocabularyService.class).findVocabularyDtoByVocabularyUuid(VocabularyEnum.NameFeature.getUuid()));
-//       this.getVocabularies().removeAll(vocs);
+        // List<TermVocabularyDto> vocs = new ArrayList<>();
+        // vocs.add(CdmStore.getService(IVocabularyService.class).findVocabularyDtoByVocabularyUuid(VocabularyEnum.NameFeature.getUuid()));
+        // this.getVocabularies().removeAll(vocs);
 
     }
 
@@ -165,23 +171,28 @@ public class FeatureMenuPreferences extends GeneralTermPreferencePage{
         ITermService termService = CdmStore.getService(ITermService.class);
         List<UUID> uuidList = new ArrayList();
         for (String s : listValue) {
-            if (!StringUtils.isBlank(s)){
+            if (!StringUtils.isBlank(s)) {
                 UUID uuid = UUID.fromString(s);
                 uuidList.add(uuid);
             }
         }
-        if (!uuidList.isEmpty()){
+        if (!uuidList.isEmpty()) {
             termlist = termService.findFeatureByUUIDsAsDto(uuidList);
         }
 
-        if (listValue == null || listValue.isEmpty() ){
+        if (listValue == null || listValue.isEmpty(){
             termlist = termService.findFeatureByTitleAsDto("");
+            Collection<TermDto> tempTermlist = new ArrayList<>();
+            for (TermDto dto: termlist) {
+                if (((FeatureDto)dto).isAvailableForTaxon()) {
+                    tempTermlist.add(dto);
+                }
+            }
+            termlist = tempTermlist;
 
         }
 
         return new ArrayList(termlist);
     }
 
-
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index ebcc711..d41c49e
@@ -50,13 +50,19 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
-    /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code> */
+    /**
+     * Constant
+     * <code>PLUGIN_ID="eu.etaxonomy.taxeditor.preferences.feat"{trunked}</code>
+     */
     public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.preferences.nameFeature"; //$NON-NLS-1$
 
     @Inject
     private IEventBroker eventBroker;
+
     /**
-     * <p>Constructor for NameFeatureMenuPreference.</p>
+     * <p>
+     * Constructor for NameFeatureMenuPreference.
+     * </p>
      */
     public NameFeatureMenuPreference() {
         super();
@@ -68,7 +74,7 @@ public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
     protected Control createContents(Composite parent) {
         Composite container = new Composite(parent, SWT.NULL);
         getPreferenceValues();
-        if (isLocalPref() && !allowOverride){
+        if (isLocalPref() && !allowOverride) {
             final CLabel description = new CLabel(parent, SWT.NULL);
             description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
             this.setDefaultButtonActivated(false);
@@ -80,36 +86,37 @@ public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
         container.setLayout(gridLayout);
         parent.setLayout(new GridLayout());
         useLocalOrAdmin = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
-        if (!isAdminPreference){
+        if (!isAdminPreference) {
             useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel(), 1);
 
-        }else{
+        } else {
             useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel(), 1);
         }
 
-
-        treeComposite = new CheckBoxTreeComposite(container, new FeatureDtoContentProvider(false, true, false), new TermDtoLabelProvider(), SWT.SCROLL_PAGE);
+        treeComposite = new CheckBoxTreeComposite(container, new FeatureDtoContentProvider(false, true, false),
+                new TermDtoLabelProvider(), SWT.SCROLL_PAGE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         rememberCheckedValues(getCheckedValuesFromPreferences());
 
-        if (isLocalPref()){
-            if (isOverride){
+        if (isLocalPref()) {
+            if (isOverride) {
                 useLocalOrAdmin.select(1);
-            }else{
+            } else {
                 useLocalOrAdmin.select(0);
-                if (treeComposite.getViewer().getTree() != null && treeComposite.getViewer().getTree().getTopItem() != null) {
+                if (treeComposite.getViewer().getTree() != null
+                        && treeComposite.getViewer().getTree().getTopItem() != null) {
                     treeComposite.getViewer().getTree().setSelection(treeComposite.getViewer().getTree().getTopItem());
                 }
                 treeComposite.setEnabled(false);
 
-                //treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
+                // treeComposite.getViewer().getTree().getVerticalBar().setEnabled(true);
             }
-        }else{
-            if (allowOverride){
+        } else {
+            if (allowOverride) {
                 useLocalOrAdmin.select(0);
-            }else{
+            } else {
                 useLocalOrAdmin.select(1);
             }
         }
@@ -124,12 +131,11 @@ public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
 
     }
 
-
     @Override
-    public boolean performOk(){
-        if (isApply()){
+    public boolean performOk() {
+        if (isApply()) {
             boolean result = super.performOk();
-            if (result){
+            if (result) {
                 PreferencesUtil.getPreferredFeatureTreeForNameDescription(true);
             }
         }
@@ -157,16 +163,16 @@ public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
         ITermService termService = CdmStore.getService(ITermService.class);
         List<UUID> uuidList = new ArrayList();
         for (String s : listValue) {
-            if (!StringUtils.isBlank(s)){
+            if (!StringUtils.isBlank(s)) {
                 UUID uuid = UUID.fromString(s);
                 uuidList.add(uuid);
             }
         }
-        if (!uuidList.isEmpty()){
+        if (!uuidList.isEmpty()) {
             termlist = termService.findFeatureByUUIDsAsDto(uuidList);
         }
 
-        if (listValue == null || listValue.isEmpty() ){
+        if (listValue == null || listValue.isEmpty(){
             termlist = termService.findFeatureByTitleAsDto("");
 
         }
@@ -174,5 +180,4 @@ public class NameFeatureMenuPreference extends GeneralTermPreferencePage {
         return new ArrayList(termlist);
     }
 
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index 370189e..f894b1d
@@ -8,7 +8,6 @@
 */
 package eu.etaxonomy.taxeditor.preference.wizard;
 
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -23,11 +22,11 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoContentProvider;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoLabelProvider;
@@ -41,7 +40,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public abstract class AbstractTermSelectionWizardPage<T extends AbstractTermDto> extends WizardPage {
 
     protected CheckBoxTreeComposite treeComposite;
-    private List<TermVocabularyDto> vocabularies = new ArrayList<>();
+    private List<TermCollectionDto> vocabularies = new ArrayList<>();
+
     boolean localPref;
     protected CdmPreference pref;
     protected boolean override;
@@ -55,9 +55,10 @@ public abstract class AbstractTermSelectionWizardPage<T extends AbstractTermDto>
     }
 
     @Override
-    public void createControl(Composite parent){
+    public void createControl(Composite parent) {
         parent.setLayout(new GridLayout());
-        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
+        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(),
+                SWT.NONE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         rememberCheckedValues(getCheckedValuesFromPreferences());
         treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
@@ -66,19 +67,19 @@ public abstract class AbstractTermSelectionWizardPage<T extends AbstractTermDto>
 
     protected abstract String getCheckedValuesFromPreferences();
 
-    public CheckboxTreeViewer getViewer(){
+    public CheckboxTreeViewer getViewer() {
         return treeComposite.getViewer();
     }
 
-    public List<TermVocabularyDto> getVocabularies() {
+    public List<TermCollectionDto> getVocabularies() {
         return vocabularies;
     }
 
-    public void addVocabularies(TermVocabularyDto vocabulary) {
+    public void addVocabularies(TermCollectionDto vocabulary) {
         this.vocabularies.add(vocabulary);
     }
 
-    protected void setVocabularies(List<TermVocabularyDto> vocs) {
+    protected void setVocabularies(List<TermCollectionDto> vocs) {
 
         vocabularies = vocs;
     }
@@ -91,44 +92,45 @@ public abstract class AbstractTermSelectionWizardPage<T extends AbstractTermDto>
         initialiseVocabularies();
 
         treeComposite.getViewer().setInput(getVocabularies());
+
         List<T> termsFromStringValues = null;
         if (checkedValues != null && checkedValues != "") { //$NON-NLS-1$
             String[] listChecked = checkedValues.split(";"); //$NON-NLS-1$
             String[] listCheckedComma = checkedValues.split(","); //$NON-NLS-1$
             List<String> checked = new ArrayList<>();
-            if (listChecked != null ){
+            if (listChecked != null{
                 checked = Arrays.asList(listChecked);
             }
-            if (listCheckedComma != null && checkedValues.contains(",")){ //$NON-NLS-1$
+            if (listCheckedComma != null && checkedValues.contains(",")) { //$NON-NLS-1$
                 checked = Arrays.asList(listCheckedComma);
             }
             termsFromStringValues = getTermsFromStringValues(checked);
-            if (termsFromStringValues != null){
+            if (termsFromStringValues != null) {
                 treeComposite.setCheckedElements(termsFromStringValues.toArray());
             }
 
         }
-        if (termsFromStringValues == null){
+        if (termsFromStringValues == null) {
             termsFromStringValues = getTermsFromStringValues(new ArrayList<String>());
-            if (termsFromStringValues != null){
+            if (termsFromStringValues != null) {
                 treeComposite.setCheckedElements(termsFromStringValues.toArray());
             }
         }
     }
 
-
-
     protected void initialiseVocabularies() {
         if (getVocabularies() != null) {
             getVocabularies().clear();
         }
-        List<TermVocabularyDto> vocs = new ArrayList<>();
-        vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
+
+        List<TermCollectionDto> vocs = new ArrayList<>();
+        vocs = CdmStore.getService(ITermCollectionService.class).findCollectionDtoByTermType(type);
 
         setVocabularies(vocs);
+
     }
 
-    protected abstract List<TermVocabularyDto> getVocabulariesFromPreference();
+    protected abstract List<TermCollectionDto> getVocabulariesFromPreference();
 
     /**
      * @param listValue
@@ -137,25 +139,23 @@ public abstract class AbstractTermSelectionWizardPage<T extends AbstractTermDto>
     protected abstract List<T> getTermsFromStringValues(List<String> listValue);
 
     protected Button createAllowOverrideButton(Composite parent) {
-       Button activateCheckButton = new Button(parent, SWT.CHECK);
-       if (localPref){
-           activateCheckButton.setText("Override");
-           activateCheckButton.setSelection(override);
-       }else{
-           activateCheckButton.setText("Allow Override");
-           activateCheckButton.setSelection(override);
-       }
-
-
+        Button activateCheckButton = new Button(parent, SWT.CHECK);
+        if (localPref) {
+            activateCheckButton.setText("Override");
+            activateCheckButton.setSelection(override);
+        } else {
+            activateCheckButton.setText("Allow Override");
+            activateCheckButton.setSelection(override);
+        }
 
-        activateCheckButton.addSelectionListener(new SelectionAdapter(){
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    pref.setAllowOverride(activateCheckButton.getSelection());
-                    override = activateCheckButton.getSelection();
+        activateCheckButton.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                pref.setAllowOverride(activateCheckButton.getSelection());
+                override = activateCheckButton.getSelection();
 
-                }
-            });
+            }
+        });
         return activateCheckButton;
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 0100280..e3cccd2
@@ -16,22 +16,21 @@ import java.util.UUID;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.RootElementsOnlyTreeContentProvider;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
-
 /**
  * @author k.luther
  * @since 04.06.2018
  *
  */
-public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPage<TermVocabularyDto>{
+public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPage<TermCollectionDto> {
 
     String featureTitle;
 
@@ -41,20 +40,20 @@ public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPa
         this.featureTitle = featureTitle;
         this.pref = pref;
 
-
     }
 
-//    public AvailableAreaVocabulariesPage(String pageName, boolean localPref, CdmPreference pref, String featureTitle) {
-//        this(pageName, localPref, pref, featureTitle);
-//
-//    }
+    // public AvailableAreaVocabulariesPage(String pageName, boolean localPref,
+    // CdmPreference pref, String featureTitle) {
+    // this(pageName, localPref, pref, featureTitle);
+    //
+    // }
 
     @Override
     public void createControl(Composite parent) {
 
         setTitle(String.format(Messages.AvailableAreaVocabulariesPage_PAGE_TITLE, featureTitle));
         setDescription(String.format(Messages.AvailableAreaVocabulariesPage_PAGE_DESCRIPTION, featureTitle));
-        if (!localPref){
+        if (!localPref) {
             createAllowOverrideButton(parent);
         }
 
@@ -64,35 +63,30 @@ public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPa
         treeComposite.setAllowTopLevelSelection(true);
     }
 
-
-
     @Override
     protected String getCheckedValuesFromPreferences() {
         String vocString = null;
-        if (localPref){
+        if (localPref) {
             vocString = PreferencesUtil.getPreferredVocabulariesForDistributionEditor(localPref);
-            if (StringUtils.isBlank(vocString) && pref != null){
+            if (StringUtils.isBlank(vocString) && pref != null) {
                 vocString = pref.getValue();
             }
             this.override = PreferencesUtil.getOverrideForPreference(pref.getPredicate());
-        }else if (pref != null){
+        } else if (pref != null) {
             vocString = pref.getValue();
         }
         return vocString;
     }
 
-
-
-
-
     /**
      * {@inheritDoc}
      */
     @Override
-    protected List<TermVocabularyDto> getVocabulariesFromPreference() {
+    protected List<TermCollectionDto> getVocabulariesFromPreference() {
         // TODO Auto-generated method stub
         return null;
     }
+
     @Override
     protected void rememberCheckedValues(String checkedValues) {
         initialiseVocabularies();
@@ -103,42 +97,38 @@ public class AvailableAreaVocabulariesPage extends AbstractTermSelectionWizardPa
             String[] listChecked = checkedValues.split(";"); //$NON-NLS-1$
             String[] listCheckedComma = checkedValues.split(","); //$NON-NLS-1$
             List<String> checked = new ArrayList<>();
-            if (listChecked != null ){
+            if (listChecked != null{
                 checked = Arrays.asList(listChecked);
             }
-            if (listCheckedComma != null && checkedValues.contains(",")){ //$NON-NLS-1$
+            if (listCheckedComma != null && checkedValues.contains(",")) { //$NON-NLS-1$
                 checked = Arrays.asList(listCheckedComma);
             }
-            List<TermVocabularyDto> termsFromStringValues = getTermsFromStringValues(checked);
+            List<TermCollectionDto> termsFromStringValues = getTermsFromStringValues(checked);
             treeComposite.setCheckedElements(termsFromStringValues.toArray());
 
-        }else{
+        } else {
 
             treeComposite.getViewer().setAllChecked(true);
         }
     }
 
     @Override
-    protected List<TermVocabularyDto> getTermsFromStringValues(List<String> listValue) {
-        List<TermVocabularyDto> termlist = new ArrayList<>();
+    protected List<TermCollectionDto> getTermsFromStringValues(List<String> listValue) {
+        List<TermCollectionDto> termlist = new ArrayList<>();
         List<UUID> uuidList = new ArrayList<>();
         for (String s : listValue) {
-            if (!StringUtils.isBlank(s)){
+            if (!StringUtils.isBlank(s)) {
                 UUID uuid = UUID.fromString(s);
                 uuidList.add(uuid);
             }
         }
-        IVocabularyService vocabularyService = CdmStore.getService(IVocabularyService.class);
-
-        termlist = vocabularyService.findVocabularyDtoByVocabularyUuids(uuidList);
-
-
+        ITermCollectionService vocabularyService = CdmStore.getService(ITermCollectionService.class);
+        // ITermTreeService treeService =
+        // CdmStore.getService(ITermTreeService.class);
+        termlist = vocabularyService.findTermCollectionDtoByUuids(uuidList);
 
         return termlist;
 
     }
 
-
-
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index a36b947..edd0a64
@@ -18,17 +18,25 @@ import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.api.service.ITermService;
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
+import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoContentProvider;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoLabelProvider;
 import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.preference.AreaCheckBoxTreeComposite;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -38,28 +46,37 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  */
 public class AvailableDistributionPage extends AbstractTermSelectionWizardPage<TermDto> {
-
-
+    
+    
 
     public AvailableDistributionPage(String pageName) {
         super(pageName, TermType.NamedArea);
         this.localPref = true;
 
-
     }
 
-
     @Override
     public void createControl(Composite parent) {
         setTitle(Messages.AvailableDistributionPage_PAGE_TITLE);
         setDescription(Messages.AvailableDistributionPage_PAGE_DESCRIPTION);
+        parent.setLayout(new GridLayout());
+        treeComposite = new AreaCheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(),
+                    SWT.NONE);
+        treeComposite.getViewer().setComparator(new DefinedTermSorter());
+        rememberCheckedValues(getCheckedValuesFromPreferences());
+        treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        setControl(treeComposite);
+        parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
+        ((GridData)parent.getLayoutData()).minimumHeight= 400;
+        
 
-        super.createControl(parent);
     }
+    
 
     @Override
     protected String getCheckedValuesFromPreferences() {
-        String checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaTerms.getKey(), true);
+        String checkedValues = PreferencesUtil
+                .getStringValue(PreferencePredicate.AvailableDistributionAreaTerms.getKey(), true);
 
         return checkedValues;
     }
@@ -67,46 +84,81 @@ public class AvailableDistributionPage extends AbstractTermSelectionWizardPage<T
     @Override
     protected void rememberCheckedValues(String checkedValues) {
         initialiseVocabularies();
+        List<TermCollectionDto> collections = new ArrayList<>();
+        collections.addAll(getVocabularies());
 
-        treeComposite.getViewer().setInput(getVocabularies());
+        treeComposite.getViewer().setInput(collections);
 
         if (checkedValues != null && checkedValues != "") { //$NON-NLS-1$
             String[] listChecked = checkedValues.split(";"); //$NON-NLS-1$
             String[] listCheckedComma = checkedValues.split(","); //$NON-NLS-1$
             List<String> checked = new ArrayList<>();
-            if (listChecked != null ){
+            if (listChecked != null{
                 checked = Arrays.asList(listChecked);
             }
-            if (listCheckedComma != null && checkedValues.contains(",")){ //$NON-NLS-1$
+            if (listCheckedComma != null && checkedValues.contains(",")) { //$NON-NLS-1$
                 checked = Arrays.asList(listCheckedComma);
             }
             List<TermDto> termsFromStringValues = getTermsFromStringValues(checked);
-            treeComposite.setCheckedElements(termsFromStringValues.toArray());
+            List<TermNodeDto> nodes = new ArrayList<>();
+            //check whether the term is contained in tree(s)
+            Map<TermDto, Set<TermNodeDto>> mapTermsToNodes = new HashMap<>();
+            for (TermCollectionDto coll: collections) {
+                if (coll instanceof TermTreeDto) {                    
+                    for (TermDto term:coll.getTerms()) {
+                        TermNodeDto node = ((TermTreeDto)coll).getNodeWithTerm(term, ((TermTreeDto)coll).getRoot());
+                        if (node != null) {
+                            if (mapTermsToNodes.get(term) == null) {
+                                mapTermsToNodes.put(term, new HashSet<>());
+                            }
+                            mapTermsToNodes.get(term).add(node);
+                        }
+                    }                   
+                }                
+            }
+            
+            for (TermDto term: termsFromStringValues) {                
+                for (TermCollectionDto coll: collections) {                    
+                    if(coll.getTerms().contains(term) && coll instanceof TermTreeDto) {
+                        TermNodeDto node = ((TermTreeDto)coll).getNodeWithTerm(term, ((TermTreeDto)coll).getRoot());
+                        if(node!= null) {
+                            nodes.add(node);
+                        }
+                    }
+                }
+            }
+            List<Object> termsAndNodesList = new ArrayList<>();
+            termsAndNodesList.addAll(termsFromStringValues);
+            termsAndNodesList.addAll(nodes);
+            
+            Object[] termsAndNodes = termsAndNodesList.toArray();
+            treeComposite.setCheckedElements(termsAndNodes);
+            ((AreaCheckBoxTreeComposite)treeComposite).setMapTermsToNodes(mapTermsToNodes);
+            
         }
 
     }
 
     @Override
     public void dispose() {
-       // CdmStore.getCurrentSessionManager().dispose(this);
+        // CdmStore.getCurrentSessionManager().dispose(this);
         super.dispose();
     }
 
-//    @Override
-//    public ICdmEntitySession getCdmEntitySession() {
-//        return CdmStore.getCurrentSessionManager().getNullSession();
-//    }
-//
-//    @Override
-//    public <T extends CdmBase> Collection<T> getRootEntities() {
-//        return null;
-//    }
-//
-//    @Override
+    // @Override
+    // public ICdmEntitySession getCdmEntitySession() {
+    // return CdmStore.getCurrentSessionManager().getNullSession();
+    // }
+    //
+    // @Override
+    // public <T extends CdmBase> Collection<T> getRootEntities() {
+    // return null;
+    // }
+    //
+    // @Override
     public Map<Object, List<String>> getPropertyPathsMap() {
         Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
-        List<String> termsPropertyPaths = Arrays.asList(new String[] {
-                "includes" //$NON-NLS-1$
+        List<String> termsPropertyPaths = Arrays.asList(new String[] { "includes" //$NON-NLS-1$
         });
         propertyPathsMap.put("includes", termsPropertyPaths); //$NON-NLS-1$
         propertyPathsMap.put("terms", termsPropertyPaths); //$NON-NLS-1$
@@ -114,67 +166,82 @@ public class AvailableDistributionPage extends AbstractTermSelectionWizardPage<T
     }
 
     @Override
-    protected  List<TermVocabularyDto> getVocabulariesFromPreference(){
-        List<TermVocabularyDto> vocs = new ArrayList<>();
-
-        if (PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionAreaVocabularies) == null && PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey()) == null){
-            vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
-        }else{
-            String vocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
-            if (vocString == null || vocString.equals("")){
-                vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
+    protected List<TermCollectionDto> getVocabulariesFromPreference() {
+        List<TermCollectionDto> vocs = new ArrayList<>();
+
+        if (PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionAreaVocabularies) == null
+                && PreferencesUtil
+                        .getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey()) == null) {
+            vocs = CdmStore.getService(ITermCollectionService.class).findCollectionDtoByTermType(type);
+        } else {
+            String vocString = PreferencesUtil
+                    .getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+            if (vocString == null || vocString.equals("")) {
+                vocs = CdmStore.getService(ITermCollectionService.class).findCollectionDtoByTermType(type, true);
                 return vocs;
             }
             String[] arrayVocs = vocString.split(";"); //$NON-NLS-1$
 
-            Set<UUID> uuidVocs = new HashSet<>();
-            for (String voc: arrayVocs){
-                if (!StringUtils.isBlank(voc)){
+            List<UUID> uuidVocs = new ArrayList<>();
+            for (String voc : arrayVocs) {
+                if (!StringUtils.isBlank(voc)) {
                     uuidVocs.add(UUID.fromString(voc));
                 }
             }
-            List<TermVocabulary> tempVocs = CdmStore.getService(IVocabularyService.class).find(uuidVocs);
-            for (TermVocabulary<?> voc: tempVocs){
-                vocs.add(new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType(), voc.getTitleCache(), voc.isAllowDuplicates(), voc.isOrderRelevant(), voc.isFlat()));
-            }
+            List<TermCollectionDto> tempVocs = CdmStore.getService(ITermCollectionService.class)
+                    .findTermCollectionDtoByUuids(uuidVocs);
+            vocs.addAll(tempVocs);
+            // tempVocs =
+            // CdmStore.getService(ITermTreeService.class).getTermTreeDtosByUuids(uuidVocs);
+            // for (TermVocabulary<?> voc : tempVocs) {
+            // vocs.add(new TermVocabularyDto(voc.getUuid(),
+            // voc.getRepresentations(), voc.getTermType(),
+            // voc.getTitleCache(), voc.isAllowDuplicates(),
+            // voc.isOrderRelevant(), voc.isFlat()));
+            // }
         }
         return vocs;
     }
+
     @Override
     protected void initialiseVocabularies() {
         if (getVocabularies() != null) {
             getVocabularies().clear();
         }
-        List<TermVocabularyDto> vocs = new ArrayList<>();
+
+        List<TermCollectionDto> vocs = new ArrayList<>();
         vocs = getVocabulariesFromPreference();
 
+        List<TermCollectionDto> trees = new ArrayList<>();
+        // trees =
+        // CdmStore.getService(ITermTreeService.class).listTermTreeDtosByTermType(type);
+        // vocs
         setVocabularies(vocs);
+
     }
 
     @Override
     protected List<TermDto> getTermsFromStringValues(List<String> listValue) {
 
-            List<TermDto> termlist = new ArrayList<>();
-            ITermService termService = CdmStore.getService(ITermService.class);
-            List<UUID> uuidList = new ArrayList<>();
-            for (String s : listValue) {
-                if (!StringUtils.isBlank(s)){
-                    UUID uuid = UUID.fromString(s);
-                    uuidList.add(uuid);
-                }
+        List<TermDto> termlist = new ArrayList<>();
+        ITermService termService = CdmStore.getService(ITermService.class);
+        List<UUID> uuidList = new ArrayList<>();
+        for (String s : listValue) {
+            if (!StringUtils.isBlank(s)) {
+                UUID uuid = UUID.fromString(s);
+                uuidList.add(uuid);
             }
-            termlist = new ArrayList<>(termService.findByUUIDsAsDto(uuidList));
-
+        }
+        termlist = new ArrayList<>(termService.findByUUIDsAsDto(uuidList));
 
-            if (listValue.isEmpty()){
-                List<DefinedTermBase> terms = CdmStore.getTermManager().getAllTerms(type, null);
-                for (DefinedTermBase<?> term: terms){
-                    termlist.add(TermDto.fromTerm(term, true));
-                }
+        if (listValue.isEmpty()) {
+            List<DefinedTermBase> terms = CdmStore.getTermManager().getAllTerms(type, null);
+            for (DefinedTermBase<?> term : terms) {
+                termlist.add(TermDto.fromTerm(term, true));
             }
+        }
 
-            return termlist;
-
+        return termlist;
 
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 8d3d755..948f12f
@@ -26,8 +26,8 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.api.service.ITermService;
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
@@ -35,8 +35,8 @@ import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceResolver;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -50,42 +50,40 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
  * @since 05.10.2018
  *
  */
-public class AvailableDistributionPerAreaStatusPage extends AvailableDistributionStatusPage implements IPropertyChangeListener{
+public class AvailableDistributionPerAreaStatusPage extends AvailableDistributionStatusPage
+        implements IPropertyChangeListener {
 
     List<CdmPreference> perAreaPreferences = new ArrayList();
     List<CdmPreference> perAreaPreferencesDeleteList = new ArrayList();
-    List<TermVocabularyDto> vocs;
+    List<TermCollectionDto> vocs;
     NamedArea actualArea;
     CdmPreference actualPref;
     Text areaText;
     String namedAreaString;
 
-
-
     Button btnSelectArea;
     Button btnRemove;
     Label status;
     int countTerms;
 
-
     public AvailableDistributionPerAreaStatusPage(String pageName, List<CdmPreference> prefs, boolean localPref) {
         super(pageName, null, localPref);
 
         perAreaPreferences = prefs;
-        if(PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionAreaVocabularies) == null && PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey()) == null){
-            vocs = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(type);
+        if (PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionAreaVocabularies) == null
+                && PreferencesUtil
+                        .getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey()) == null) {
+            vocs = CdmStore.getService(ITermCollectionService.class).findCollectionDtoByTermType(type);
 
         }
         pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionStatus);
-        if (pref == null){
+        if (pref == null) {
             pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionStatus, null);
         }
         initialiseVocabularies();
         countTerms = CdmStore.getTermManager().getPreferredTerms(type).size();
     }
 
-
-
     @Override
     public void createControl(Composite parent) {
         setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
@@ -94,33 +92,32 @@ public class AvailableDistributionPerAreaStatusPage extends AvailableDistributio
 
         super.createControl(parent);
 
-
-
     }
+
     @Override
     protected Button createAllowOverrideButton(Composite parent) {
         Button activateCheckButton = new Button(parent, SWT.CHECK);
-        if (localPref){
+        if (localPref) {
             activateCheckButton.setText("Override");
             activateCheckButton.setSelection(override);
-        }else{
+        } else {
             activateCheckButton.setText("Allow Override");
             activateCheckButton.setSelection(override);
         }
 
-        activateCheckButton.addSelectionListener(new SelectionAdapter(){
+        activateCheckButton.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
-                if (actualPref != null){
-                   actualPref.setAllowOverride(activateCheckButton.getSelection());
+                if (actualPref != null) {
+                    actualPref.setAllowOverride(activateCheckButton.getSelection());
                 }
                 override = activateCheckButton.getSelection();
 
             }
         });
 
-         return activateCheckButton;
-     }
+        return activateCheckButton;
+    }
 
     protected void createAreaSelectionCombo(Composite parent) {
 
@@ -138,40 +135,38 @@ public class AvailableDistributionPerAreaStatusPage extends AvailableDistributio
         GridData textData = new GridData();
         textData.minimumWidth = 200;
         textData.widthHint = 200;
-        areaText = new Text(toolbar,  SWT.NONE);
+        areaText = new Text(toolbar, SWT.NONE);
         areaText.setEditable(false);
-        areaText.setBackground(StoreUtil
-                .getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND));
+        areaText.setBackground(StoreUtil.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND));
         areaText.setLayoutData(textData);
-        if (actualArea != null){
+        if (actualArea != null) {
             areaText.setText(actualArea.getLabel());
             areaText.setEnabled(false);
         }
-        btnSelectArea = new Button(toolbar, SWT.PUSH | SWT.FLAT );
-        btnSelectArea.setImage(ImageResources
-                .getImage(ImageResources.BROWSE_ICON));
+        btnSelectArea = new Button(toolbar, SWT.PUSH | SWT.FLAT);
+        btnSelectArea.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
         btnSelectArea.setToolTipText("Browse Area");
 
-        btnSelectArea.addSelectionListener(new SelectionListener(){
+        btnSelectArea.addSelectionListener(new SelectionListener() {
 
             @Override
             public void widgetSelected(SelectionEvent e) {
                 refreshActualPrefernce();
 
-                NamedArea selection = SelectionDialogFactory.getSelectionFromDialog(NamedArea.class, getShell(), //getConversationHolder(),
+                NamedArea selection = SelectionDialogFactory.getSelectionFromDialog(NamedArea.class, getShell(),
                         actualArea, null);
                 actualArea = selection;
                 PrefKey key;
-                if (actualArea != null){
+                if (actualArea != null) {
                     areaText.setText(actualArea.getLabel());
                     key = newAreaSpecificStatusPreference();
                     actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
-                    if (actualPref == null){
+                    if (actualPref == null) {
                         actualPref = CdmPreference.NewInstance(key, null);
                         perAreaPreferences.add(actualPref);
                     }
                     override = actualPref.isAllowOverride();
-                }else{
+                } else {
                     actualPref = null;
                 }
 
@@ -187,61 +182,62 @@ public class AvailableDistributionPerAreaStatusPage extends AvailableDistributio
             }
 
         });
-//        btnRemove = new Button(toolbar, SWT.NONE);
-//        btnRemove.addSelectionListener(new SelectionListener(){
-//
-//            @Override
-//            public void widgetSelected(SelectionEvent e) {
-//
-//                PrefKey key = newAreaSpecificStatusPreference();
-//                actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
-//                actualPref = CdmPreference.NewInstance(key, null);
-//                if (actualPref.getKey().equals(pref.getKey())){
-//                    pref = actualPref;
-//                }
-//
-//                perAreaPreferences.add(actualPref);
-//                if (actualArea != null){
-//                    status.setText("Preference for area " + actualArea.getLabel() + " removed. Now the status defined for all areas are displayed");
-//                }else{
-//                    status.setText("Preference for all areas is removed. Now all status will be displayed");
-//                }
-//                status.setVisible(true);
-//
-//                actualArea = null;
-//
-//                areaText.setText("");
-//                rememberCheckedValues(getCheckedValuesFromPreferences());
-//
-//            }
-//
-//            @Override
-//            public void widgetDefaultSelected(SelectionEvent e) {
-//                // TODO Auto-generated method stub
-//
-//            }
-//
-//        });
-//        btnRemove.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON));
-//        btnRemove.setToolTipText("");
+        // btnRemove = new Button(toolbar, SWT.NONE);
+        // btnRemove.addSelectionListener(new SelectionListener(){
+        //
+        // @Override
+        // public void widgetSelected(SelectionEvent e) {
+        //
+        // PrefKey key = newAreaSpecificStatusPreference();
+        // actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
+        // actualPref = CdmPreference.NewInstance(key, null);
+        // if (actualPref.getKey().equals(pref.getKey())){
+        // pref = actualPref;
+        // }
+        //
+        // perAreaPreferences.add(actualPref);
+        // if (actualArea != null){
+        // status.setText("Preference for area " + actualArea.getLabel() + "
+        // removed. Now the status defined for all areas are displayed");
+        // }else{
+        // status.setText("Preference for all areas is removed. Now all status
+        // will be displayed");
+        // }
+        // status.setVisible(true);
+        //
+        // actualArea = null;
+        //
+        // areaText.setText("");
+        // rememberCheckedValues(getCheckedValuesFromPreferences());
+        //
+        // }
+        //
+        // @Override
+        // public void widgetDefaultSelected(SelectionEvent e) {
+        // // TODO Auto-generated method stub
+        //
+        // }
+        //
+        // });
+        // btnRemove.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON));
+        // btnRemove.setToolTipText("");
         status = new Label(toolbar, SWT.NONE);
         status.setVisible(false);
     }
 
-
     @Override
     public void propertyChange(PropertyChangeEvent event) {
-        if(event == null){
+        if (event == null) {
             return;
         }
         Object eventSource = event.getSource();
-        if(eventSource != this && btnSelectArea.equals(eventSource)){
-            if (actualArea != null){
+        if (eventSource != this && btnSelectArea.equals(eventSource)) {
+            if (actualArea != null) {
                 PrefKey key = newAreaSpecificStatusPreference();
                 actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
                 areaText.setText(actualArea.getLabel());
                 override = actualPref.isAllowOverride();
-            }else{
+            } else {
                 actualPref = null;
             }
 
@@ -250,61 +246,63 @@ public class AvailableDistributionPerAreaStatusPage extends AvailableDistributio
 
     @Override
     protected String getCheckedValuesFromPreferences() {
-       String checkedValues = null;
-       if (actualArea == null){
-           checkedValues = pref.getValue();
-           override = pref.isAllowOverride();
-       }else{
-           if (actualPref == null){
-               PrefKey key = newAreaSpecificStatusPreference();
-               actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
-
-               if (actualPref == null){
-                   actualPref = CdmPreference.NewInstance(key, null);
-                   checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
-
-               }
-           }
-           checkedValues = actualPref.getValue();
-           override = actualPref.isAllowOverride();
-       }
-
-       return checkedValues;
+        String checkedValues = null;
+        if (actualArea == null) {
+            checkedValues = pref.getValue();
+            override = pref.isAllowOverride();
+        } else {
+            if (actualPref == null) {
+                PrefKey key = newAreaSpecificStatusPreference();
+                actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
+
+                if (actualPref == null) {
+                    actualPref = CdmPreference.NewInstance(key, null);
+                    checkedValues = PreferencesUtil
+                            .getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
+
+                }
+            }
+            checkedValues = actualPref.getValue();
+            override = actualPref.isAllowOverride();
+        }
+
+        return checkedValues;
     }
 
-    protected void refreshActualPrefernce(){
+    protected void refreshActualPrefernce() {
         String saveCheckedElements;
         getViewer().expandAll();
 
-
-        if (countTerms == getViewer().getCheckedElements().length){
+        if (countTerms == getViewer().getCheckedElements().length) {
             saveCheckedElements = null;
-        }else{
+        } else {
             Object[] checkedElements = getViewer().getCheckedElements();
             List<UUID> listUIIDChecked = new ArrayList<>();
             List<DefinedTermBase> preferredTerms = new ArrayList<>();
             for (Object o : checkedElements) {
-                 if(o instanceof TermDto){
-                     TermDto termDto = (TermDto) o;
-                     listUIIDChecked.add(termDto.getUuid());
-                     preferredTerms.add(CdmStore.getService(ITermService.class).load(termDto.getUuid()));
-                 }
-             }
-             saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
-             if (StringUtils.isBlank(saveCheckedElements)){
-                 saveCheckedElements = null;
-         }
+                if (o instanceof TermDto) {
+                    TermDto termDto = (TermDto) o;
+                    listUIIDChecked.add(termDto.getUuid());
+                    preferredTerms.add(CdmStore.getService(ITermService.class).load(termDto.getUuid()));
+                }
+            }
+            saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
+            if (StringUtils.isBlank(saveCheckedElements)) {
+                saveCheckedElements = null;
+            }
         }
-        if (actualArea == null){
-            CdmPreference savePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionStatus, saveCheckedElements);
+        if (actualArea == null) {
+            CdmPreference savePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionStatus,
+                    saveCheckedElements);
             savePref.setAllowOverride(override);
             pref = savePref;
-        }else{
+        } else {
             PrefKey key = newAreaSpecificStatusPreference();
             actualPref = PreferenceResolver.resolve(perAreaPreferences, key);
-            CdmPreference savePref = CdmPreference.NewInstance(PreferenceSubject.fromKey(key), PreferencePredicate.AvailableDistributionStatus, saveCheckedElements);
-            if (actualPref != null){
-               perAreaPreferences.remove(actualPref);
+            CdmPreference savePref = CdmPreference.NewInstance(PreferenceSubject.fromKey(key),
+                    PreferencePredicate.AvailableDistributionStatus, saveCheckedElements);
+            if (actualPref != null) {
+                perAreaPreferences.remove(actualPref);
             }
             perAreaPreferences.add(savePref);
             savePref.setAllowOverride(override);
@@ -314,29 +312,31 @@ public class AvailableDistributionPerAreaStatusPage extends AvailableDistributio
     }
 
     @Override
-    protected  List<TermVocabularyDto> getVocabulariesFromPreference(){
-     return null;
+    protected List<TermCollectionDto> getVocabulariesFromPreference() {
+        return null;
     }
 
-    private PrefKey newAreaSpecificStatusPreference(){
+    private PrefKey newAreaSpecificStatusPreference() {
         PrefKey prefKey;
-        if (actualArea != null){
-            prefKey  = CdmPreference.NewKey(PreferenceSubject.NewInstance(PreferenceSubject.ROOT+"NamedArea["+actualArea.getUuid().toString()+"]"+PreferenceSubject.SEP), PreferencePredicate.AvailableDistributionStatus);
-        }else{
-            prefKey = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AvailableDistributionStatus);
+        if (actualArea != null) {
+            prefKey = CdmPreference.NewKey(
+                    PreferenceSubject.NewInstance(PreferenceSubject.ROOT + "NamedArea["
+                            + actualArea.getUuid().toString() + "]" + PreferenceSubject.SEP),
+                    PreferencePredicate.AvailableDistributionStatus);
+        } else {
+            prefKey = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(),
+                    PreferencePredicate.AvailableDistributionStatus);
         }
         return prefKey;
     }
 
-
-    public void setActualPreference(CdmPreference pref){
+    public void setActualPreference(CdmPreference pref) {
         this.actualPref = pref;
-        if (actualPref != null){
+        if (actualPref != null) {
             override = actualPref.isAllowOverride();
-        }else{
+        } else {
             override = true;
         }
     }
 
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index 6d761f7..8127542
@@ -16,8 +16,6 @@ import org.eclipse.jface.wizard.Wizard;
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
@@ -34,8 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since 05.10.2018
  *
  */
-public class AvailableDistributionPerAreaStatusWizard extends Wizard implements IConversationEnabled{
-    private ConversationHolder conversation;
+public class AvailableDistributionPerAreaStatusWizard extends Wizard {
     private final AvailableDistributionPerAreaStatusPage aPage;
     List<CdmPreference> prefs;
     private boolean isAdmin;
@@ -140,17 +137,4 @@ public class AvailableDistributionPerAreaStatusWizard extends Wizard implements
         return true;
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if (conversation == null) {
-            conversation = CdmStore.createConversation();
-        }
-        return conversation;
-    }
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index 5b32eb1..e8dbfc7
@@ -16,14 +16,11 @@ import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -33,8 +30,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since 19.11.2018
  *
  */
-public class AvailableDistributionStatusAdminWizard extends Wizard implements IConversationEnabled{
-    private ConversationHolder conversation;
+public class AvailableDistributionStatusAdminWizard extends Wizard {
+    
     private final AvailableDistributionStatusPage aPage;
     CdmPreference pref;
 
@@ -110,17 +107,6 @@ public class AvailableDistributionStatusAdminWizard extends Wizard implements IC
         return true;
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if (conversation == null) {
-            conversation = CdmStore.createConversation();
-        }
-        return conversation;
-    }
+    
 
 }
old mode 100755 (executable)
new mode 100644 (file)
index 45b9abc..2a05b2d
@@ -16,12 +16,10 @@ import org.eclipse.swt.widgets.Composite;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
-
-
 /**
  * @author k.luther
  * @since 05.10.2018
@@ -41,36 +39,32 @@ public class AvailableDistributionStatusPage extends TermSelectionWizardPage {
     public void createControl(Composite parent) {
         setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
         setDescription(Messages.AvailableDistributionStatusPage_PAGE_DESCRIPTION);
-        if (localPref){
-            override = PreferencesUtil.getOverrideForPreference(PreferencePredicate.AvailableDistributionStatus.getKey());
+        if (localPref) {
+            override = PreferencesUtil
+                    .getOverrideForPreference(PreferencePredicate.AvailableDistributionStatus.getKey());
         }
         overrideButton = createAllowOverrideButton(parent);
 
-
         super.createControl(parent);
         overrideButton.setSelection(override);
     }
 
     @Override
     protected String getCheckedValuesFromPreferences() {
-       String checkedValues = null;
-        if (localPref){
-           checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), true);
-        }else if(pref != null){
+        String checkedValues = null;
+        if (localPref) {
+            checkedValues = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(),
+                    true);
+        } else if (pref != null) {
             checkedValues = pref.getValue();
         }
         return checkedValues;
     }
 
     @Override
-    protected List<TermVocabularyDto> getVocabulariesFromPreference() {
+    protected List<TermCollectionDto> getVocabulariesFromPreference() {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-
-
-
-
 }
old mode 100755 (executable)
new mode 100644 (file)
index e4ba273..2c901a4
@@ -16,8 +16,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.TermType;
@@ -32,8 +30,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @since 05.10.2018
  *
  */
-public class AvailableDistributionStatusWizard extends Wizard implements IConversationEnabled{
-    private ConversationHolder conversation;
+public class AvailableDistributionStatusWizard extends Wizard {
+    
     private final AvailableDistributionStatusPage aPage;
     CdmPreference pref;
 
@@ -117,17 +115,5 @@ public class AvailableDistributionStatusWizard extends Wizard implements IConver
         return true;
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if (conversation == null) {
-            conversation = CdmStore.createConversation();
-        }
-        return conversation;
-    }
-
+    
 }
index 0e88d730f6bcaa61658ff31cbccca31489711782..fa36e9e74b8544d2bae84af210d3f8537bb8535f 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -28,7 +29,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
  */
 public class AvailableDistributionWizard extends Wizard {
 
-   // private ConversationHolder conversation;
     private final AvailableDistributionPage aPage;
 
     public AvailableDistributionWizard() {
@@ -41,7 +41,8 @@ public class AvailableDistributionWizard extends Wizard {
     public boolean performFinish() {
         // TODO: get Selection and save in EditorPreferences
         if (!checkNoneChecked()) {
-            Object[] checkedElements = aPage.getViewer().getCheckedElements();
+            //Object[] checkedElements = aPage.getViewer().getCheckedElements();
+            Object[] checkedElements = aPage.treeComposite.getCheckedElements();
             Object[] grayedElements = aPage.getViewer().getGrayedElements();
             ArrayList<Object> checkedList = new ArrayList<>(Arrays.asList(checkedElements));
             ArrayList<Object> grayedList = new ArrayList<>(Arrays.asList(grayedElements));
@@ -55,6 +56,9 @@ public class AvailableDistributionWizard extends Wizard {
                 }else if(o instanceof TermVocabularyDto){
                     TermVocabularyDto termVocDto = (TermVocabularyDto) o;
                     listUIIDGrayed.add(termVocDto.getUuid());
+                }else if(o instanceof TermNodeDto){
+                    TermNodeDto termNodeDto = (TermNodeDto) o;
+                    listUIIDChecked.add(termNodeDto.getTerm().getUuid());
                 }
             }
             for (Object o : grayedList) {
@@ -82,8 +86,7 @@ public class AvailableDistributionWizard extends Wizard {
     }
 
     private boolean checkNoneChecked() {
-
-        if (aPage.getViewer().getCheckedElements().length == 0) {
+        if (aPage.treeComposite.getCheckedElements() == null || aPage.treeComposite.getCheckedElements().length == 0) {
             aPage.setMessage(Messages.AvailableDistributionWizard_CHECK_MESSAGE, aPage.WARNING);
             return true;
         } else {
@@ -91,16 +94,4 @@ public class AvailableDistributionWizard extends Wizard {
             return false;
         }
     }
-//
-//    @Override
-//    public ConversationHolder getConversationHolder() {
-//        if (conversation == null) {
-//            conversation = CdmStore.createConversation();
-//        }
-//        return conversation;
-//    }
-//
-//    @Override
-//    public void update(CdmDataChangeMap changeEvents) {
-//    }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 872e967..ee918db
@@ -15,25 +15,20 @@ import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * @author k.luther
  * @since 04.06.2018
  *
  */
-public class AvailableVocabularyWizard extends Wizard implements IConversationEnabled {
+public class AvailableVocabularyWizard extends Wizard  {
 
-    private ConversationHolder conversation;
     private final AvailableAreaVocabulariesPage aPage;
     private boolean localPref = true;
     private CdmPreference pref;
@@ -123,16 +118,5 @@ public class AvailableVocabularyWizard extends Wizard implements IConversationEn
         return true;
     }
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-    }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if (conversation == null) {
-            conversation = CdmStore.createConversation();
-        }
-        return conversation;
-    }
-
+    
 }
index 5b78e41860973bcc0f575bfa5f044bc246fe2eec..e5b52e0d258fcbf714a62fd70b5b45ef54128257 100644 (file)
@@ -9,7 +9,10 @@
 package eu.etaxonomy.taxeditor.preference.wizard;
 
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.viewers.AbstractTreeViewer;
@@ -29,6 +32,8 @@ import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.eclipse.swt.widgets.Widget;
 
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 
@@ -40,16 +45,17 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
 
     private static final Font FONT_DEFAULT = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
     private static final Font FONT_ITALIC = JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
-    private static final Font FONT_BOLD = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
-    private CheckboxTreeViewer viewer;
-    private Button btnCollapse;
-    private Button btnExpand;
-    private Button btnSelectAllChildren;
-    private Button btnSelectDirectChildren;
+    protected static final Font FONT_BOLD = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
+    protected CheckboxTreeViewer viewer;
+    protected Button btnCollapse;
+    protected Button btnExpand;
+    protected Button btnSelectAllChildren;
+    protected Button btnSelectDirectChildren;
 
     protected Object[] checkedElements;
 
-    private boolean allowTopLevelSelection = false;
+    protected boolean allowTopLevelSelection = false;
+
 
     public CheckBoxTreeComposite(Composite parent, ITreeContentProvider contentProvider, IBaseLabelProvider labelProvider, int style) {
         super(parent, style);
@@ -85,6 +91,18 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
         btnSelectAllChildren.setImage(ImageResources.getImage(ImageResources.HIERARCHICAL));
         btnSelectAllChildren.setToolTipText(""); //$NON-NLS-1$
 
+        Tree tree = createTree();
+
+        viewer = new CdmCheckBoxTreeViewer(tree);
+        viewer.setContentProvider(contentProvider);
+        viewer.setLabelProvider(labelProvider);
+    }
+
+
+    /**
+     * @return
+     */
+    protected Tree createTree() {
         Tree tree = new Tree(this, SWT.BORDER | SWT.CHECK);
         tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
         tree.addListener(SWT.Selection, event -> {
@@ -103,30 +121,39 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
                         checkedElements = tempArray;
                     }
                 }else{
-                    
+
                     if (checkedElements != null){
-                       Object[] tempArray = new Object[checkedElements.length -1];
-                       int index = 0;
-                        for (Object o:checkedElements){
-                            if (o != null && !o.equals(item.getData())){
-                               tempArray[index] = o;
-                               index++;
-                            }
-                        }
-                        checkedElements = tempArray;
+                        updateAfterUnCheckElement(item);
                     }
                 }
 
                 updateItem(item);
             }
         });
+        return tree;
+    }
 
-        viewer = new CdmCheckBoxTreeViewer(tree);
-        viewer.setContentProvider(contentProvider);
-        viewer.setLabelProvider(labelProvider);
+
+    protected void updateAfterUnCheckElement(Object item) {
+        Object[] tempArray = new Object[checkedElements.length -1];
+
+        int index = 0;
+        for (Object o:checkedElements){
+            Object element = null;
+            if (item instanceof TreeItem) {
+                element = ((TreeItem)item).getData();
+            }else {
+                element = item;
+            }
+            if (o != null && !o.equals(element)){
+               tempArray[index] = o;
+               index++;
+            }
+        }
+        checkedElements = tempArray;
     }
 
-    private void updateItem(TreeItem treeItem){
+    protected void updateItem(TreeItem treeItem){
         TreeItem parentItem = treeItem.getParentItem();
         if(parentItem!=null){
             updateItem(parentItem);
@@ -173,6 +200,7 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
                 treeItem.setFont(FONT_DEFAULT);
             }
         }
+
     }
 
 
@@ -199,6 +227,7 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
         for (TreeItem rootItem : rootItems) {
             updateItem(rootItem);
         }
+
     }
 
     /**
@@ -235,23 +264,84 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
                 List<TreeItem> childItemList = Arrays.asList(childItems);
                 boolean allChecked = childItemList.stream().allMatch(childItem->childItem.getChecked());
                 childItemList.stream().forEach(childItem->childItem.setChecked(!allChecked));
-                TreeItem parent = getRoot(treeItem);
-                updateItem(parent);
+                if (!allChecked) {
+                    for (TreeItem updateItem: childItemList) {
+                        updateAfterCheckElement(updateItem);
+                    }
+
+                }else {
+                    for (TreeItem updateItem: childItemList) {
+                        updateAfterUnCheckElement(updateItem);
+                    }
+                }
+
+
             }
         }
         else if(e.widget == btnSelectAllChildren){
             Widget item = viewer.testFindItem(firstElement);
             if(item instanceof TreeItem){
                 viewer.expandToLevel(firstElement, AbstractTreeViewer.ALL_LEVELS);
-                viewer.setSubtreeChecked(firstElement, !((TreeItem) item).getFont().equals(FONT_BOLD));
-                TreeItem parent = getRoot((TreeItem) item);
-                updateItem(parent);
+                Set<TreeItem> childrenSet = getSubTreeItems((TreeItem)item);
+                Object[] children = childrenSet.toArray();
+                boolean checked = true;
+                if (children == null) {
+                    return;
+                }
+                if (children != null && ((TreeItem)children[0]).getChecked()) {
+                    checked = false;
+                }
+                viewer.setSubtreeChecked(firstElement, checked);
                 ((TreeItem) item).setChecked(false);
+                Object[] checkedElements = viewer.getCheckedElements();
+
+                for (Object updateItem: children) {
+                    if (((TreeItem)children[0]).getChecked()) {
+                        updateAfterCheckElement(updateItem);
+                    }else {
+                        updateAfterUnCheckElement(updateItem);
+                    }
+                }
+
             }
         }
     }
 
-    private TreeItem getRoot(TreeItem treeItem) {
+    private void updateAfterCheckElement(Object item) {
+        Set<Object> tempList = new HashSet<>();
+        if (checkedElements != null) {
+            Collections.addAll(tempList, checkedElements);
+        }
+        TermNodeDto checkedNode = null;
+        TermDto checkedTerm = null;
+        TreeItem treeItem = null;
+        if (item instanceof TreeItem) {
+             treeItem = (TreeItem) item;
+             if (treeItem.getData() instanceof TermNodeDto) {
+                 checkedNode = (TermNodeDto)treeItem.getData();
+                 checkedTerm = checkedNode.getTerm();
+             }else if (treeItem.getData() instanceof TermDto) {
+                 checkedTerm = (TermDto)treeItem.getData();
+             }else {
+                 return;
+             }
+        }else  if (item instanceof TermNodeDto) {
+            checkedNode = (TermNodeDto)item;
+            checkedTerm = checkedNode.getTerm();
+        }else if (item instanceof TermDto) {
+            checkedTerm = (TermDto)item;
+        }else {
+            return;
+        }
+        if (checkedTerm != null) {
+            tempList.add(checkedTerm);
+        }
+
+        setCheckedElements(tempList.toArray());
+
+    }
+
+    protected TreeItem getRoot(TreeItem treeItem) {
         TreeItem parent = treeItem;
         while(parent.getParentItem()!=null){
             parent = parent.getParentItem();
@@ -259,6 +349,22 @@ public class CheckBoxTreeComposite extends Composite implements SelectionListene
         return parent;
     }
 
+    public Object[] getCheckedElements() {
+        return checkedElements;
+    }
+    private Set<TreeItem> getSubTreeItems(TreeItem parent) {
+        Set<TreeItem> children = new HashSet<>();
+
+        if (parent.getItems() != null) {
+            children.addAll(Arrays.asList(parent.getItems()));
+            for(TreeItem child : parent.getItems()) {
+                children.addAll(getSubTreeItems(child));
+            }
+        }
+        return children;
+    }
+
+
     @Override
     public void widgetDefaultSelected(SelectionEvent e) {
     }
old mode 100755 (executable)
new mode 100644 (file)
index fe64e09..428a4b6
@@ -14,19 +14,18 @@ import java.util.List;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
+import eu.etaxonomy.cdm.api.service.ITermTreeService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter;
 import eu.etaxonomy.taxeditor.editor.definedterm.RootElementsOnlyTreeContentProvider;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoLabelProvider;
@@ -40,20 +39,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author k.luther
  * @since 13.09.2019
  */
-public class GeneralVocabularyPreferencePage extends AbstractGeneralTermPreference<TermVocabularyDto> implements ISelectionChangedListener, SelectionListener{
-
-
-    protected List<TermVocabularyDto> getVocabulariesFromPreference() {
-
-        return null;
-    }
+public class GeneralVocabularyPreferencePage extends AbstractGeneralTermPreference<TermCollectionDto> {
 
     @Override
     protected Control createContents(Composite parent) {
         Composite container = new Composite(parent, SWT.NULL);
-       // getValues();
+        // getValues();
         getPreferenceValues();
-        if (!isAdminPreference && !allowOverride){
+        if (!isAdminPreference && !allowOverride) {
             final CLabel description = new CLabel(parent, SWT.NULL);
             description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
             this.setDefaultButtonActivated(false);
@@ -65,32 +58,32 @@ public class GeneralVocabularyPreferencePage extends AbstractGeneralTermPreferen
         container.setLayout(gridLayout);
         parent.setLayout(new GridLayout());
         useLocalOrAdmin = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
-        if (!isAdminPreference){
+        if (!isAdminPreference) {
             useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel(), 1);
 
-        }else{
+        } else {
             useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel(), 0);
             useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel(), 1);
         }
 
-
-        treeComposite = new CheckBoxTreeComposite(container, new RootElementsOnlyTreeContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
+        treeComposite = new CheckBoxTreeComposite(container, new RootElementsOnlyTreeContentProvider(),
+                new TermDtoLabelProvider(), SWT.NONE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         treeComposite.setAllowTopLevelSelection(true);
         rememberCheckedValues(getCheckedValuesFromPreferences());
 
-        if (!isAdminPreference){
-            if (isOverride){
+        if (!isAdminPreference) {
+            if (isOverride) {
                 useLocalOrAdmin.select(1);
-            }else{
+            } else {
                 useLocalOrAdmin.select(0);
                 treeComposite.setEnabled(false);
             }
-        }else{
-            if (allowOverride){
+        } else {
+            if (allowOverride) {
                 useLocalOrAdmin.select(0);
-            }else{
+            } else {
                 useLocalOrAdmin.select(1);
             }
         }
@@ -108,86 +101,97 @@ public class GeneralVocabularyPreferencePage extends AbstractGeneralTermPreferen
     @Override
     protected void rememberCheckedValues(String checkedValues) {
         initialiseVocabularies();
-        treeComposite.getViewer().getTree().deselectAll();
-        treeComposite.getViewer().refresh();
-        treeComposite.getViewer().setInput(getVocabularies());
+        setInput();
 
-        if (checkedValues != null && checkedValues != "") { //$NON-NLS-1$
+        if (checkedValues != null && !checkedValues.equals("")) { //$NON-NLS-1$
             String[] listChecked = checkedValues.split(";"); //$NON-NLS-1$
             String[] listCheckedComma = checkedValues.split(","); //$NON-NLS-1$
             List<String> checked = new ArrayList<>();
-            if (listChecked != null ){
+            if (listChecked != null{
                 checked = Arrays.asList(listChecked);
             }
-            if (listCheckedComma != null && checkedValues.contains(",")){ //$NON-NLS-1$
+            if (listCheckedComma != null && checkedValues.contains(",")) { //$NON-NLS-1$
                 checked = Arrays.asList(listCheckedComma);
             }
-            List<TermVocabularyDto> termsFromStringValues = getTermsFromStringValues(checked);
+            List<TermCollectionDto> termsFromStringValues = getTermsFromStringValues(checked);
             treeComposite.setCheckedElements(termsFromStringValues.toArray());
 
-        }else{
-            List<TermVocabularyDto> termsFromStringValues = getTermsFromStringValues(new ArrayList<String>());
+        } else {
+            List<TermCollectionDto> termsFromStringValues = getTermsFromStringValues(new ArrayList<>());
             treeComposite.setCheckedElements(termsFromStringValues.toArray());
             treeComposite.getViewer().refresh();
             treeComposite.redraw();
-
         }
     }
 
-
     @Override
-    protected List<TermVocabularyDto> getTermsFromStringValues(List<String> listValue) {
-        List<TermVocabularyDto> vocList = new ArrayList<>();
-        List<UUID> uuids = new ArrayList();
-        IVocabularyService vocService = CdmStore.getService(IVocabularyService.class);
+    protected List<TermCollectionDto> getTermsFromStringValues(List<String> listValue) {
+        List<TermCollectionDto> vocList = new ArrayList<>();
+        List<TermCollectionDto> treeList = new ArrayList<>();
+        List<TermCollectionDto> collList = new ArrayList<>();
+        List<UUID> uuids = new ArrayList<>();
+        ITermCollectionService vocService = CdmStore.getService(ITermCollectionService.class);
+        ITermTreeService treeService = CdmStore.getService(ITermTreeService.class);
         for (String s : listValue) {
-            if (!StringUtils.isBlank(s)){
+            if (!StringUtils.isBlank(s)) {
                 UUID uuid = UUID.fromString(s);
                 uuids.add(uuid);
             }
         }
-        vocList = vocService.findVocabularyDtoByVocabularyUuids(uuids);
-
-
-        if (listValue.isEmpty()){
-            vocList =vocService.findVocabularyDtoByTermType(type);
+        vocList = vocService.findCollectionDtoByTermType(type);
+        // treeList = treeService.listTermTreeDtosByTermType(type);
+        if (listValue.isEmpty()) {
+            // vocList = vocService.findVocabularyDtoByTermType(type);
+        }
+        // if (vocList != null && !vocList.isEmpty()) {
+        // collList.addAll(vocList);
+        // }
+        if (!vocList.isEmpty()) {
+            for (TermCollectionDto dto : vocList) {
+                if (uuids.contains(dto.getUuid())) {
+                    collList.add(dto);
+                }
+            }
         }
 
-        return vocList;
+        return collList;
     }
 
     @Override
     public boolean performOk() {
-        if (!isApply()){
+        if (!isApply()) {
             return true;
         }
         Object[] checkedElements = treeComposite.getViewer().getCheckedElements();
         List<UUID> listUIIDChecked = new ArrayList<>();
 
         for (Object o : checkedElements) {
-            if(o instanceof TermVocabularyDto){
-                TermVocabularyDto termDto = (TermVocabularyDto) o;
+            if (o instanceof TermCollectionDto) {
+                TermCollectionDto termDto = (TermCollectionDto) o;
                 listUIIDChecked.add(termDto.getUuid());
-             }
+            }
         }
         String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
-        if (isAdminPreference){
+        if (isAdminPreference) {
             CdmPreference savePref = CdmPreference.NewTaxEditorInstance(predicate, saveCheckedElements);
             String text = this.useLocalOrAdmin.getText();
-            if (text.equals(LocalOrDefaultEnum.Database.getLabel()) ){
+            if (text.equals(LocalOrDefaultEnum.Database.getLabel()){
                 savePref.setAllowOverride(false);
-            }else if (text.equals(LocalOrDefaultEnum.AllowOverride.getLabel())){
+            } else if (text.equals(LocalOrDefaultEnum.AllowOverride.getLabel())) {
                 savePref.setAllowOverride(true);
             }
             PreferencesUtil.setPreferenceToDB(savePref);
             PreferencesUtil.updateDBPreferences();
-        }else{
+        } else {
             PreferencesUtil.setStringValue(predicate.getKey(), saveCheckedElements);
             String text = this.useLocalOrAdmin.getText();
-            if (text.equals(LocalOrDefaultEnum.Database.getLabel()) || text.equals(LocalOrDefaultEnum.Default.getLabel())){
-                PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()), false);
-            }else if (text.equals(LocalOrDefaultEnum.Local.getLabel())){
-                PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()), true);
+            if (text.equals(LocalOrDefaultEnum.Database.getLabel())
+                    || text.equals(LocalOrDefaultEnum.Default.getLabel())) {
+                PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()),
+                        false);
+            } else if (text.equals(LocalOrDefaultEnum.Local.getLabel())) {
+                PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate.getKey()),
+                        true);
             }
         }
 
@@ -196,21 +200,19 @@ public class GeneralVocabularyPreferencePage extends AbstractGeneralTermPreferen
     }
 
     @Override
-    protected void performDefaults(){
-        if (isAdminPreference){
+    protected void performDefaults() {
+        if (isAdminPreference) {
             rememberCheckedValues("");
             treeComposite.setEnabled(true);
-        }else{
+        } else {
             isOverride = false;
             rememberCheckedValues(getCheckedValuesFromPreferences());
             treeComposite.setEnabled(false);
         }
-       pref = null;
-       useLocalOrAdmin.select(0);
-
-       setApply(true);
-       super.performDefaults();
+        pref = null;
+        useLocalOrAdmin.select(0);
 
+        setApply(true);
+        super.performDefaults();
     }
-
-}
+}
\ No newline at end of file
index 5d6a7265d30757e5a8198ee5306950ceee7e725d..5ce0601592a690d2502ce8d00ef0ade56d4a9ff6 100644 (file)
@@ -11,8 +11,6 @@ package eu.etaxonomy.taxeditor.preference.wizard;
 
 import org.eclipse.jface.wizard.Wizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.Representation;
@@ -28,7 +26,7 @@ import eu.etaxonomy.taxeditor.store.TermStore;
  * @created 12.06.2009
  * @version 1.0
  */
-public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard implements IConversationEnabled {
+public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard  {
        
        public T term = null;
        
@@ -36,15 +34,12 @@ public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard impl
 
        private Class<T> termClass;
 
-       private ConversationHolder conversation;
-
        /**
         * <p>Constructor for VocabularyTermWizard.</p>
         *
         * @param vocabularyClass a {@link java.lang.Class} object.
         */
-       public VocabularyTermWizard(Class<T> vocabularyClass, ConversationHolder conversation){ 
-               this.conversation = conversation;
+       public VocabularyTermWizard(Class<T> vocabularyClass){  
                termClass = vocabularyClass;
        }
        
@@ -54,8 +49,8 @@ public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard impl
         * @param vocabularyClass a {@link java.lang.Class} object.
         * @param selectedTerm a T object.
         */
-       public VocabularyTermWizard(Class<T> vocabularyClass, T selectedTerm, ConversationHolder conversation){
-               this(vocabularyClass, conversation);            
+       public VocabularyTermWizard(Class<T> vocabularyClass, T selectedTerm){
+               this(vocabularyClass);          
                term = (T) CdmStore.getService(ITermService.class).load(selectedTerm.getUuid());
                editMode = true;
        }
@@ -83,9 +78,7 @@ public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard impl
                }else{
                        TermStore.saveTerm(getTerm());
                }
-               
-               getConversationHolder().commit(true);
-               
+       
                return true;
        }
 
@@ -152,22 +145,6 @@ public class VocabularyTermWizard<T extends DefinedTermBase> extends Wizard impl
         */
        public Class<T> getTermClass() {
                return termClass;
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-               // not needed
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
+       }       
 
 }
index 11baa9aac56cae8b83dcdbca9b9b1f3525b7a435..39309b04b7a144bade73467e7599dd0c7d84e7da 100644 (file)
@@ -249,6 +249,7 @@ public class AppModelId {
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_CSV_OPENCSVEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.csv.OpenCsvExportWizard";
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_CSV_PRINT_OPENCSVPRINTEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.csv.print.OpenCsvPrintExportWizard";
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_DWCA_OPENDWCAEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenDwcaExportWizard";
+       public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_DWCA_OPENWFOBACKBONEEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.dwca.OpenWfoBackboneExportWizard";
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_JAXB_OPENJAXBEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.jaxb.OpenJaxbExportWizard";
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_OWL_OPENOWLTERMEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.owl.OpenOwlTermExportWizard";
        public static final String HANDLER_EU_ETAXONOMY_TAXEDITOR_IO_E4_OUT_SDD_OPENSDDEXPORTWIZARD = "eu.etaxonomy.taxeditor.io.e4.out.sdd.OpenSddExportWizard";
@@ -352,6 +353,7 @@ public class AppModelId {
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.GbifResponseImportView";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4 = "eu.etaxonomy.taxeditor.view.dataimport.e4.SpecimenImportView";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATASOURCE = "eu.etaxonomy.taxeditor.view.datasource";
+       public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_REMOTESEERVER = "eu.etaxonomy.taxeditor.view.remoteserver";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_DETAILS_DETAILSPARTE4 = "eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_E4_SUPPLEMENTALDATA_SUPPLEMENTALDATAPARTE4 = "eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4";
        public static final String PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_SESSIONS_SESSIONSVIEWPART = "eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart";
index e4305e254b670661facc499aa16120893bc90331..c6c59326e23d034eed75848d0ae53aaeb57278c9 100644 (file)
@@ -6,7 +6,6 @@
  * 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.store;
 
 import java.util.EnumSet;
@@ -27,8 +26,7 @@ import eu.etaxonomy.cdm.api.application.CdmApplicationException;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IAnnotationService;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
@@ -95,7 +93,6 @@ import eu.etaxonomy.taxeditor.io.ImportManager;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
-import eu.etaxonomy.taxeditor.session.mock.MockCdmEntitySessionManager;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.ui.dialog.RemotingLoginDialog;
 import eu.etaxonomy.taxeditor.util.ProgressMonitorClientManager;
@@ -108,6 +105,8 @@ import eu.etaxonomy.taxeditor.util.ProgressMonitorClientManager;
  * Only methods that either get or manipulate data are exposed here. So this
  * class acts as a facade for the methods in cdmlib-service.
  *
+ * NOTE by AM: TODO this description is outdated since we use remoting now.
+ *
  * @author n.hoffmann
  * @created 17.03.2009
  */
@@ -135,8 +134,6 @@ public class CdmStore {
 
     private static CdmStoreConnector job;
 
-//    private static CdmServer managedServer;
-
     private Language language;
 
     private ICdmSource cdmSource;
@@ -220,7 +217,7 @@ public class CdmStore {
         RemotingLoginDialog loginDialog = remotingLoginDialog;
         if(isActive()) {
             // before we connect we clear the entity caches and the sessions
-           CdmRemoteCacheManager.removeEntityCaches();
+            CdmRemoteCacheManager.removeEntityCaches();
             if(getCurrentSessionManager(true) != null) {
                 getCurrentSessionManager(true).disposeAll();
             }
@@ -277,13 +274,13 @@ public class CdmStore {
         CdmApplicationState.dispose();
     }
 
-    public static void setInstance(ICdmRepository applicationController,
+    public static void setInstance(CdmApplicationRemoteController applicationController,
             ICdmSource cdmSource) {
         instance = new CdmStore(applicationController, cdmSource);
-        CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+        CdmApplicationState.setTermProxy(new CdmServiceCachingProxy());
     }
 
-    protected CdmStore(ICdmRepository repository,
+    protected CdmStore(CdmApplicationRemoteController repository,
             ICdmSource cdmSource) {
         CdmApplicationState.setCurrentAppConfig(repository);
         CdmApplicationState.setCurrentDataChangeService(new CdmUIDataChangeService());
@@ -293,10 +290,8 @@ public class CdmStore {
 
     /**
      * All calls to the datastore require
-     *
-     * @return
      */
-    private ICdmRepository getApplicationConfiguration() {
+    private CdmApplicationRemoteController getApplicationConfiguration() {
         try {
             return CdmApplicationState.getCurrentAppConfig();
         } catch (Exception e) {
@@ -305,57 +300,26 @@ public class CdmStore {
         return null;
     }
 
-    public static ICdmRepository getCurrentApplicationConfiguration() {
-        if (getDefault() != null) {
-            return getDefault().getApplicationConfiguration();
+    public static CdmApplicationRemoteController getCurrentApplicationConfiguration() {
+        CdmStore defaultStore = getDefault();
+        if (defaultStore != null) {
+            return defaultStore.getApplicationConfiguration();
         }
         return null;
     }
 
-    /*
-     * CONVERSATIONS
-     */
-
-    /**
-     * Creates a new conversation, binds resources to the conversation and start
-     * a transaction for this conversation.
-     *
-     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-     *         object.
-     */
-    public static ConversationHolder createConversation() {
-        ConversationHolder conversation = getCurrentApplicationConfiguration()
-                .NewConversation();
-        try {
-            conversation.startTransaction();
-        }catch(Exception e){
-            MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
-        }
-        return conversation;
-    }
-
-    //FIXME:Remoting should be removed after moving completely to remoting
-    private MockCdmEntitySessionManager mockCdmEntitySessionManager;
-
     private ICdmEntitySessionManager getSessionManager() {
-        //FIXME:Remoting we should only have CdmApplicationRemoteConfiguration after move to remoting
-        //               bad hack which should be finally removed
-        if(getCurrentApplicationConfiguration() instanceof CdmApplicationRemoteController) {
-            return ((CdmApplicationRemoteController)getCurrentApplicationConfiguration()).getCdmEntitySessionManager();
-        } else {
-            if(mockCdmEntitySessionManager == null) {
-                mockCdmEntitySessionManager = new MockCdmEntitySessionManager();
-            }
-            return mockCdmEntitySessionManager;
-        }
+        return getCurrentApplicationConfiguration().getCdmEntitySessionManager();
     }
-    public static  ICdmEntitySessionManager getCurrentSessionManager() {
+
+    public static ICdmEntitySessionManager getCurrentSessionManager() {
         return getCurrentSessionManager(false);
     }
 
     public static  ICdmEntitySessionManager getCurrentSessionManager(boolean connecting) {
-        if (getDefault(connecting) != null) {
-            return getDefault(connecting).getSessionManager();
+        CdmStore cdmStore = getDefault(connecting);
+        if (cdmStore != null) {
+            return cdmStore.getSessionManager();
         }
         return null;
     }
@@ -632,22 +596,11 @@ public class CdmStore {
         return service;
     }
 
-//
-//    public static void setManagedServer(ICdmServer server) {
-//        managedServer = server;
-//    }
-//
-//    public static ICdmServer getManagedServer() {
-//        return managedServer;
-
     public boolean isConnected() {
         return isConnected;
     }
 
     public void setConnected(boolean isConnected) {
         this.isConnected = isConnected;
-
     }
-
-
-}
+}
\ No newline at end of file
index 54356465cedc98013ecec59cc5a4bd164c193330..24e93b69ae046229ad79a73b081a21e7a3d95a31 100644 (file)
@@ -21,13 +21,11 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.springframework.core.io.Resource;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
 import eu.etaxonomy.cdm.config.CdmSourceException;
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
-import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.metadata.CdmMetaData;
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
@@ -155,13 +153,13 @@ class CdmStoreConnector extends Job {
                             }
                         });
 
-                        ICdmRepository applicationController = null;
+                        CdmApplicationRemoteController applicationController = null;
 
                         if (!monitor.isCanceled()) {
                             CdmProgressMonitorAdapter subprogressMonitor = CdmProgressMonitorAdapter
                                     .CreateSubMonitor(monitor, 3);
                             // genrerate new application controller
-                            applicationController = getApplicationController(cdmSource,subprogressMonitor);
+                            applicationController = getApplicationController(cdmSource, subprogressMonitor);
                         }
 
                         if (!monitor.isCanceled()) {
@@ -175,7 +173,7 @@ class CdmStoreConnector extends Job {
                                     //loginDialog.onComplete();
                                     CdmStore.getContextManager().notifyContextStart();
                                     loginDialog.onComplete();
-                                    //TODO AM: is this necessary to be done on display thread? 
+                                    //TODO AM: is this necessary to be done on display thread?
                                     new TermLoader().unloadAllTerms();
                                     Rank.initDefaultTerms();
                                     NomenclaturalStatusType.initDefaultTerms();
@@ -202,14 +200,8 @@ class CdmStoreConnector extends Job {
         }
     }
 
-    private ICdmRepository getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
-        if(cdmSource instanceof ICdmDataSource) {
-            return  CdmApplicationController.NewInstance(applicationContextBean,
-                    (ICdmDataSource)cdmSource,
-                    dbSchemaValidation,
-                    false,
-                    subprogressMonitor);
-        } else if(cdmSource instanceof ICdmRemoteSource) {
+    private CdmApplicationRemoteController getApplicationController(ICdmSource cdmSource, CdmProgressMonitorAdapter subprogressMonitor) {
+        if(cdmSource instanceof ICdmRemoteSource) {
             return CdmApplicationRemoteController.NewInstance((ICdmRemoteSource)cdmSource,
                     subprogressMonitor,
                     null);
index 36b8adffd81adbc8611434f7758b82f169037ae6..c1930324ce6bc599f010cbbd611e802176645fa4 100644 (file)
@@ -11,7 +11,8 @@ package eu.etaxonomy.taxeditor.store;
 import java.util.Observable;
 import java.util.Set;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.ui.IMemento;
 import org.springframework.security.authentication.BadCredentialsException;
@@ -22,14 +23,11 @@ import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContextHolder;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.util.CdmUserHelper;
 import eu.etaxonomy.cdm.api.util.RoleProberImpl;
 import eu.etaxonomy.cdm.api.util.UserHelper;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.cdm.model.permission.User;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.cdm.persistence.permission.Role;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -39,13 +37,10 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  *
  * @author n.hoffmann
  * @created 03.07.2009
- * @version 1.0
  */
-public class LoginManager extends Observable implements IConversationEnabled, IContextListener{
+public class LoginManager extends Observable implements IContextListener{
 
-       public static final Logger logger = LogManager.getLogger(LoginManager.class);
-
-       private ConversationHolder conversation;
+       public static final Logger logger = LogManager.getLogger();
 
        public static final String INCORRECT_CREDENTIALS_MESSAGE = "Login and/or Password incorrect";
        public static final String ACCOUNT_LOCKED_MESSAGE = "Account is locked";
@@ -124,10 +119,8 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
                e.printStackTrace();
                throw new CdmAuthenticationException(EMPTY_CREDENTIALS_MESSAGE, e);
            }
-
        }
 
-
        private void _logGrantedAuthotities(StringBuilder gaText, String indent,
                        Set<GrantedAuthority> gaSet) {
                for(GrantedAuthority ga : gaSet){
@@ -135,11 +128,6 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
                }
        }
 
-       /**
-        * <p>getAuthenticatedUser</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.model.common.User} object.
-        */
        public User getAuthenticatedUser(){
                Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
 
@@ -156,22 +144,6 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
                notifyObservers();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-        */
-       @Override
-       public void update(CdmDataChangeMap arg) {}
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-        */
-       @Override
-       public ConversationHolder getConversationHolder() {
-               if(conversation == null){
-                       conversation = CdmStore.createConversation();
-               }
-               return conversation;
-       }
 
        /**
         * Whether the current user has the role admin
@@ -205,12 +177,10 @@ public class LoginManager extends Observable implements IConversationEnabled, IC
 
        @Override
        public void contextStart(IMemento memento, IProgressMonitor monitor){
-               conversation = CdmStore.createConversation();
        }
 
        @Override
        public void contextRefresh(IProgressMonitor monitor) {
-               conversation = CdmStore.createConversation();
        }
 
        @Override
index 50735c5652a481492e2780a5a5995d2e6a4e045f..12e2ca0c4843a1afd9d80df01e6b3b868319cfc4 100644 (file)
@@ -16,7 +16,6 @@ import java.util.List;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.IMediaService;
@@ -26,6 +25,7 @@ import eu.etaxonomy.cdm.api.service.IReferenceService;
 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.config.FindOccurrencesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -40,7 +40,7 @@ import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
@@ -60,7 +60,7 @@ public class SearchManager {
 
     private static final int MAX_RESULTS_BEFORE_WARNING = 500;
 
-       public List<TaxonName> findNames(IIdentifiableEntityServiceConfigurator configurator, ConversationHolder conversation){
+       public List<TaxonName> findNames(IIdentifiableEntityServiceConfigurator configurator){
            List<TaxonName> records = CdmStore.getService(INameService.class).findByFullTitle(configurator.getClazz(), configurator.getTitleSearchStringSqlized(), configurator.getMatchMode(), configurator.getCriteria(), configurator.getPageSize(), configurator.getPageNumber(), configurator.getOrderHints(), configurator.getPropertyPaths());
            return records;
        }
@@ -119,7 +119,7 @@ public class SearchManager {
         * @param configurator the configurator to use for the search
         * @return a list of the SpecimenOrObservationBases matching the search parameters found
         */
-       public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator configurator, boolean showCountWarning){
+       public List<SpecimenOrObservationBase> findOccurrences(FindOccurrencesConfigurator configurator, boolean showCountWarning){
            // by default we do not show field units. This may be configured via preferences
            return findOccurrences(configurator, PreferencesUtil.getBooleanValue(IPreferenceKeys.BULK_EDITOR_OCCURRENCE_SHOW_FIELD_UNITS), showCountWarning);
        }
@@ -134,9 +134,9 @@ public class SearchManager {
         * @param showFieldUnits if <code>true</code> then also FieldUnits are searched
         * @return
         */
-       public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits,
+       public List<SpecimenOrObservationBase> findOccurrences(FindOccurrencesConfigurator configurator, boolean showFieldUnits,
                boolean showCountWarning){
-           List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
+           List<SpecimenOrObservationBase> records = new ArrayList<>();
                final List<String> BASE_OCCURRENCE_INIT_STRATEGY = Arrays.asList(new String[] {
                        "collection", //$NON-NLS-1$
                        "descriptions", //$NON-NLS-1$
@@ -222,8 +222,8 @@ public class SearchManager {
      * @return
      */
     public List<UuidAndTitleCache<NamedArea>> findNamedAreas(
-            IIdentifiableEntityServiceConfigurator searchConfigurator, List<TermVocabulary> vocs) {
-        List<UuidAndTitleCache<NamedArea>> entities = CdmStore.getService(ITermService.class).getUuidAndTitleCacheNamedArea(vocs, null, searchConfigurator.getTitleSearchString(), PreferencesUtil.getGlobalLanguage());
+            IIdentifiableEntityServiceConfigurator searchConfigurator, List<TermCollection> vocs) {
+        List<UuidAndTitleCache<NamedArea>> entities = CdmStore.getService(ITermService.class).getUuidAndTitleCache(NamedArea.class, vocs, null, searchConfigurator.getTitleSearchString(), PreferencesUtil.getGlobalLanguage(), null);
         return entities;
     }
 
index 75ef8d37f5f7f92dff3199ff29aed32ba23c2a80..64d932fcdae8ae8b2a6f8a0a87180f3876d0091d 100644 (file)
@@ -21,9 +21,9 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -37,8 +37,6 @@ import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
- * <p>StoreUtil class.</p>
- *
  * @author n.hoffmann
  * @created 11.05.2009
  */
@@ -164,8 +162,8 @@ public class StoreUtil extends AbstractUtility {
      * </ol>
      */
     public static int compareBySearchString(String searchString, String string1, String string2) {
-        string1 = string1.toLowerCase();
-        string2 = string2.toLowerCase();
+        string1 = CdmUtils.Nz(string1).toLowerCase();
+        string2 = CdmUtils.Nz(string2).toLowerCase();
         //1. search string at the beginning
         if(string1.startsWith(searchString)){
             if(!string2.startsWith(searchString)){
@@ -243,4 +241,4 @@ public class StoreUtil extends AbstractUtility {
         }
         return t;
     }
-}
+}
\ No newline at end of file
index c84e5f93ba0d67f241405de5481fe66dc96c8384..bec4a7fe2a530bffb4c602aa9a6818cf56b69578 100644 (file)
@@ -6,7 +6,6 @@
 * 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.store;
 
 import java.util.ArrayList;
@@ -18,22 +17,21 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
-import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.ui.combo.InverseTermWrapper;
 
 /**
  * @author n.hoffmann
@@ -43,211 +41,318 @@ public class TermManager {
 
     private Map<Object, List> cachedTermMap = new HashMap<>();
 
-    //new cache for features!!
-    //dinstinguish preferences for both
-    //load at start
-
-       public TermManager(){
-       }
-
-       public void reset(){
-               cachedTermMap = new HashMap<>();
-       }
-
-       public <T extends DefinedTermBase> List<T> getPreferredTerms(TermType termType){
-           List<?> terms = cachedTermMap.get(termType.getUuid());
-           List<T> termBaseList = new ArrayList<>();
-           if(terms==null || terms.isEmpty()){
-               termBaseList = getFilteredTerms(TermStore.<T>getTerms(termType, null));
-               if (termBaseList != null){
-                   cachedTermMap.put(termType.getUuid(), termBaseList);
-               }
-           }else{
-               Iterator<?> iterator = terms.iterator();
+    // new cache for features!!
+    // dinstinguish preferences for both
+    // load at start
+
+    public TermManager() {
+    }
+
+    public void reset() {
+        cachedTermMap = new HashMap<>();
+    }
+
+    public <T extends DefinedTermBase> List<T> getPreferredTerms(TermType termType) {
+        List<?> terms = cachedTermMap.get(termType.getUuid());
+        List<T> termBaseList = new ArrayList<>();
+        if (terms == null || terms.isEmpty()) {
+            termBaseList = getFilteredTerms(TermStore.<T> getTerms(termType, null));
+            if (termBaseList != null) {
+                cachedTermMap.put(termType.getUuid(), termBaseList);
+            }
+        } else {
+            Iterator<?> iterator = terms.iterator();
             List<UUID> uuids = new ArrayList<>();
-            while (iterator.hasNext()){
+            while (iterator.hasNext()) {
                 Object term = iterator.next();
-                if (term instanceof TermDto){
-                    TermDto dto = (TermDto)term;
+                if (term instanceof TermDto) {
+                    TermDto dto = (TermDto) term;
                     uuids.add(dto.getUuid());
-                }else {
-                    termBaseList.add((T)term);
+                } else {
+                    termBaseList.add((T) term);
                 }
-
             }
-            if (!uuids.isEmpty()){
+            if (!uuids.isEmpty()) {
                 termBaseList.addAll(getTerms(uuids, termType));
             }
-           }
+        }
         return termBaseList;
-       }
+    }
+    
+    public <T extends DefinedTermBase>List<TermDto> getPreferredTermsAsDto(TermType termType) {
+        List<?> terms = cachedTermMap.get(termType.getUuid());
+        List<TermDto> termsAsDto = new ArrayList<>();
+        if (terms == null || terms.isEmpty()) {
+            List<T> termBaseList = new ArrayList<>();
+            termBaseList = getFilteredTerms(TermStore.<T> getTerms(termType, null));
+            if (termBaseList != null) {
+                cachedTermMap.put(termType.getUuid(), termBaseList);
+            }
+            for (T term:termBaseList) {
+                termsAsDto.add(TermDto.fromTerm(term));
+            }
+        } else {
+            List<TermDto> termBaseList = new ArrayList<>();
+            Iterator<?> iterator = terms.iterator();
+            List<UUID> uuids = new ArrayList<>();
+            while (iterator.hasNext()) {
+                Object term = iterator.next();
+                if (term instanceof TermDto) {
+                    TermDto dto = (TermDto) term;
+                    termsAsDto.add(dto);
+                } else {
+                    termsAsDto.add(TermDto.fromTerm((T)term));
+                }
+            }
+            
+        }
+        return termsAsDto;
+    }
 
-       public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary){
-           @SuppressWarnings("unchecked")
+    public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary) {
+        @SuppressWarnings("unchecked")
         List<T> terms = cachedTermMap.get(termVocabulary.getUuid());
-           if(terms==null){
-               terms = getFilteredTerms(new ArrayList<>(TermStore.getTerms(termVocabulary,null)));
-               cachedTermMap.put(termVocabulary.getUuid(), terms);
-           }
-           return terms;
-       }
-
-   public List<TermDto> getPreferredTerms(TermVocabularyDto termVocabularyDto){
-       @SuppressWarnings("unchecked")
-       List<TermDto> terms = cachedTermMap.get(termVocabularyDto.getUuid());
-       if(terms==null || terms.isEmpty()){
-           terms = getFilteredTermDtos(new ArrayList<>(termVocabularyDto.getTerms()));
-           cachedTermMap.put(termVocabularyDto.getUuid(), terms);
-       }
-       return terms;
-   }
-
-   public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary,
-           Comparator comp){
-       if (comp == null){
-           comp = new DefaultTermComparator<T>();
-       }
-       @SuppressWarnings("unchecked")
-    List<T> terms = cachedTermMap.get(termVocabulary.getUuid());
-       List<T> termBaseList = new ArrayList<>();
-       if(terms==null){
-           termBaseList = getFilteredTerms(new ArrayList<T>(TermStore.getTerms(termVocabulary, comp)));
-           cachedTermMap.put(termVocabulary.getUuid(), termBaseList);
-       }else{
-           Iterator<?> iterator = terms.iterator();
-           List<UUID> uuids = new ArrayList<>();
-           while (iterator.hasNext()){
-               Object term = iterator.next();
-               if (term instanceof TermDto){
-                   TermDto dto = (TermDto)term;
-                   uuids.add(dto.getUuid());
-               }else {
-                   termBaseList.add((T)term);
-               }
-           }
-
-           if (!uuids.isEmpty()){
-               termBaseList.addAll(this.getTerms(uuids, DefinedTermBase.class));
-           }
-
-       }
-       termBaseList.sort(comp);
-       terms = termBaseList;
-       return terms;
-   }
-
-       public <T extends DefinedTermBase> List<T> getPreferredTerms(Class<T> clazz){
-           @SuppressWarnings("unchecked")
+        if (terms == null) {
+            terms = getFilteredTerms(new ArrayList<>(TermStore.getTerms(termVocabulary, null)));
+            cachedTermMap.put(termVocabulary.getUuid(), terms);
+        }
+        return terms;
+    }
+
+    public List<TermDto> getPreferredTerms(TermVocabularyDto termVocabularyDto) {
+        @SuppressWarnings("unchecked")
+        List<TermDto> terms = cachedTermMap.get(termVocabularyDto.getUuid());
+        if (terms == null || terms.isEmpty()) {
+            terms = getFilteredTermDtos(new ArrayList<>(termVocabularyDto.getTerms()));
+            cachedTermMap.put(termVocabularyDto.getUuid(), terms);
+        }
+        return terms;
+    }
+
+    public List<TermDto> getPreferredTerms(TermCollectionDto termVocabularyDto) {
+        @SuppressWarnings("unchecked")
+        List<TermDto> terms = cachedTermMap.get(termVocabularyDto.getUuid());
+        if (terms == null || terms.isEmpty()) {
+            terms = getFilteredTermDtos(new ArrayList<>(termVocabularyDto.getTerms()));
+            cachedTermMap.put(termVocabularyDto.getUuid(), terms);
+        }
+        return terms;
+    }
+
+    public <T extends DefinedTermBase> List<T> getPreferredTerms(TermVocabulary<T> termVocabulary, Comparator comp) {
+        if (comp == null) {
+            comp = new DefaultTermComparator<>();
+        }
+        @SuppressWarnings("unchecked")
+        List<T> terms = cachedTermMap.get(termVocabulary.getUuid());
+        List<T> termBaseList = new ArrayList<>();
+        if (terms == null) {
+            termBaseList = getFilteredTerms(new ArrayList<>(TermStore.getTerms(termVocabulary, comp)));
+            cachedTermMap.put(termVocabulary.getUuid(), termBaseList);
+        } else {
+            Iterator<?> iterator = terms.iterator();
+            List<UUID> uuids = new ArrayList<>();
+            while (iterator.hasNext()) {
+                Object term = iterator.next();
+                if (term instanceof TermDto) {
+                    TermDto dto = (TermDto) term;
+                    uuids.add(dto.getUuid());
+                } else {
+                    termBaseList.add((T) term);
+                }
+            }
+
+            if (!uuids.isEmpty()) {
+                termBaseList.addAll(this.getTerms(uuids, DefinedTermBase.class));
+            }
+
+        }
+        termBaseList.sort(comp);
+        terms = termBaseList;
+        return terms;
+    }
+
+    public <T extends DefinedTermBase> List<T> getPreferredTerms(Class<T> clazz) {
+        @SuppressWarnings("unchecked")
+        List<T> terms = cachedTermMap.get(clazz);
+        if (terms == null) {
+            terms = getFilteredTerms(TermStore.getTerms(clazz));
+            cachedTermMap.put(clazz, terms);
+        }
+        return terms;
+    }
+    
+    public <T extends DefinedTermBase> List<TermDto> getPreferredTermsAsDto(Class<T> clazz) {
+        @SuppressWarnings("unchecked")
         List<T> terms = cachedTermMap.get(clazz);
-           if(terms==null){
-               terms = getFilteredTerms(TermStore.getTerms(clazz));
-               cachedTermMap.put(clazz, terms);
-           }
-           return terms;
-       }
-
-       /**
-        * Generic method to get term preferences for a term vocabulary
-        *
-        * @param initialTerms a {@link java.util.List} object.
-        * @return a {@link java.util.List} object.
-        */
-       public <T extends DefinedTermBase> List<T> getFilteredTerms(List<T> initialTerms){
-               List<T> filteredTerms = new ArrayList<>();
-               if (initialTerms == null || initialTerms.isEmpty()){
-                   return filteredTerms;
-               }
-
-               for (T term : initialTerms){
-//                     if (term instanceof InverseTermWrapper){
-//                             if(!PreferencesUtil.getBooleanValue(getPrefName(term), true)){
-//                                     T type = (T)((TaxonRelationshipTypeInverseContainer) term).getType();
-//                                     filteredTerms.add(type);
-//                             }
-//                     }
-
-                       if(PreferencesUtil.getBooleanValue(getPrefName(term), true)){
-                               filteredTerms.add(term);
-                       }
-               }
-               if (filteredTerms.isEmpty()){
-                   //check for dtos
-                   List<TermDto> preferredTerms = null;
-                   if (initialTerms.get(0).getVocabulary() != null){
-                       preferredTerms = cachedTermMap.get(initialTerms.get(0).getVocabulary().getUuid());
-                   }
-                   if (preferredTerms == null){
-                       preferredTerms = cachedTermMap.get(initialTerms.get(0).getTermType().getUuid());
-                   }
-                   if (preferredTerms == null){
-                       return initialTerms;
-                   }
-                   for (T term : initialTerms){
-                   if (preferredTerms.contains(TermDto.fromTerm(term))){
-                       filteredTerms.add(term);
-                   }
-               }
-                   if (filteredTerms.isEmpty()){
-                       return initialTerms;
-                   }
-               }
-
-               return filteredTerms;
-       }
-
-       public <T extends DefinedTermBase>List<T> createTermListFromString(String stringValue, TermType type){
-                List<String> checked = new ArrayList<>();
-
-               if (stringValue != null){
-                       String[] listChecked = stringValue.split(";"); //$NON-NLS-1$
-                       String[] listCheckedComma = stringValue.split(","); //$NON-NLS-1$
-                       if (listChecked != null ){
-                               checked = Arrays.asList(listChecked);
-                       }
-                       if (listCheckedComma != null && stringValue.contains(",")){ //$NON-NLS-1$
-                               checked = Arrays.asList(listCheckedComma);
-                       }
-               }
+        List<TermDto> termsAsDto = new ArrayList<>();
+        if (terms == null) {
+            terms = getFilteredTerms(TermStore.getTerms(clazz));
+            cachedTermMap.put(clazz, terms);
+        }
+        for (T term: terms) {
+            termsAsDto.add(TermDto.fromTerm(term));
+        }
+        return termsAsDto;
+    }
+
+    /**
+     * Generic method to get term preferences for a term vocabulary
+     *
+     * @param initialTerms
+     *            a {@link java.util.List} object.
+     * @return a {@link java.util.List} object.
+     */
+    public <T extends DefinedTermBase> List<T> getFilteredTerms(List<T> initialTerms) {
+        List<T> filteredTerms = new ArrayList<>();
+        if (initialTerms == null || initialTerms.isEmpty()) {
+            return filteredTerms;
+        }
+
+        for (T term : initialTerms) {
+            // if (term instanceof InverseTermWrapper){
+            // if(!PreferencesUtil.getBooleanValue(getPrefName(term), true)){
+            // T type = (T)((TaxonRelationshipTypeInverseContainer)
+            // term).getType();
+            // filteredTerms.add(type);
+            // }
+            // }
+            
+            List<UUID> availableLanguages = PreferencesUtil.createUUIDListFromStringPref(PreferencePredicate.AvailableLanguages.getKey(), false);
+            if (availableLanguages != null && availableLanguages.contains(term.getUuid())) {
+                filteredTerms.add(term);
+            }
+        }
+        if (filteredTerms.isEmpty()) {
+            // check for dtos
+            List<TermDto> preferredTerms = null;
+            if (initialTerms.get(0).getVocabulary() != null) {
+                preferredTerms = cachedTermMap.get(initialTerms.get(0).getVocabulary().getUuid());
+            }
+            if (preferredTerms == null) {
+                preferredTerms = cachedTermMap.get(initialTerms.get(0).getTermType().getUuid());
+            }
+            if (preferredTerms == null) {
+                return initialTerms;
+            }
+            for (T term : initialTerms) {
+                if (preferredTerms.contains(TermDto.fromTerm(term))) {
+                    filteredTerms.add(term);
+                }
+            }
+            if (filteredTerms.isEmpty()) {
+                return initialTerms;
+            }
+        }
+
+        return filteredTerms;
+    }
+    
+    /**
+     * Generic method to get term preferences for a term vocabulary
+     *
+     * @param initialTerms
+     *            a {@link java.util.List} object.
+     * @return a {@link java.util.List} object.
+     */
+    public <T extends DefinedTermBase> List<TermDto> getFilteredTermsAsDto(List<TermDto> initialTerms) {
+        List<TermDto> filteredTerms = new ArrayList<>();
+        if (initialTerms == null || initialTerms.isEmpty()) {
+            return filteredTerms;
+        }
+
+        for (TermDto term : initialTerms) {
+            if (PreferencesUtil.getBooleanValue(getPrefNameByDto(term), true)) {
+                filteredTerms.add(term);
+            }
+        }
+        if (filteredTerms.isEmpty()) {
+            // check for dtos
+            List<TermDto> preferredTerms = null;
+            if (initialTerms.get(0).getVocabularyUuid() != null) {
+                preferredTerms = cachedTermMap.get(initialTerms.get(0).getVocabularyUuid());
+            }
+            if (preferredTerms == null) {
+                preferredTerms = cachedTermMap.get(initialTerms.get(0).getTermType().getUuid());
+            }
+            if (preferredTerms == null) {
+                return initialTerms;
+            }
+            for (TermDto term : initialTerms) {
+                if (preferredTerms.contains(term)) {
+                    filteredTerms.add(term);
+                }
+            }
+            if (filteredTerms.isEmpty()) {
+                return initialTerms;
+            }
+        }
+
+        return filteredTerms;
+    }
+    
+
+    public <T extends DefinedTermBase> List<T> createTermListFromString(String stringValue, TermType type) {
+        List<String> checked = new ArrayList<>();
+
+        if (stringValue != null) {
+            String[] listChecked = stringValue.split(";"); //$NON-NLS-1$
+            String[] listCheckedComma = stringValue.split(","); //$NON-NLS-1$
+            if (listChecked != null) {
+                checked = Arrays.asList(listChecked);
+            }
+            if (listCheckedComma != null && stringValue.contains(",")) { //$NON-NLS-1$
+                checked = Arrays.asList(listCheckedComma);
+            }
+        }
         List<T> termsFromStringValues = getTermsFromStringValues(checked, type);
         return termsFromStringValues;
-       }
-
-        protected <T extends DefinedTermBase> List<T> getTermsFromStringValues(List<String> listValue, TermType type) {
-               List<DefinedTermBase> termlist = new ArrayList<>();
-               ITermService termService = CdmStore.getService(ITermService.class);
-               Set<UUID> uuidList = new HashSet<>();
-               for (String s : listValue) {
-                   if (StringUtils.isNotBlank(s)){
-                       UUID uuid = UUID.fromString(s);
-                       uuidList.add(uuid);
-                   }
-               }
-               if (!uuidList.isEmpty()){
-                   termlist = termService.find(uuidList);
-               }else{
-                   termlist = termService.listByTermType(type, null, null, null, null);
-               }
-
-               return new ArrayList(termlist);
-           }
-
-       /**
+    }
+
+    protected <T extends DefinedTermBase> List<T> getTermsFromStringValues(List<String> listValue, TermType type) {
+        List<DefinedTermBase> termlist = new ArrayList<>();
+        ITermService termService = CdmStore.getService(ITermService.class);
+        List<UUID> uuidList = new ArrayList<>();
+
+        for (String s : listValue) {
+            if (StringUtils.isNotBlank(s)) {
+                UUID uuid = UUID.fromString(s);
+                uuidList.add(uuid);
+            }
+        }
+
+        List<T> allTerms = getTerms(uuidList, type);
+        if (!allTerms.isEmpty()) {
+            return allTerms;
+        }
+
+        if (!uuidList.isEmpty() && allTerms.isEmpty()) {
+            termlist = termService.find(new HashSet(uuidList));
+        } else {
+            termlist = termService.listByTermType(type, null, null, null, null);
+        }
+
+        return new ArrayList(termlist);
+    }
+
+    /**
      * Generic method to get term preferences for a term vocabulary
      *
-     * @param initialTerms a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
      * @return a {@link java.util.List} object.
      */
-    public List<TermDto> getFilteredTermDtos(List<TermDto> initialTerms){
+    public List<TermDto> getFilteredTermDtos(List<TermDto> initialTerms) {
 
         List<TermDto> filteredTerms = new ArrayList<>();
 
-        for (TermDto term : initialTerms){
-            //TODO:inverse terms!!
-            if(PreferencesUtil.getBooleanValue(getPrefNameByDto(term))){
+        for (TermDto term : initialTerms) {
+            // TODO:inverse terms!!
+            if (PreferencesUtil.getBooleanValue(getPrefNameByDto(term))) {
                 filteredTerms.add(term);
             }
         }
-        if (filteredTerms.isEmpty()){
+        if (filteredTerms.isEmpty()) {
             return initialTerms;
         }
 
@@ -255,66 +360,60 @@ public class TermManager {
     }
 
     private <T extends TermBase> String getPrefName(T term) {
-        return term.getTermType()!=null?term.getTermType().toString()+term.getUuid().toString():""+term.getUuid().toString();
+        return term.getTermType() != null ? term.getTermType().toString() + term.getUuid().toString()
+                : "" + term.getUuid().toString();
     }
 
     private String getPrefNameByDto(TermDto term) {
-        return term.getTermType()!=null?term.getTermType().toString()+term.getUuid().toString():""+term.getUuid().toString();
+        return term.getTermType() != null ? term.getTermType().toString() + term.getUuid().toString()
+                : "" + term.getUuid().toString();
+    }
+
+    private <T extends DefinedTermBase> TermVocabulary<T> getTermVocabulary(Collection<T> initialTerms) {
+
+        if (!initialTerms.isEmpty()) {
+            T entity = initialTerms.iterator().next();
+            return entity.getVocabulary();
+        }
+        return null;
     }
 
-       private <T extends DefinedTermBase> TermVocabulary<T> getTermVocabulary(Collection<T> initialTerms){
-
-               if(!initialTerms.isEmpty()){
-               T entity = initialTerms.iterator().next();
-               return entity.getVocabulary();
-           }
-           return null;
-       }
-
-       /**
-        * Generic method to set term preferences
-        *
-        * @param preferredTerms a {@link java.util.List} object.
-        * @param initialTerms a {@link java.util.List} object.
-        * @param <T> a T object.
-        */
-       public <T extends DefinedTermBase> void setPreferredTerms(Collection<T> preferredTerms, Collection<T> initialTerms){
-           TermVocabulary<T> voc = getTermVocabulary(initialTerms);
-               Collection<UUID> undesiredTermUuids = new ArrayList<>();
-               for(TermBase term : initialTerms){
-                       if(! preferredTerms.contains(term)){
-                               undesiredTermUuids.add(term.getUuid());
-                               PreferencesUtil.setBooleanValue(getPrefName(term), false);
-                       }else{
-                           PreferencesUtil.setBooleanValue(getPrefName(term), true);
-                       }
-               }
-               clearTermMapForTermVoc(voc.getUuid());
-       }
-
-       /**
+    /**
      * Generic method to set term preferences
      *
-     * @param preferredTerms a {@link java.util.List} object.
-     * @param initialTerms a {@link java.util.List} object.
-     * @param <T> a T object.
+     * @param preferredTerms
+     *            a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
+     * @param <T>
+     *            a T object.
      */
-    public  void setPreferredTermsByType(Collection<TermDto> preferredTerms, TermType type){
-        List<?> oldValues = getPreferredTerms(type);
-        if (oldValues != null){
-            for (Object term: oldValues){
-                if (term instanceof TermDto){
-                    PreferencesUtil.setBooleanValue(getPrefNameByDto((TermDto)term), false);
-                }else{
-                    PreferencesUtil.setBooleanValue(getPrefName((DefinedTermBase)term), false);
-                }
+    public <T extends DefinedTermBase> void setPreferredTerms(Collection<T> preferredTerms,
+            Collection<T> initialTerms) {
+        TermVocabulary<T> voc = getTermVocabulary(initialTerms);
+        Collection<UUID> undesiredTermUuids = new ArrayList<>();
+        for (TermBase term : initialTerms) {
+            if (!preferredTerms.contains(term)) {
+                undesiredTermUuids.add(term.getUuid());
+                PreferencesUtil.setBooleanValue(getPrefName(term), false);
+            } else {
+                PreferencesUtil.setBooleanValue(getPrefName(term), true);
             }
         }
-//        for(TermDto term : preferredTerms){
-//           PreferencesUtil.setBooleanValue(getPrefNameByDto(term), true);
-//
-//        }
+        clearTermMapForTermVoc(voc.getUuid());
+    }
 
+    /**
+     * Generic method to set term preferences
+     *
+     * @param preferredTerms
+     *            a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
+     * @param <T>
+     *            a T object.
+     */
+    public void setPreferredTermsByType(Collection<TermDto> preferredTerms, TermType type) {
         clearTermMapForTermType(type);
         List<TermDto> list = new ArrayList<>(preferredTerms);
         cachedTermMap.put(type.getUuid(), list);
@@ -323,62 +422,65 @@ public class TermManager {
     /**
      * Generic method to set term preferences
      *
-     * @param preferredTerms a {@link java.util.List} object.
-     * @param initialTerms a {@link java.util.List} object.
-     * @param <T> a T object.
+     * @param preferredTerms
+     *            a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
+     * @param <T>
+     *            a T object.
      */
-    public void setPreferredTermsByDto(Collection<TermDto> preferredTerms, TermVocabularyDto vocDto){
+    public void setPreferredTermsByDto(Collection<TermDto> preferredTerms, TermCollectionDto termCollectionDto) {
 
-        List<TermDto> oldValues = getPreferredTerms(vocDto);
-        for (TermDto term: oldValues){
+        List<TermDto> oldValues = getPreferredTerms(termCollectionDto);
+        for (TermDto term : oldValues) {
             PreferencesUtil.setBooleanValue(getPrefNameByDto(term), false);
         }
         TermType type = null;
         boolean allSameType = true;
-        for(TermDto term : preferredTerms){
+        for (TermDto term : preferredTerms) {
             PreferencesUtil.setBooleanValue(getPrefNameByDto(term), true);
-           if (type == null){
-               type = term.getTermType();
-           }else if (!type.equals(term.getTermType())){
-               allSameType = false;
-           }
+            if (type == null) {
+                type = term.getTermType();
+            } else if (!type.equals(term.getTermType())) {
+                allSameType = false;
+            }
         }
 
-        //if (initialTerms.iterator().hasNext()){
-            clearTermMapForTermVoc(vocDto.getUuid());
-            List<TermDto> list = new ArrayList<>(preferredTerms);
-            cachedTermMap.put(vocDto.getUuid(), list);
-            if (allSameType){
-                cachedTermMap.put(type, list);
-            }
-        //}
+        // if (initialTerms.iterator().hasNext()){
+        clearTermMapForTermVoc(termCollectionDto.getUuid());
+        List<TermDto> list = new ArrayList<>(preferredTerms);
+        cachedTermMap.put(termCollectionDto.getUuid(), list);
+        if (allSameType) {
+            cachedTermMap.put(type, list);
+        }
+        // }
     }
 
+    public <T extends DefinedTermBase> void clearTermMapForTermVoc(UUID vocUuid) {
+        cachedTermMap.remove(vocUuid);
+    }
 
-       public <T extends DefinedTermBase> void clearTermMapForTermVoc(UUID vocUuid){
-           cachedTermMap.remove(vocUuid);
-       }
-
-       public void clearTermMapForTermType(TermType termType){
+    public void clearTermMapForTermType(TermType termType) {
         cachedTermMap.remove(termType.getUuid());
     }
 
-       /**
+    /**
      * Generic method to get term preferences for a term vocabulary
      *
-     * @param initialTerms a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
      * @return a {@link java.util.List} object.
      */
-    public <T extends DefinedTermBase> List<T> getTerms(List<UUID> uuidList, Class clazz){
+    public <T extends DefinedTermBase> List<T> getTerms(List<UUID> uuidList, Class clazz) {
 
         List<T> filteredTerms = new ArrayList<>();
         @SuppressWarnings("unchecked")
-               List<T> terms = TermStore.getTerms(clazz);
-        if (uuidList == null || uuidList.isEmpty()){
+        List<T> terms = TermStore.getTerms(clazz);
+        if (uuidList == null || uuidList.isEmpty()) {
             return terms;
         }
-        for (T term : terms){
-            if(uuidList.contains(term.getUuid())){
+        for (T term : terms) {
+            if (uuidList.contains(term.getUuid())) {
                 filteredTerms.add(term);
             }
         }
@@ -389,32 +491,34 @@ public class TermManager {
     /**
      * Generic method to get term preferences for a term vocabulary
      *
-     * @param initialTerms a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
      * @return a {@link java.util.List} object.
      */
-    public <T extends DefinedTermBase> List<T> getTerms(List<UUID> uuidList, TermType type){
+    public <T extends DefinedTermBase> List<T> getTerms(List<UUID> uuidList, TermType type) {
 
         List<T> filteredTerms = new ArrayList<>();
         List<T> terms = TermStore.getTerms(type, null);
-        if (uuidList == null || uuidList.isEmpty()){
+        if (uuidList == null || uuidList.isEmpty()) {
             return terms;
         }
-        for (T term : terms){
-            if(uuidList.contains(term.getUuid())){
+
+        for (T term : terms) {
+            if (uuidList.contains(term.getUuid())) {
                 filteredTerms.add(term);
             }
         }
-
         return filteredTerms;
     }
 
     /**
      * Generic method to get term preferences for a term vocabulary
      *
-     * @param initialTerms a {@link java.util.List} object.
+     * @param initialTerms
+     *            a {@link java.util.List} object.
      * @return a {@link java.util.List} object.
      */
-    public <T extends DefinedTermBase> List<T> getAllTerms(TermType type, Comparator comparator){
+    public <T extends DefinedTermBase> List<T> getAllTerms(TermType type, Comparator comparator) {
         List<T> terms = TermStore.getTerms(type, comparator);
         return terms;
     }
index 9eac9a2a9058a32e66c184f24f0921fd2b789b29..cda69dc85527dcbdf22e7c75db1ed9fa658f5367 100644 (file)
@@ -6,11 +6,9 @@
 * 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.store;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
@@ -19,16 +17,14 @@ import java.util.Set;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
-import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.name.Rank;
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
-import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
@@ -38,7 +34,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
  *
  * @author n.hoffmann
  * @created 25.06.2009
- * @version 1.0
  */
 public class TermStore {
 
@@ -141,7 +136,7 @@ public class TermStore {
        }
 
        /**
-        * Handingling of special cases
+        * Handling of special cases
         */
        private static Set<ITermStoreEdgeCase<? extends DefinedTermBase>> termStoreEdgeCases = new HashSet<>();
 
@@ -267,4 +262,4 @@ public class TermStore {
                public abstract List<TERM> getTerms();
 
        }
-}
+}
\ No newline at end of file
index 6dab303b3321727b5c0ca0ca3a6fad8cdf0fae2f..8b9afebd54a92ed34d2f02d150cb117c63219c5f 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2007 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 protected License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -13,28 +13,29 @@ import java.util.UUID;
 import eu.etaxonomy.cdm.model.term.VocabularyEnum;\r
 \r
 public class UsageTermCollection {\r
-       protected final static UUID uuidMarkersVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");\r
-       \r
+\r
+    protected final static UUID uuidMarkersVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");\r
+\r
        public final static UUID uuidUseMarkerType = UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039");\r
-       \r
+\r
        protected final static UUID uuidFeatureVocabulary = VocabularyEnum.Feature.getUuid(); //  UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");\r
        protected final static UUID uuidPalmWebFeatureTree = UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0");\r
-       \r
-       \r
+\r
+\r
        protected final static UUID uuidUseRecordFeature = UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599");\r
-       \r
+\r
        protected final static UUID uuidUseSummaryFeature = UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279");\r
-       \r
+\r
        public final static UUID uuidUseCategoryVocabulary = UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931");\r
        protected final static UUID uuidUseCategoryDummy = UUID.fromString("983a7184-6a51-489e-aca1-f21fc4fdbae3");\r
        protected final static UUID uuidUseSubCategoryDummy = UUID.fromString("a8d80223-5c79-4063-8c6b-4dc8681e9c62");\r
-       \r
+\r
        protected final static UUID uuidCountryVocabulary = UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b");\r
        protected final static UUID uuidCountryDummy = UUID.fromString("761dddee-bfa2-41f4-82df-3a19c71adee0");\r
-       \r
+\r
        protected final static UUID uuidPlantPartVocabulary = UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35");\r
        protected final static UUID uuidPlantPartDummy = UUID.fromString("30150a82-a12f-4278-96ad-7ce708efa082");\r
-       \r
+\r
        protected final static UUID uuidHumanGroupVocabulary = UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc");\r
        protected final static UUID uuidHumanGroupDummy = UUID.fromString("c4b63327-2548-429d-8d55-81fdba5900a5");\r
        protected final static UUID uuidEthnicGroupDummy = UUID.fromString("3ca851e5-d0d4-41cd-9066-f79e246c36c2");\r
@@ -49,14 +50,14 @@ public class UsageTermCollection {
        public final static String humanGroupLabel = "Human Group";\r
        public final static String ethnicGroupLabel = "Ethnic Group";\r
        public final static String notAvailableLabel = "N/A";\r
-       \r
-       \r
-       \r
-       \r
-       \r
-       \r
 \r
 \r
-       \r
-       \r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
 }\r
index 02cbe1a7907b13111823e5973939495289663ab8..055c1afee8bd8cdd8c0a0988de401240bde80c8a 100644 (file)
@@ -13,14 +13,15 @@ import java.net.URISyntaxException;
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.NullProgressMonitor;\r
 \r
-import eu.etaxonomy.cdm.common.URI;\r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.common.URI;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.cdm.model.description.State;\r
 import eu.etaxonomy.cdm.model.term.DefinedTerm;\r
+import eu.etaxonomy.cdm.model.term.OrderedTermVocabulary;\r
 import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
 \r
@@ -80,7 +81,8 @@ public class UseObjectStore {
                        monitor = new NullProgressMonitor();\r
                }\r
 \r
-               ConversationHolder conversation = CdmStore.createConversation();\r
+               //TODO remove ConversationHolder as we do not use it anymore since remoting\r
+               ConversationHolder conversation = null; //CdmStore.createConversation();\r
 \r
                //retrieve terms and vocabularies from db\r
                useRecordFeature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
@@ -137,14 +139,15 @@ public class UseObjectStore {
 //                     if (palmWebFeatureTree != null){\r
 //                             CdmStore.getService(ITermTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
 //                     }\r
-                       conversation.commit(true);\r
+\r
+//                     conversation.commit(true);\r
 \r
                }\r
-               conversation.close();\r
+//             conversation.close();\r
        }\r
 \r
        private static void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> humanGroupVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
+               TermVocabulary<DefinedTerm> humanGroupVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
                if (humanGroupVocabulary == null){\r
                        monitor.subTask("create human group vocabulary");\r
                        URI termSourceUri = null;\r
@@ -154,7 +157,7 @@ public class UseObjectStore {
                                e.printStackTrace();\r
                        }\r
 \r
-                       humanGroupVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+                       humanGroupVocabulary = TermVocabulary.NewInstance(TermType.Modifier, DefinedTerm.class, UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
                        humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
 \r
                        DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
@@ -171,7 +174,7 @@ public class UseObjectStore {
        }\r
 \r
        private static void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> plantPartVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
+               TermVocabulary<DefinedTerm> plantPartVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
                if (plantPartVocabulary == null){\r
                        monitor.subTask("create plant part vocabulary");\r
                        URI termSourceUri = null;\r
@@ -180,7 +183,7 @@ public class UseObjectStore {
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       plantPartVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+                       plantPartVocabulary = TermVocabulary.NewInstance(TermType.Modifier, DefinedTerm.class, UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
                        plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
 \r
                        DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
@@ -193,7 +196,7 @@ public class UseObjectStore {
        }\r
 \r
        private static void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<DefinedTerm> countryVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
+               TermVocabulary<DefinedTerm> countryVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
                if (countryVocabulary == null){\r
                        monitor.subTask("create country vocabulary");\r
                        URI termSourceUri = null;\r
@@ -202,7 +205,7 @@ public class UseObjectStore {
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       countryVocabulary = TermVocabulary.NewInstance(TermType.Modifier, UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+                       countryVocabulary = TermVocabulary.NewInstance(TermType.Modifier, DefinedTerm.class, UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
                        countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
 \r
                        DefinedTerm newDummyModifier = DefinedTerm.NewInstance(TermType.Modifier, UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
@@ -215,7 +218,7 @@ public class UseObjectStore {
        }\r
 \r
        private static void createStateVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<State> stateVocabulary =  CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
+               TermVocabulary<State> stateVocabulary = CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
                if (stateVocabulary == null){\r
                        monitor.subTask("create state vocabulary");\r
                        URI termSourceUri = null;\r
@@ -225,7 +228,7 @@ public class UseObjectStore {
                                e.printStackTrace();\r
                        }\r
 \r
-                       stateVocabulary = TermVocabulary.NewInstance(TermType.State, UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+                       stateVocabulary = OrderedTermVocabulary.NewOrderedInstance(TermType.State, State.class, UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
                        stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
 \r
                        State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
index 50484a6298758b68dd29d5250e172d36cdf1c5e7..195805bc75a192e998713d8faac5fe10d23b2dcf 100644 (file)
@@ -22,7 +22,9 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>AvailableFeaturesWizard class.</p>
+ * <p>
+ * AvailableFeaturesWizard class.
+ * </p>
  *
  * @author n.hoffmann
  * @created Aug 5, 2010
@@ -30,48 +32,48 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class AvailableTermsWizard extends Wizard {
 
-       private AvailableTermsWizardPage page;
+    private AvailableTermsWizardPage page;
 
-       private Set<DefinedTermBase> additionalFeatures;
+    private Set<DefinedTermBase> additionalFeatures;
 
     private List<TermVocabularyDto> vocabularyDtos;
 
     private boolean singleSelection = false;
 
-       public AvailableTermsWizard(TermType termType){
+    public AvailableTermsWizard(TermType termType) {
         vocabularyDtos = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermType(termType);
-       }
+    }
 
-       public AvailableTermsWizard(List<TermVocabularyDto> vocabularyDtos){
-           this.vocabularyDtos = vocabularyDtos;
-       }
+    public AvailableTermsWizard(List<TermVocabularyDto> vocabularyDtos) {
+        this.vocabularyDtos = vocabularyDtos;
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void addPages() {
-               page = new AvailableTermsWizardPage(vocabularyDtos,singleSelection);
-               addPage(page);
-       }
+    /** {@inheritDoc} */
+    @Override
+    public void addPages() {
+        page = new AvailableTermsWizardPage(vocabularyDtos, singleSelection);
+        addPage(page);
+    }
 
-       @Override
-       public boolean canFinish() {
+    @Override
+    public boolean canFinish() {
         int size = page.getSelectedFeatures().size();
-        return singleSelection?size==1:size>0;
-       }
-
-       /** {@inheritDoc} */
-       @Override
-       public boolean performFinish() {
-               additionalFeatures = page.getSelectedFeatures();
-               if(singleSelection && additionalFeatures.size()>1){
-                   MessagingUtils.warningDialog("Too many terms selected", this, "You can only select 1 term");
-               }
-               return additionalFeatures.size() > 0;
-       }
-
-       public Set<DefinedTermBase> getAdditionalFeatures() {
-               return additionalFeatures;
-       }
+        return singleSelection ? size == 1 : size > 0;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean performFinish() {
+        additionalFeatures = page.getSelectedFeatures();
+        if (singleSelection && additionalFeatures.size() > 1) {
+            MessagingUtils.warningDialog("Too many terms selected", this, "You can only select 1 term");
+        }
+        return additionalFeatures.size() > 0;
+    }
+
+    public Set<DefinedTermBase> getAdditionalFeatures() {
+        return additionalFeatures;
+    }
 
     public void setSingleSelection(boolean singleSelection) {
         this.singleSelection = singleSelection;
index 127319f4919eef8255a7794e7a546b6f28f639a1..3ab69bbc3b45cdfb69545da41d053d24061e5a77 100644 (file)
@@ -40,44 +40,45 @@ public class AvailableTermsWizardPage extends WizardPage {
     private CheckBoxTreeComposite treeComposite;
     private List<TermVocabularyDto> vocabularies;
 
-       protected AvailableTermsWizardPage(List<TermVocabularyDto> vocabularies, boolean singleSelection) {
-               super("Available Terms Wizard Page");
-               this.vocabularies = vocabularies;
-               setTitle("Available Terms");
-               if(singleSelection){
-                   setDescription("Please select one single term");
-               }
-               else{
-                   setDescription("Please select terms.");
-               }
-       }
+    protected AvailableTermsWizardPage(List<TermVocabularyDto> vocabularies, boolean singleSelection) {
+        super("Available Terms Wizard Page");
+        this.vocabularies = vocabularies;
+        setTitle("Available Terms");
+        if (singleSelection) {
+            setDescription("Please select one single term");
+        } else {
+            setDescription("Please select terms.");
+        }
+    }
 
-       /** {@inheritDoc} */
-       @Override
-       public void createControl(Composite parent) {
-        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(), SWT.NONE);
+    /** {@inheritDoc} */
+    @Override
+    public void createControl(Composite parent) {
+        treeComposite = new CheckBoxTreeComposite(parent, new TermDtoContentProvider(), new TermDtoLabelProvider(),
+                SWT.NONE);
         treeComposite.getViewer().setComparator(new DefinedTermSorter());
         treeComposite.getViewer().setInput(vocabularies);
         treeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-        treeComposite.getViewer().addSelectionChangedListener(e->getWizard().getContainer().updateButtons());
+        treeComposite.getViewer().addSelectionChangedListener(e -> getWizard().getContainer().updateButtons());
 
-               setControl(treeComposite);
-       }
+        setControl(treeComposite);
+    }
 
-       public Set<DefinedTermBase> getSelectedFeatures() {
+    public Set<DefinedTermBase> getSelectedFeatures() {
 
         List<Object> checkedElements = Arrays.asList(treeComposite.getViewer().getCheckedElements());
-        checkedElements = checkedElements.stream().filter(element->element instanceof TermDto).collect(Collectors.toList());
+        checkedElements = checkedElements.stream().filter(element -> element instanceof TermDto)
+                .collect(Collectors.toList());
 
-               Set<DefinedTermBase> terms = new HashSet<>();
+        Set<DefinedTermBase> terms = new HashSet<>();
 
-               for(Object element : checkedElements){
-                   if(element instanceof TermDto){
-                       DefinedTermBase term = CdmStore.getService(ITermService.class).load(((TermDto) element).getUuid());
-                       terms.add(term);
-                   }
-               }
-               return terms;
-       }
+        for (Object element : checkedElements) {
+            if (element instanceof TermDto) {
+                DefinedTermBase term = CdmStore.getService(ITermService.class).load(((TermDto) element).getUuid());
+                terms.add(term);
+            }
+        }
+        return terms;
+    }
 
 }
index 3ce8c204339daa48a355ce7cbc5ed421723676a2..6ca1429ee618b40c474c9b710a570a9c6fc9e7af 100644 (file)
@@ -29,20 +29,33 @@ public class TermChooseWizard extends Wizard {
        private List<AbstractTermDto> selectedTerms;
 
     private TermDto term;
+    private boolean skipStandartVocs = false;
+    private boolean skipManagedColls = true;
 
        public TermChooseWizard(TermDto term){
            this.term = term;
-
-
        }
 
+       public TermChooseWizard(TermDto term, boolean skipStandartVocs, boolean skipManagedColl){
+           this.term = term;
+           this.skipStandartVocs = skipStandartVocs;
+           this.skipManagedColls = skipManagedColl;
+       }
+       
     public List<AbstractTermDto> getSelectedTerms() {
         return selectedTerms;
     }
+    public boolean isSkipStandartVocs() {
+               return skipStandartVocs;
+       }
+
+       public void setSkipStandartVocs(boolean skipStandartVocs) {
+               this.skipStandartVocs = skipStandartVocs;
+       }
 
        @Override
        public void addPages() {
-               page = new TermChooseWizardPage(term);
+               page = new TermChooseWizardPage(term, skipStandartVocs, skipManagedColls);
                page.setPageComplete(false);
                addPage(page);
        }
index c0c725971d3a7c191f661b01481816098bcc6962..490da988d3e23d258f9e4a2ce441b99b516ef964 100644 (file)
@@ -29,13 +29,41 @@ public class TermChooseWizardPage extends WizardPage {
 
     private TermSearchController controller;
     private TermDto term;
+    private boolean skipStandartVocs;
+    private boolean skipManagedColls = true;
 
-       protected TermChooseWizardPage(TermDto term) {
+       protected TermChooseWizardPage(TermDto term, boolean skipStandardVocs) {
                super("Term Choose Wizard");
                setTitle("Choose Parent");
                setDescription("Please search and select the parent term or vocabulary (if you want to move the term as root).");
                this.term = term;
+               this.skipStandartVocs = skipStandardVocs;
        }
+       
+       protected TermChooseWizardPage(TermDto term, boolean skipStandardVocs, boolean skipManagedColls) {
+        super("Term Choose Wizard");
+        setTitle("Choose Parent");
+        setDescription("Please search and select the parent term or vocabulary (if you want to move the term as root).");
+        this.term = term;
+        this.skipStandartVocs = skipStandardVocs;
+        this.skipManagedColls = skipManagedColls;
+    }
+
+       public boolean isSkipStandartVocs() {
+               return skipStandartVocs;
+       }
+
+       public void setSkipStandartVocs(boolean skipStandartVocs) {
+               this.skipStandartVocs = skipStandartVocs;
+       }
+       
+       public boolean isSkipManagedColls() {
+        return skipManagedColls;
+    }
+
+    public void setSkipManagedColls(boolean skipManagedColls) {
+        this.skipManagedColls = skipManagedColls;
+    }
 
        @Override
        public void createControl(Composite parent) {
index efa0b4e1da55e2f4a3d17bc7e061ec5e3d94444a..1781098ca7590abed87110e527006ef49f48cb99 100644 (file)
@@ -15,6 +15,7 @@ import org.eclipse.jface.viewers.TreeViewer;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -26,22 +27,26 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
  * @author pplitzner
  * @since Nov 22, 2018
  */
-public interface ITermTreeEditor<T extends DefinedTermBase> 
-               extends IPostOperationEnabled, IE4SavablePart, ICdmEntitySessionEnabled {
+public interface ITermTreeEditor<T extends DefinedTermBase>
+        extends IPostOperationEnabled, IE4SavablePart, ICdmEntitySessionEnabled {
 
     public TermType getTermType();
 
     public TermNodeDto getNodeDtoForUuid(UUID nodeUuid);
-    public TermTreeDto getTreeDtoForUuid(UUID treeUuid);
+
+    public TermCollectionDto getTreeDtoForUuid(UUID treeUuid);
+
     public void setNodeDtoForUuid(TermNodeDto node);
+
     public void setTreeDtoForUuid(TermTreeDto tree);
-    public boolean checkDuplicates(UUID termUuid, UUID treeUuid) ;
 
+    public boolean checkDuplicates(UUID termUuid, UUID treeUuid);
 
     public void addOperation(AbstractPostOperation<TermNode> operation);
 
     public void setDirty();
 
     public TreeViewer getViewer();
+
     public void refresh();
 }
\ No newline at end of file
index b44d59168f74a4f4644a796bf3bac16ca357026a..fc305b13c6eac336b1190ad750c18281e90f7bbe 100644 (file)
@@ -19,11 +19,11 @@ import eu.etaxonomy.taxeditor.termtree.TermNodeTransfer;
 
 public class TermNodeDragListener extends DragSourceAdapter {
 
-       private final TreeViewer viewer;
+    private final TreeViewer viewer;
 
-       public TermNodeDragListener(TreeViewer viewer) {
-               this.viewer = viewer;
-       }
+    public TermNodeDragListener(TreeViewer viewer) {
+        this.viewer = viewer;
+    }
 
     /**
      * Method declared on DragSourceListener
@@ -31,8 +31,15 @@ public class TermNodeDragListener extends DragSourceAdapter {
     @Override
     public void dragSetData(DragSourceEvent event) {
         IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
-        if(selection!=null && !selection.isEmpty()){
+        if (selection != null && !selection.isEmpty()) {
             TermNode[] featureNodes = (TermNode[]) selection.toList().toArray(new TermNode[selection.size()]);
+            for (TermNode node : featureNodes) {
+                // if the termgraph is managed, it is not allowed to edit it.
+                if (node.getGraph().isManaged()) {
+                    return;
+                }
+
+            }
             if (TermNodeTransfer.getInstance().isSupportedType(event.dataType)) {
                 event.data = featureNodes;
             }
@@ -41,16 +48,15 @@ public class TermNodeDragListener extends DragSourceAdapter {
 
     }
 
-       /**
-        * Method declared on DragSourceListener
-        */
-       @Override
-       public void dragStart(DragSourceEvent event) {
-           ISelection sel = viewer.getSelection();
-           event.doit = !viewer.getSelection().isEmpty()
-                && ((IStructuredSelection) viewer.getSelection()).toList()
+    /**
+     * Method declared on DragSourceListener
+     */
+    @Override
+    public void dragStart(DragSourceEvent event) {
+        ISelection sel = viewer.getSelection();
+        event.doit = !viewer.getSelection().isEmpty() && ((IStructuredSelection) viewer.getSelection()).toList()
                 .stream().allMatch(element -> element instanceof TermNode);
 
-       }
+    }
 
 }
\ No newline at end of file
index d2e404c710b115fed7229594e77f00c0b607542b..c84a75658a170b669abcc1f5636eabed2a142471 100755 (executable)
@@ -41,7 +41,6 @@ public class TermNodeDtoDragListener extends DragSourceAdapter {
                 }
             }
         }
-
     }
 
        /**
@@ -53,7 +52,9 @@ public class TermNodeDtoDragListener extends DragSourceAdapter {
            if (sel instanceof TreeSelection && ((TreeSelection)sel).getFirstElement() instanceof TermNodeDto){
             event.doit = !viewer.getSelection().isEmpty()
                     && ((IStructuredSelection) viewer.getSelection()).toList()
-                    .stream().allMatch(element -> element instanceof TermNodeDto);
+                    .stream().allMatch(element -> element instanceof TermNodeDto)
+                    && ((IStructuredSelection) viewer.getSelection()).toList()
+                    .stream().allMatch(element -> !((TermNodeDto)element).isExternallyManaged());
            }else {
                event.doit = !viewer.getSelection().isEmpty()
                     && ((IStructuredSelection) viewer.getSelection()).toList()
index 650465b25c22de7a0f8d50c10a28c92352bebfa2..7953c0cd85b5ca9155fb6b6863d578a2aaa1e72b 100755 (executable)
@@ -66,12 +66,18 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
                Object currentTarget = getCurrentTarget();
                TermNodeDto target = null;
                if(currentTarget instanceof TermTreeDto){
+                       if (((TermTreeDto) currentTarget).isManaged()) {
+                               return false;
+                       }
                    target = ((TermTreeDto) currentTarget).getRoot();
                }
                else if(currentTarget instanceof TermNodeDto){
+                       if (((TermNodeDto) currentTarget).isExternallyManaged() ) {
+                               return false;
+                       }
                    target = (TermNodeDto) currentTarget;
                }
-               
+
                int position = 0;
                int location = getCurrentLocation();
                UUID parentUuid = target.getParentUuid();
@@ -201,7 +207,7 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
                        AddFeatureOperation operation = new AddFeatureOperation(
                                termDto.getUuid(),
                                target.getUuid(), position, editor, editor);
-                       TermNodeDto newDto = new TermNodeDto(termDto, target, position, target.getTree(), null, null, null);
+                       TermNodeDto newDto = new TermNodeDto(termDto, target, position, null, null, 0, null, null);
 
                 editor.setDirty();
                        editor.addOperation(operation);
@@ -258,7 +264,8 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
         TermTreeDto rootTree = null;
         if (getSelectedObject() instanceof TermNodeDto){
             TermNodeDto selectedNode = (TermNodeDto)getSelectedObject();
-            rootTree = selectedNode.getTree();
+            rootTree = (TermTreeDto) editor.getTreeDtoForUuid(selectedNode.getTreeUuid());
+            
         }
         if(target instanceof TermTreeDto && getCurrentLocation()!=ViewerDropAdapter.LOCATION_ON){
             return false;
@@ -266,7 +273,7 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
         if (target == null){
             return false;
         }
-        if (target instanceof TermNodeDto && ((TermNodeDto)target).getTree().isFlat() && getCurrentLocation() == LOCATION_ON){
+        if (target instanceof TermNodeDto && ((TermNodeDto)target).isFlat() && getCurrentLocation() == LOCATION_ON){
             return false;
         }
         TermDto term = null;
@@ -289,7 +296,7 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
     private boolean checkDuplication(Object target, TermTreeDto rootTree, TermDto term) {
         TermTreeDto targetTree = null;
         if (target instanceof TermNodeDto){
-            targetTree = ((TermNodeDto)target).getTree();
+            targetTree = (TermTreeDto) editor.getTreeDtoForUuid(((TermNodeDto)target).getTreeUuid());
         }else if (target instanceof TermTreeDto){
             targetTree = (TermTreeDto)target;
         }
index 1958846db6f1a0c3f4d93044c9a88d75483067f5..c610c9bf4fb318249add535901c7cdf43a9d9683 100755 (executable)
@@ -35,6 +35,7 @@ import eu.etaxonomy.cdm.api.service.ITermTreeService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermTransfer;
@@ -52,9 +53,9 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.FeatureTreeSelectionDialog;
  * @author pplitzner
  * @since Jun 19, 2017
  */
-public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Composite{
+public class TermTreeDtoEditorComposite<T extends DefinedTermBase> extends Composite {
 
-    private TermTreeDto featureTree;
+    private TermCollectionDto featureTree;
 
     private Label label_title;
     private Text text_title;
@@ -68,8 +69,7 @@ public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Comp
         setLayout(new GridLayout(1, false));
 
         Composite composite_treeTitle = new Composite(this, SWT.NULL);
-        composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
-                false));
+        composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
         GridLayout gl_composite_treeTitle = new GridLayout(3, false);
         gl_composite_treeTitle.marginWidth = 0;
         composite_treeTitle.setLayout(gl_composite_treeTitle);
@@ -90,69 +90,36 @@ public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Comp
         viewer = new TreeViewer(new Tree(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI));
         Tree tree = viewer.getTree();
         tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
-        viewer.getControl().setLayoutData(
-                new GridData(SWT.FILL, SWT.FILL, true, true));
+        viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
     }
 
-    public void init(String label,
-            DragSourceListener dragSourceListener,
-            DropTargetListener dropTargetListener,
-            ISelectionChangedListener viewerSelectionChangedListener,
-            IDirtyMarkable dirtyMarkable,
+    public void init(String label, DragSourceListener dragSourceListener, DropTargetListener dropTargetListener,
+            ISelectionChangedListener viewerSelectionChangedListener, IDirtyMarkable dirtyMarkable,
             ModifyListener textModifyListener) {
-        init(label,
-                null,
-                dragSourceListener,
-                dropTargetListener,
-                null,
-                viewerSelectionChangedListener,
-                null,
-                dirtyMarkable,
-                textModifyListener);
+        init(label, null, dragSourceListener, dropTargetListener, null, viewerSelectionChangedListener, null,
+                dirtyMarkable, textModifyListener);
     }
 
-    public void init(String label, TermType termType,
-            DragSourceListener dragSourceListener,
-            DropTargetListener dropTargetListener,
-            ISelectionChangedListener viewerSelectionChangedListener,
-            IDirtyMarkable dirtyMarkable,
-            ModifyListener textModifyListener) {
-        this.init(label,
-                termType,
-                dragSourceListener,
-                dropTargetListener,
-                null,
-                viewerSelectionChangedListener,
-                null,
-                dirtyMarkable,
-                textModifyListener);
+    public void init(String label, TermType termType, DragSourceListener dragSourceListener,
+            DropTargetListener dropTargetListener, ISelectionChangedListener viewerSelectionChangedListener,
+            IDirtyMarkable dirtyMarkable, ModifyListener textModifyListener) {
+        this.init(label, termType, dragSourceListener, dropTargetListener, null, viewerSelectionChangedListener, null,
+                dirtyMarkable, textModifyListener);
     }
-    public void init(DragSourceListener dragSourceListener,
-            DropTargetListener dropTargetListener,
-            Transfer[] transfers,
+
+    public void init(DragSourceListener dragSourceListener, DropTargetListener dropTargetListener, Transfer[] transfers,
             ISelectionChangedListener viewerSelectionChangedListener,
-            SelectionListener openFeatureTreeSelectionListener,
-            ModifyListener textModifyListener) {
-        init(null,
-                null,
-                dragSourceListener,
-                dropTargetListener,
-                transfers,
-                viewerSelectionChangedListener,
-                openFeatureTreeSelectionListener,
-                null,
-                textModifyListener);
+            SelectionListener openFeatureTreeSelectionListener, ModifyListener textModifyListener) {
+        init(null, null, dragSourceListener, dropTargetListener, transfers, viewerSelectionChangedListener,
+                openFeatureTreeSelectionListener, null, textModifyListener);
     }
-    private void init(String label,
-            TermType termType,
-            DragSourceListener dragSourceListener,
-            DropTargetListener dropTargetListener,
-            Transfer[] transfers,
+
+    private void init(String label, TermType termType, DragSourceListener dragSourceListener,
+            DropTargetListener dropTargetListener, Transfer[] transfers,
             ISelectionChangedListener viewerSelectionChangedListener,
-            SelectionListener openFeatureTreeSelectionListener,
-            IDirtyMarkable dirtyMarkable,
+            SelectionListener openFeatureTreeSelectionListener, IDirtyMarkable dirtyMarkable,
             ModifyListener textModifyListener) {
-        if(label!=null){
+        if (label != null) {
             label_title.setText(label);
         }
 
@@ -160,41 +127,36 @@ public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Comp
         viewer.setLabelProvider(new TermTreeLabelProvider());
 
         int ops = DND.DROP_COPY | DND.DROP_MOVE;
-        if(transfers==null){
-        transfers = new Transfer[] {
-                CharacterNodeDtoTransfer.getInstance(),
-                TermTransfer.getInstance(),
-                };
+        if (transfers == null) {
+            transfers = new Transfer[] { CharacterNodeDtoTransfer.getInstance(), TermTransfer.getInstance(), };
         }
-        if(dragSourceListener!=null){
+        if (dragSourceListener != null) {
             viewer.addDragSupport(ops, transfers, dragSourceListener);
         }
-        if(dropTargetListener!=null){
+        if (dropTargetListener != null) {
             viewer.addDropSupport(ops, transfers, dropTargetListener);
         }
 
-        if(viewerSelectionChangedListener!=null){
+        if (viewerSelectionChangedListener != null) {
             viewer.addSelectionChangedListener(viewerSelectionChangedListener);
         }
 
-        if(textModifyListener!=null){
+        if (textModifyListener != null) {
             text_title.addModifyListener(textModifyListener);
         }
 
-        //add specific selection listener
-        if(openFeatureTreeSelectionListener!=null){
+        // add specific selection listener
+        if (openFeatureTreeSelectionListener != null) {
             btnOpenFeatureTree.addSelectionListener(openFeatureTreeSelectionListener);
-        }
-        else{
-            //add default selection listener
-            btnOpenFeatureTree.addSelectionListener(new SelectionAdapter(){
+        } else {
+            // add default selection listener
+            btnOpenFeatureTree.addSelectionListener(new SelectionAdapter() {
                 @Override
                 public void widgetSelected(SelectionEvent e) {
-                    TermTree<T> tree = FeatureTreeSelectionDialog.select(getDisplay().getActiveShell(),
-                            null, termType);
-                    if(tree!=null){
+                    TermTree<T> tree = FeatureTreeSelectionDialog.select(getDisplay().getActiveShell(), null, termType);
+                    if (tree != null) {
                         setSelectedTree(tree);
-                        if(dirtyMarkable!=null){
+                        if (dirtyMarkable != null) {
                             dirtyMarkable.forceDirty();
                         }
                     }
@@ -205,24 +167,24 @@ public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Comp
 
     public void setSelectedTree(TermTree<T> featureTree) {
         this.featureTree = CdmStore.getService(ITermTreeService.class).getTermTreeDtoByUuid(featureTree.getUuid());
-        addChildNodesToMap(this.featureTree.getRoot());
+        addChildNodesToMap(((TermTreeDto) this.featureTree).getRoot());
         viewer.setInput(this.featureTree);
 
-        StoreUtil.setTextWithoutModifyListeners(text_title, featureTree!=null?featureTree.getTitleCache():"");
+        StoreUtil.setTextWithoutModifyListeners(text_title, featureTree != null ? featureTree.getTitleCache() : "");
     }
 
     private void addChildNodesToMap(TermNodeDto root) {
         this.nodeUuidMap.put(root.getUuid(), root);
-        if (root.getTerm() != null){
+        if (root.getTerm() != null) {
             this.featureTree.addTerm(root.getTerm());
         }
-        for (TermNodeDto child: root.getChildren()){
+        for (TermNodeDto child : root.getChildren()) {
             addChildNodesToMap(child);
         }
 
     }
 
public TermTreeDto getFeatureTree() {
   public TermCollectionDto getFeatureTree() {
         return featureTree;
     }
 
@@ -251,10 +213,8 @@ public class TermTreeDtoEditorComposite <T extends DefinedTermBase> extends Comp
      */
     public void refresh() {
         getViewer().setInput(getViewer().getInput());
-        addChildNodesToMap(this.featureTree.getRoot());
+        addChildNodesToMap(((TermTreeDto) this.featureTree).getRoot());
 
     }
 
-
-
 }
index 2f460357e896fe2765a1bc75fad38781fac3e8a0..3089844ce5fcc67f4c9e6df1d11945eadc7f72e0 100644 (file)
@@ -46,18 +46,18 @@ import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.IMemento;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITermNodeService;
 import eu.etaxonomy.cdm.api.service.ITermTreeService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.AnnotationDto;
+import eu.etaxonomy.cdm.persistence.dto.MarkerDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermTransfer;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermTreeViewerComparator;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -83,15 +83,12 @@ import eu.etaxonomy.taxeditor.workbench.part.IE4ViewerPart;
  * @author pplitzner
  * @date 06.06.2017
  */
-public class TermTreeEditor<T extends DefinedTermBase>
-               implements ITermTreeEditor, ISelectionChangedListener,
-               IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData,
-               IContextListener, IConversationEnabled, IDirtyMarkable {
+public class TermTreeEditor<T extends DefinedTermBase> implements ITermTreeEditor, ISelectionChangedListener,
+        IE4ViewerPart, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, IDirtyMarkable {
 
     public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openTermTreeEditor";
 
-    public static final List<String> TREE_PROPERTY_PATH = Arrays.asList(new String[] {
-            "root", //$NON-NLS-1$
+    public static final List<String> TREE_PROPERTY_PATH = Arrays.asList(new String[] { "root", //$NON-NLS-1$
             "root.children", //$NON-NLS-1$
             "root.children.inapplicableIf", //$NON-NLS-1$
             "root.children.inapplicableIf.term", //$NON-NLS-1$
@@ -101,8 +98,6 @@ public class TermTreeEditor<T extends DefinedTermBase>
             "root.children.onlyApplicableIf.state", //$NON-NLS-1$
     });
 
-    private ConversationHolder conversation;
-
     private ICdmEntitySession cdmEntitySession;
 
     @Inject
@@ -119,7 +114,7 @@ public class TermTreeEditor<T extends DefinedTermBase>
 
     private TreeViewer viewer;
 
-    Map<UUID,TermTreeDto> trees;
+    Map<UUID, TermCollectionDto> trees;
 
     Map<UUID, TermNodeDto> uuidTermMap = new HashMap<>();
     Map<UUID, CreateFeatureTreeOperation> createOperationList = new HashMap<>();
@@ -134,11 +129,10 @@ public class TermTreeEditor<T extends DefinedTermBase>
     }
 
     @PostConstruct
-    public void createControl(Composite parent, EMenuService menuService){
-        if (CdmStore.isActive()){
+    public void createControl(Composite parent, EMenuService menuService) {
+        if (CdmStore.isActive()) {
             initSession();
-        }
-        else{
+        } else {
             return;
         }
         parent.setLayout(new FillLayout());
@@ -149,20 +143,17 @@ public class TermTreeEditor<T extends DefinedTermBase>
         viewer.setLabelProvider(new TermTreeLabelProvider());
 
         int ops = DND.DROP_COPY | DND.DROP_MOVE;
-        Transfer[] transfers = new Transfer[] {
-                TermNodeDtoTransfer.getInstance(),
-                TermTransfer.getInstance(),
-                LocalSelectionTransfer.getTransfer()};
+        Transfer[] transfers = new Transfer[] { TermNodeDtoTransfer.getInstance(), TermTransfer.getInstance(),
+                LocalSelectionTransfer.getTransfer() };
         viewer.addDragSupport(ops, transfers, new TermNodeDtoDragListener(viewer));
         viewer.addDropSupport(ops, transfers, new TermTreeDtoDropAdapter(this, viewer, sync));
         viewer.addSelectionChangedListener(this);
         viewer.getTree().addKeyListener(new KeyAdapter() {
             @Override
             public void keyPressed(KeyEvent e) {
-                if(e.stateMask == SWT.MOD1 && e.keyCode == 'c'){
+                if (e.stateMask == SWT.MOD1 && e.keyCode == 'c') {
                     copy(viewer.getStructuredSelection());
-                }
-                else if(e.stateMask == SWT.MOD1 && e.keyCode == 'v'){
+                } else if (e.stateMask == SWT.MOD1 && e.keyCode == 'v') {
                     paste(viewer.getStructuredSelection());
                 }
             }
@@ -172,44 +163,48 @@ public class TermTreeEditor<T extends DefinedTermBase>
         viewer.setComparator(new TermTreeViewerComparator());
         viewer.setInput(getTrees());
         contentProvider.setUuidTermMap(uuidTermMap);
-        //create context menu
-        menuService.registerContextMenu(viewer.getControl(), AppModelId.POPUPMENU_EU_ETAXONOMY_TAXEDITOR_STORE_POPUPMENU_FEATURETREEEDITOR);
+        // create context menu
+        menuService.registerContextMenu(viewer.getControl(),
+                AppModelId.POPUPMENU_EU_ETAXONOMY_TAXEDITOR_STORE_POPUPMENU_FEATURETREEEDITOR);
     }
 
-    public void init(TermType type, String label){
+    public void init(TermType type, String label) {
         this.termType = type;
         updateTrees();
         viewer.setComparator(new TermTreeViewerComparator());
         viewer.setInput(getTrees());
-        ((TermTreeContentProvider)viewer.getContentProvider()).setUuidTermMap(uuidTermMap);
+        ((TermTreeContentProvider) viewer.getContentProvider()).setUuidTermMap(uuidTermMap);
         thisPart.setLabel(label);
     }
 
-//    protected abstract List<TermTreeDto> getTrees();
+    // protected abstract List<TermTreeDto> getTrees();
 
     public void paste(IStructuredSelection selection) {
         ISelection clipBoardSelection = LocalSelectionTransfer.getTransfer().getSelection();
         Object firstElement = selection.getFirstElement();
         TermNodeDto parentNode = null;
-        if(firstElement instanceof TermNodeDto){
+        if (firstElement instanceof TermNodeDto) {
             parentNode = (TermNodeDto) firstElement;
+        } else if (firstElement instanceof TermTreeDto) {
+            parentNode = ((TermTreeDto) firstElement).getRoot();
         }
-        else if(firstElement instanceof TermTreeDto){
-            parentNode = ((TermTreeDto)firstElement).getRoot();
-        }
-        if(parentNode!=null){
-
-               TermNodeDto copiedNode = (TermNodeDto) ((IStructuredSelection)clipBoardSelection).getFirstElement();
-               boolean isDuplicate = this.checkDuplicates(copiedNode.getTerm().getUuid(), parentNode.getTree().getUuid());
-            if (isDuplicate && !parentNode.getTree().isAllowDuplicate()){
-                MessagingUtils.informationDialog(Messages.AddFeatureHandler_Duplicates_not_allowed, Messages.AddFeatureHandler_Duplicates_not_allowed_message +  "\n"+copiedNode.getTerm().getTitleCache());
+        if (parentNode != null) {
+
+            TermNodeDto copiedNode = (TermNodeDto) ((IStructuredSelection) clipBoardSelection).getFirstElement();
+            boolean isDuplicate = this.checkDuplicates(copiedNode.getTerm().getUuid(), parentNode.getTreeUuid());
+            if (isDuplicate && !parentNode.isAllowsDuplicats()) {
+                MessagingUtils.informationDialog(Messages.AddFeatureHandler_Duplicates_not_allowed,
+                        Messages.AddFeatureHandler_Duplicates_not_allowed_message + "\n"
+                                + copiedNode.getTerm().getTitleCache());
                 return;
             }
-               TermNodeDto newDto = new TermNodeDto(copiedNode.getTerm(), parentNode, 0, parentNode.getTree(), null, null, null);
-               this.refresh();
-               this.setDirty();
-            AddFeatureOperation operation = new AddFeatureOperation(copiedNode.getTerm().getUuid(), parentNode, this, this);
-//            AbstractUtility.executeOperation(operation, sync);
+            TermNodeDto newDto = new TermNodeDto(copiedNode.getTerm(), parentNode, 0, null, null, 0,
+                    null, null);
+            this.refresh();
+            this.setDirty();
+            AddFeatureOperation operation = new AddFeatureOperation(copiedNode.getTerm().getUuid(), parentNode, this,
+                    this);
+            // AbstractUtility.executeOperation(operation, sync);
             this.addOperation(operation);
         }
     }
@@ -218,21 +213,14 @@ public class TermTreeEditor<T extends DefinedTermBase>
         LocalSelectionTransfer.getTransfer().setSelection(selection);
     }
 
-    private void initSession(){
-        if(conversation == null){
-            conversation = CdmStore.createConversation();
-        }
-        if(cdmEntitySession==null){
+    private void initSession() {
+        if (cdmEntitySession == null) {
             cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
         }
     }
 
     private void clearSession() {
-        if(conversation!=null){
-            conversation.close();
-            conversation = null;
-        }
-        if(cdmEntitySession != null) {
+        if (cdmEntitySession != null) {
             cdmEntitySession.dispose();
             cdmEntitySession = null;
         }
@@ -240,72 +228,62 @@ public class TermTreeEditor<T extends DefinedTermBase>
     }
 
     @Override
-    public boolean isDirty(){
+    public boolean isDirty() {
         return dirty.isDirty();
     }
-       public void setDirty(boolean isDirty){
-           this.dirty.setDirty(isDirty);
-       }
-       @Override
-    public void setDirty(){
+
+    public void setDirty(boolean isDirty) {
+        this.dirty.setDirty(isDirty);
+    }
+
+    @Override
+    public void setDirty() {
         this.dirty.setDirty(true);
     }
 
-       @Override
-       public void selectionChanged(SelectionChangedEvent event) {
-               //propagate selection
-               selService.setSelection(event.getSelection());
-       }
+    @Override
+    public void selectionChanged(SelectionChangedEvent event) {
+        // propagate selection
+        selService.setSelection(event.getSelection());
+    }
 
-       @Focus
-       public void focus(){
-           if(viewer!=null){
-               viewer.getControl().setFocus();
-           }
-        if(conversation!=null && !conversation.isBound()){
-            conversation.bind();
+    @Focus
+    public void focus() {
+        if (viewer != null) {
+            viewer.getControl().setFocus();
         }
-        if(cdmEntitySession != null) {
+        if (cdmEntitySession != null) {
             cdmEntitySession.bind();
         }
-        if (viewer.getSelection().isEmpty()){
+        if (viewer.getSelection().isEmpty()) {
             viewer.setSelection(null);
         }
-       }
-
-       @Override
-    public void refresh(){
-           viewer.refresh();
-       }
+    }
 
-       @Override
-    public TreeViewer getViewer(){
-           return viewer;
-       }
+    @Override
+    public void refresh() {
+        viewer.refresh();
+    }
 
-       @Override
-       public IStructuredSelection getSelection() {
-           return (IStructuredSelection) viewer.getSelection();
-       }
+    @Override
+    public TreeViewer getViewer() {
+        return viewer;
+    }
 
-       @Override
-       public ConversationHolder getConversationHolder() {
-           return conversation;
-       }
+    @Override
+    public IStructuredSelection getSelection() {
+        return (IStructuredSelection) viewer.getSelection();
+    }
 
-       @Override
+    @Override
     @Persist
-       public void save(IProgressMonitor monitor){
-        if (!conversation.isBound()) {
-            conversation.bind();
-        }
+    public void save(IProgressMonitor monitor) {
 
-        // commit the conversation and start a new transaction immediately
         ISelection sel = this.viewer.getSelection();
-        conversation.commit(true);
-        if (createOperationList != null && !createOperationList.isEmpty()){
-            for (CreateFeatureTreeOperation operation: createOperationList.values()){
-                TermTreeDto termDto = getTreeDtoForUuid(operation.getElementUuid());
+
+        if (createOperationList != null && !createOperationList.isEmpty()) {
+            for (CreateFeatureTreeOperation operation : createOperationList.values()) {
+                TermCollectionDto termDto = getTreeDtoForUuid(operation.getElementUuid());
                 operation.getElement().setTitleCache(termDto.getTitleCache(), true);
                 operation.getElement().setAllowDuplicates(termDto.isAllowDuplicate());
                 operation.getElement().setFlat(termDto.isFlat());
@@ -315,8 +293,8 @@ public class TermTreeEditor<T extends DefinedTermBase>
             createOperationList.clear();
         }
 
-        if (operationList != null && !operationList.isEmpty()){
-            for (AbstractPostOperation<TermNode> operation: operationList){
+        if (operationList != null && !operationList.isEmpty()) {
+            for (AbstractPostOperation<TermNode> operation : operationList) {
                 AbstractUtility.executeOperation(operation, sync);
             }
             operationList.clear();
@@ -326,12 +304,12 @@ public class TermTreeEditor<T extends DefinedTermBase>
         listToUpdate.clear();
         List<TermTreeDto> rootEntities = getRootEntities();
         UpdateResult result = CdmStore.getService(ITermTreeService.class).saveOrUpdateTermTreeDtoList(rootEntities);
-        conversation.commit(true);
+
         this.setDirty(false);
         initializeTrees();
         this.viewer.setSelection(sel);
-//        this.viewer.setExpandedElements(expandedElements);
-       }
+        // this.viewer.setExpandedElements(expandedElements);
+    }
 
     private void initializeTrees() {
         Object[] expandedElements = viewer.getExpandedElements();
@@ -341,11 +319,11 @@ public class TermTreeEditor<T extends DefinedTermBase>
         viewer.setExpandedElements(expandedElements);
     }
 
-       @PreDestroy
-       public void dispose(){
-           selService.setSelection(null);
-           clearSession();
-       }
+    @PreDestroy
+    public void dispose() {
+        selService.setSelection(null);
+        clearSession();
+    }
 
     @Override
     public ICdmEntitySession getCdmEntitySession() {
@@ -354,13 +332,12 @@ public class TermTreeEditor<T extends DefinedTermBase>
 
     @Override
     public Map<Object, List<String>> getPropertyPathsMap() {
-        List<String> propertyPaths = Arrays.asList(new String[] {
-                "children", //$NON-NLS-1$
+        List<String> propertyPaths = Arrays.asList(new String[] { "children", //$NON-NLS-1$
                 "term", //$NON-NLS-1$
                 "termTree", //$NON-NLS-1$
         });
         Map<Object, List<String>> propertyPathMap = new HashMap<>();
-        propertyPathMap.put(TermNode.class,propertyPaths);
+        propertyPathMap.put(TermNode.class, propertyPaths);
         return propertyPathMap;
     }
 
@@ -375,12 +352,11 @@ public class TermTreeEditor<T extends DefinedTermBase>
 
     @Override
     public void contextStop(IMemento memento, IProgressMonitor monitor) {
-        //close view when workbench closes
-        try{
+        // close view when workbench closes
+        try {
             thisPart.getContext().get(EPartService.class).hidePart(thisPart);
-        }
-        catch(Exception e){
-            //nothing
+        } catch (Exception e) {
+            // nothing
         }
     }
 
@@ -396,10 +372,6 @@ public class TermTreeEditor<T extends DefinedTermBase>
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
-
     @Override
     public void changed(Object element) {
         dirty.setDirty(true);
@@ -415,11 +387,12 @@ public class TermTreeEditor<T extends DefinedTermBase>
     public boolean postOperation(Object objectAffectedByOperation) {
         initializeTrees();
         viewer.refresh();
-        if(objectAffectedByOperation instanceof TermNodeDto){
-               TermNodeDto node = (TermNodeDto)objectAffectedByOperation;
-//            viewer.expandToLevel(((TermRelationBase) node).getGraph(), 1); find a solution for dto editor
+        if (objectAffectedByOperation instanceof TermNodeDto) {
+            TermNodeDto node = (TermNodeDto) objectAffectedByOperation;
+            // viewer.expandToLevel(((TermRelationBase) node).getGraph(), 1);
+            // find a solution for dto editor
         }
-        if(objectAffectedByOperation!=null){
+        if (objectAffectedByOperation != null) {
             StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
             viewer.setSelection(selection);
         }
@@ -432,23 +405,23 @@ public class TermTreeEditor<T extends DefinedTermBase>
     }
 
     @Override
-    public TermNodeDto getNodeDtoForUuid(UUID nodeUuid){
+    public TermNodeDto getNodeDtoForUuid(UUID nodeUuid) {
         return uuidTermMap.get(nodeUuid);
     }
 
-    protected void addAllNodesToMap(TermNodeDto root){
-        if (!uuidTermMap.containsKey(root.getUuid())){
+    protected void addAllNodesToMap(TermNodeDto root) {
+        if (!uuidTermMap.containsKey(root.getUuid())) {
             uuidTermMap.put(root.getUuid(), root);
-//            if (root.getTerm() != null){
-//                getTreeDtoForUuid(root.getTree().getUuid()).addTerm(root.getTerm());
-//            }
+            // if (root.getTerm() != null){
+            // getTreeDtoForUuid(root.getTree().getUuid()).addTerm(root.getTerm());
+            // }
         }
-        for (TermNodeDto child: root.getChildren()){
+        for (TermNodeDto child : root.getChildren()) {
             uuidTermMap.put(child.getUuid(), child);
-//            if (child.getTerm() != null){
-//                getTreeDtoForUuid(child.getTree().getUuid()).addTerm(child.getTerm());
-//            }
-            if (child.getChildren() != null && !child.getChildren().isEmpty()){
+            // if (child.getTerm() != null){
+            // getTreeDtoForUuid(child.getTree().getUuid()).addTerm(child.getTerm());
+            // }
+            if (child.getChildren() != null && !child.getChildren().isEmpty()) {
                 addAllNodesToMap(child);
             }
         }
@@ -456,9 +429,9 @@ public class TermTreeEditor<T extends DefinedTermBase>
 
     @Override
     public boolean checkDuplicates(UUID termUuid, UUID treeUuid) {
-        TermTreeDto tree = this.getTreeDtoForUuid(treeUuid);
-        if (tree != null){
-            for (TermDto dto: tree.getTerms()){
+        TermCollectionDto tree = this.getTreeDtoForUuid(treeUuid);
+        if (tree != null) {
+            for (TermDto dto : tree.getTerms()) {
                 if (dto != null && dto.getUuid().equals(termUuid)) {
                     return true;
                 }
@@ -467,56 +440,58 @@ public class TermTreeEditor<T extends DefinedTermBase>
         return false;
     }
 
-    protected void updateTrees(){
+    protected void updateTrees() {
         uuidTermMap.clear();
-        if (trees != null && !trees.isEmpty()){
+        if (trees != null && !trees.isEmpty()) {
             trees.clear();
         }
-        if (trees == null){
+        if (trees == null) {
             trees = new HashMap<>();
         }
-        List<TermTreeDto> treeList = CdmStore.getService(ITermTreeService.class).listTermTreeDtosByTermType(getTermType());
+        List<TermTreeDto> treeList = CdmStore.getService(ITermTreeService.class)
+                .listTermTreeDtosByTermType(getTermType());
         treeList.stream().forEach(tree -> trees.put(tree.getUuid(), tree));
-//        trees.addAll(CdmStore.getService(ITermTreeService.class).listTermTreeDtosByTermType(getTermType()));
-        for (TermTreeDto tree: trees.values()){
-            addAllNodesToMap(tree.getRoot());
+        // trees.addAll(CdmStore.getService(ITermTreeService.class).listTermTreeDtosByTermType(getTermType()));
+        for (TermCollectionDto tree : trees.values()) {
+            addAllNodesToMap(((TermTreeDto) tree).getRoot());
         }
-        ((TermTreeContentProvider<T>)viewer.getContentProvider()).setUuidTermMap(uuidTermMap);
+        ((TermTreeContentProvider<T>) viewer.getContentProvider()).setUuidTermMap(uuidTermMap);
     }
 
-    public List<TermTreeDto> getTrees(){
-        List<TermTreeDto> treeList = new ArrayList<>(trees.values());
+    public List<TermCollectionDto> getTrees() {
+        List<TermCollectionDto> treeList = new ArrayList<>(trees.values());
         return treeList;
     }
 
-    public void putTree(TermTreeDto tree){
-       trees.put(tree.getUuid(), tree);
+    public void putTree(TermTreeDto tree) {
+        trees.put(tree.getUuid(), tree);
     }
 
-    public void removeTree(TermTreeDto tree){
+    public void removeTree(TermTreeDto tree) {
         trees.remove(tree.getUuid());
-     }
+    }
 
     @Override
-    public TermTreeDto getTreeDtoForUuid(UUID treeUuid){
+    public TermCollectionDto getTreeDtoForUuid(UUID treeUuid) {
         return trees.get(treeUuid);
     }
 
     @Override
-    public void setTreeDtoForUuid(TermTreeDto tree){
+    public void setTreeDtoForUuid(TermTreeDto tree) {
         trees.put(tree.getUuid(), tree);
     }
 
     @Override
-    public void setNodeDtoForUuid(TermNodeDto node){
+    public void setNodeDtoForUuid(TermNodeDto node) {
         this.uuidTermMap.put(node.getUuid(), node);
     }
 
     @Override
     public void addOperation(AbstractPostOperation operation) {
-        if (operation instanceof CreateFeatureTreeOperation){
-            createOperationList.put(((CreateFeatureTreeOperation)operation).getElementUuid(), (CreateFeatureTreeOperation)operation);
-        }else{
+        if (operation instanceof CreateFeatureTreeOperation) {
+            createOperationList.put(((CreateFeatureTreeOperation) operation).getElementUuid(),
+                    (CreateFeatureTreeOperation) operation);
+        } else {
             operationList.add(operation);
         }
     }
@@ -524,10 +499,87 @@ public class TermTreeEditor<T extends DefinedTermBase>
     @Inject
     @Optional
     private void addSaveCandidate(@UIEventTopic(WorkbenchEventConstants.ADD_SAVE_CANDIDATE) UUID cdmbaseUuid) {
-        for (UUID uuid: uuidTermMap.keySet()) {
-            if (uuid.equals(cdmbaseUuid)){
-               listToUpdate.add(uuidTermMap.get(uuid));
+        ISelection sel = viewer.getSelection();
+        Object obj = ((StructuredSelection) sel).getFirstElement();
+        if (obj instanceof TermNodeDto) {
+            if (listToUpdate.contains(obj)) {
+                listToUpdate.remove(obj);
+            }
+            listToUpdate.add((TermNodeDto) obj);
+        }
+    }
+
+    @Inject
+    @Optional
+    private void addSaveCandidate(@UIEventTopic(WorkbenchEventConstants.ADD_SAVE_CANDIDATE) AnnotationDto anDto) {
+
+        ISelection sel = viewer.getSelection();
+        Object obj = ((StructuredSelection) sel).getFirstElement();
+        if (obj instanceof TermNodeDto) {
+            if (listToUpdate.contains(obj)) {
+                listToUpdate.remove(obj);
+            }
+            if (((TermNodeDto) obj).getAnnotations().contains(anDto)) {
+                ((TermNodeDto) obj).getAnnotations().remove(anDto);
+            }
+
+            ((TermNodeDto) obj).addAnnotation(anDto);
+
+            listToUpdate.add((TermNodeDto) obj);
+        }
+    }
+
+    @Inject
+    @Optional
+    private void removeElement(@UIEventTopic(WorkbenchEventConstants.REMOVE_ELEMENT) AnnotationDto anDto) {
+
+        ISelection sel = viewer.getSelection();
+        Object obj = ((StructuredSelection) sel).getFirstElement();
+        if (obj instanceof TermNodeDto) {
+            if (listToUpdate.contains(obj)) {
+                listToUpdate.remove(obj);
             }
+            if (((TermNodeDto) obj).getAnnotations().contains(anDto)) {
+                ((TermNodeDto) obj).getAnnotations().remove(anDto);
+            }
+            listToUpdate.add((TermNodeDto) obj);
+        }
+    }
+
+    @Inject
+    @Optional
+    private void addSaveCandidate(@UIEventTopic(WorkbenchEventConstants.ADD_SAVE_CANDIDATE) MarkerDto markerDto) {
+
+        ISelection sel = viewer.getSelection();
+        Object obj = ((StructuredSelection) sel).getFirstElement();
+        if (obj instanceof TermNodeDto) {
+            if (listToUpdate.contains(obj)) {
+                listToUpdate.remove(obj);
+            }
+            if (((TermNodeDto) obj).getMarkers().contains(markerDto)) {
+                ((TermNodeDto) obj).getMarkers().remove(markerDto);
+            }
+            ((TermNodeDto) obj).addMarker(markerDto);
+
+            listToUpdate.add((TermNodeDto) obj);
+        }
+    }
+
+    @Inject
+    @Optional
+    private void removeMarker(@UIEventTopic(WorkbenchEventConstants.REMOVE_ELEMENT) MarkerDto markerDto) {
+
+        ISelection sel = viewer.getSelection();
+        Object obj = ((StructuredSelection) sel).getFirstElement();
+        if (obj instanceof TermNodeDto) {
+            if (listToUpdate.contains(obj)) {
+                listToUpdate.remove(obj);
+            }
+            if (((TermNodeDto) obj).getMarkers().contains(markerDto)) {
+                ((TermNodeDto) obj).getMarkers().remove(markerDto);
+            }
+
+            listToUpdate.add((TermNodeDto) obj);
         }
     }
 
index 01040e6446fc75e3cf59256c438f36c4b6cc3eb0..9d2331d8b87e8b6dc9f1dafdca350c2a4b318807 100755 (executable)
@@ -30,6 +30,7 @@ import eu.etaxonomy.cdm.persistence.dto.CharacterDto;
 import eu.etaxonomy.cdm.persistence.dto.CharacterNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.termtree.AvailableTermsWizard;
@@ -53,7 +54,7 @@ public abstract class AbstractAddTermHandler {
         TermNodeDto parent = getParent(selection);
         TermType type = null;
         if (parent.getTerm() == null){
-            type = parent.getTree().getTermType();
+            type = parent.getType();
         }else{
             type = parent.getTerm().getTermType();
         }
@@ -66,8 +67,8 @@ public abstract class AbstractAddTermHandler {
             for (DefinedTermBase term : additionalTerms) {
 
                 boolean isDuplicate = false;
-                if (!parent.getTree().isAllowDuplicate()){
-                    isDuplicate = editor.checkDuplicates(term.getUuid(), parent.getTree().getUuid());
+                if (!parent.isAllowsDuplicats()){
+                    isDuplicate = editor.checkDuplicates(term.getUuid(), parent.getTreeUuid());
                     if (isDuplicate){
                         duplicates.add(term);
                     }
@@ -81,9 +82,9 @@ public abstract class AbstractAddTermHandler {
                 editor.setDirty();
 
                 if (editor instanceof ICharacterEditor){
-                    CharacterNodeDto newDto = new CharacterNodeDto(CharacterDto.fromCharacter((Character)term), parent, 0, parent.getTree(), null, null, null);
+                    CharacterNodeDto newDto = new CharacterNodeDto(CharacterDto.fromCharacter((Character)term), parent, 0, (TermTreeDto) ((ICharacterEditor)editor).getTreeDtoForUuid(parent.getTreeUuid()), null, 0, null, null);
                 }else{
-                    TermNodeDto newDto = new TermNodeDto(TermDto.fromTerm(term), parent, 0, parent.getTree(), null, null, null);
+                    TermNodeDto newDto = new TermNodeDto(TermDto.fromTerm(term), parent, 0, (TermTreeDto)editor.getTreeDtoForUuid(parent.getTreeUuid()), null, 0, null, null);
                 }
 
 //                ((AbstractTermTreeEditor)editor).getViewer().refresh();
index 4d4bec1d65af77c2bc718e8c320cf70c940c9046..8c015a1b941f577fb8577fabb87c6fefb7188688 100644 (file)
@@ -36,7 +36,8 @@ public class AddChildTermHandler extends AbstractAddTermHandler{
                 && selection!=null
                 && selection.size()==1
                 && selection.getFirstElement() instanceof TermNodeDto
-                && !((TermNodeDto)selection.getFirstElement()).getTree().isFlat();
+                && !((TermNodeDto)selection.getFirstElement()).isFlat()
+                       && !((TermNodeDto)selection).isExternallyManaged();
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index ca211f8e936a7b938997de24ec763595afbb2e61..f710b4a7a8899f6da8b817ba78fd15060796f9c1 100644 (file)
@@ -99,10 +99,13 @@ public class AddTermHandler extends AbstractAddTermHandler{
             @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
             MHandledMenuItem menuItem) {
         boolean canExecute = false;
+        boolean isManaged = false;
+        
         canExecute = thisPart.getObject() instanceof ITermTreeEditor
                 && selection!=null
                 && selection.size()==1
-                && selection.getFirstElement() instanceof TermTreeDto;
+                && selection.getFirstElement() instanceof TermTreeDto
+                       && !((TermTreeDto)selection.getFirstElement()).isManaged();
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index a04a7a2713a9dbdcdf9fc3c88cef893b7fc73a1d..b83d9446070a46a73bbfc12f6b0b3f61a9e5f364 100644 (file)
@@ -30,7 +30,8 @@ public class CopyTermHandler {
         canExecute =part.getObject() instanceof TermTreeEditor
                 && selection!=null
                 && selection.size()==1
-                && selection.getFirstElement() instanceof TermNodeDto;
+                && selection.getFirstElement() instanceof TermNodeDto
+                && !((TermNodeDto)selection.getFirstElement()).isExternallyManaged();
         menuItem.setVisible(canExecute);
         return canExecute;
     }
index dca5e3ad8192351303bb51febc4f360f5f6f3c30..2916d7e98cae3eda29088626b530daed81a33bc8 100644 (file)
@@ -39,9 +39,14 @@ public class PasteTermHandler {
             term = ((TermNodeDto)((IStructuredSelection)transferSelection).getFirstElement()).getTerm();
         }
         TermNodeDto selectedNode = null;
+        TermTreeEditor editor = null;
+        if (part.getObject() instanceof TermTreeEditor) {
+            editor = (TermTreeEditor)part.getObject();
+        }
+        
         if (selection.getFirstElement() instanceof TermNodeDto){
             selectedNode = (TermNodeDto)selection.getFirstElement();
-            moveToTree = selectedNode.getTree();
+            moveToTree = (TermTreeDto) editor.getTreeDtoForUuid(selectedNode.getTreeUuid());
         }else if (selection.getFirstElement() instanceof TermTreeDto){
             moveToTree = (TermTreeDto)selection.getFirstElement();
         }
index 56c3ad9e8f606790d2fd0efdabe8ad838218a935..8205f61c832879d7c52f13e2afd2daae35d000aa 100644 (file)
@@ -50,7 +50,7 @@ public class RemoveTermHandler {
 
         for (Object selectedObject : selection.toArray()) {
                TermNodeDto featureNode = (TermNodeDto) selectedObject;
-               TermTreeDto tree = featureNode.getTree();
+               TermTreeDto tree = (TermTreeDto) editor.getTreeDtoForUuid(featureNode.getTreeUuid());
                if (featureNode.getUuid() != null){
                    RemoveFeatureOperation operation = new RemoveFeatureOperation(featureNode.getUuid(), editor, editor);
                    editor.addOperation(operation);
@@ -95,7 +95,8 @@ public class RemoveTermHandler {
         boolean canExecute = selection!=null && !selection.isEmpty();
         if(selection!=null){
             for(Object object:selection.toArray()){
-                canExecute &= object instanceof TermNodeDto;
+                canExecute &= object instanceof TermNodeDto && !((TermNodeDto)object).isExternallyManaged();
+             
             }
         }
         canExecute &= thisPart.getObject() instanceof ITermTreeEditor;
index 0feee21eea85642e6192935000d15d3864dde6cd..57c5d91c878c27919dce46a9c3c5d7cf74c4c097 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2017 EDIT
 * European Distributed Institute of Taxonomy
@@ -16,13 +15,9 @@ import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 /**
  * @author pplitzner
  * @date 12.12.2017
- *
  */
 public class UuidAndTitleCacheLabelProvider extends LabelProvider{
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public String getText(Object element) {
         if(element instanceof UuidAndTitleCache){
@@ -30,5 +25,4 @@ public class UuidAndTitleCacheLabelProvider extends LabelProvider{
         }
         return super.getText(element);
     }
-
-}
+}
\ No newline at end of file
index 5ff533fda0a199d8ec24b26f8b0655c7f3aff93e..12ec9be6cbc044e9b8fdfad02d1b92ab22d5a4dc 100644 (file)
@@ -148,7 +148,7 @@ public abstract class AbstractComboElement<T>
             @SuppressWarnings("unchecked")
             @Override
             public void proposalAccepted(IContentProposal proposal) {
-                setSelection((T)combo.getData(proposal.getContent()));
+                setSelection((T)combo.getData(proposal.getContent()));                
                 firePropertyChangeEvent(new CdmPropertyChangeEvent(getComboElement(), null));
             }
         });
index cc84141ef834ef0ec688010f7d6551209afd0fad..2bd9a89b47f31a41810475e40794f49207126f84 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
+import eu.etaxonomy.cdm.model.description.NoDescriptiveDataStatus;
 import eu.etaxonomy.cdm.model.media.ExternalLinkType;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
@@ -181,12 +182,27 @@ public class EnumComboElement<T extends IEnumTerm<T>>
                 return Arrays.asList(TaxonNodeStatus.values());
             }
 
-            @Override
-            public Class<TaxonNodeStatus> getClazz() {
-                return TaxonNodeStatus.class;
-            }
+        @Override
+        public Class<TaxonNodeStatus> getClazz() {
+            return TaxonNodeStatus.class;
+        }
+
+    }, new CdmEnumDataHolder<NoDescriptiveDataStatus>() {
 
+        @Override
+        public String getName() {
+            return "No Data Status";
         }
+        @Override
+        public Collection<NoDescriptiveDataStatus> getElements() {
+            return Arrays.asList(NoDescriptiveDataStatus.values());
+        }
+        @Override
+        public Class<NoDescriptiveDataStatus> getClazz() {
+            return NoDescriptiveDataStatus.class;
+        }
+    }
+
        };
 
        protected List<T> elementTypeList = new ArrayList<>();
@@ -230,6 +246,8 @@ public class EnumComboElement<T extends IEnumTerm<T>>
             return "Code Edition";
         }else if(enumType.equals(TaxonNodeStatus.class)) {
             return Messages.EnumCombo_Placement_status;
+        }else if (enumType.equals(NoDescriptiveDataStatus.class)) {
+            return "No Data";
         }
                return "No Label";
        }
@@ -273,7 +291,7 @@ public class EnumComboElement<T extends IEnumTerm<T>>
             for (NomenclaturalCodeEdition codeEdition: elements){
                     elementTypeList.add((T)codeEdition);
                     combo.add(codeEdition.getLabel(), index);
-                    combo.setData(codeEdition.getLabel(), (T)codeEdition);
+                    combo.setData(codeEdition.getLabel(), codeEdition);
                     index++;
             }
         }
index f2f656efcc75ffa4cf1f3b3e6ca518e67548c98d..46a826b10ee7dc63309f251529dfac027310e502 100755 (executable)
@@ -50,8 +50,11 @@ public class OriginalSourceTypeComparator implements Comparator<OriginalSourceTy
         if(o2==null){
             return 1;
         }
+        if(o1.equals(o2)) {
+            return 0;
+        }
         //both are either taxonomic or media
-        else if(o1.equals(OriginalSourceType.PrimaryTaxonomicSource)
+        if(o1.equals(OriginalSourceType.PrimaryTaxonomicSource)
                 && o2.equals(OriginalSourceType.PrimaryMediaSource)){
             if(entity != null && entity.getType().equals(OriginalSourceType.PrimaryMediaSource)){
                 return 1;
@@ -60,7 +63,7 @@ public class OriginalSourceTypeComparator implements Comparator<OriginalSourceTy
                 return -1;
             }
         }
-        else if(o2.equals(OriginalSourceType.PrimaryTaxonomicSource)
+        if(o2.equals(OriginalSourceType.PrimaryTaxonomicSource)
                 && o1.equals(OriginalSourceType.PrimaryMediaSource)){
             if(entity != null && entity.getType().equals(OriginalSourceType.PrimaryMediaSource)){
                 return -1;
@@ -70,32 +73,35 @@ public class OriginalSourceTypeComparator implements Comparator<OriginalSourceTy
             }
         }
         //one is not taxonomic or media
-        else if(o1.equals(OriginalSourceType.PrimaryTaxonomicSource)
+        if(o1.equals(OriginalSourceType.PrimaryTaxonomicSource)
                 ||o1.equals(OriginalSourceType.PrimaryMediaSource)){
             return -1;
 
         }
-        else if(o2.equals(OriginalSourceType.PrimaryTaxonomicSource)
+        if(o2.equals(OriginalSourceType.PrimaryTaxonomicSource)
                 || o2.equals(OriginalSourceType.PrimaryMediaSource)){
             return 1;
         }
-        //The last two are always "Other" followed by "Unknown"
-        else if(o1.equals(OriginalSourceType.Other)){
-            if(o2.equals(OriginalSourceType.Unknown)){
-                return -11;
-            }
-            else{
+        //The last two are always "Unknown" followed by "Other"
+        if(o1.equals(OriginalSourceType.Unknown)){
+            if(o2.equals(OriginalSourceType.Other)){
                 return 1;
+            }else {
+                return -1;
             }
         }
-        if(o2.equals(OriginalSourceType.Other)){
+        //Other is always the later
+        if(o1.equals(OriginalSourceType.Other)){
             return 1;
         }
-        else{
-            String message1 = o1.getKey();
-            String message2 = o2.getKey();
-            return message1.compareTo(message2);
+        //o1 can not be Other or Unknown, so o1 must be before o2
+        if (o2.equals(OriginalSourceType.Unknown)) {
+            return -1;
         }
+        String message1 = o1.getLabel();
+        String message2 = o2.getLabel();
+        return message1.compareTo(message2);
+
     }
 
 }
\ No newline at end of file
similarity index 76%
rename from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/VocabularyComboElement.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermCollectionComboElement.java
index 1f803559865a9a39aecd8556c21bd84c302f0601..986f53b5689e0accda5221b1c7e61440ce90316b 100644 (file)
@@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.ui.combo;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.EnumSet;
 import java.util.List;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
@@ -18,11 +19,11 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Listener;
 
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -35,24 +36,30 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
  * @author n.hoffmann
  * @created Nov 5, 2009
  */
-public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>>
-               extends AbstractComboElement<VOC> {
+public class TermCollectionComboElement<TERM extends DefinedTermBase<TERM>, TC extends TermCollection<TERM,?>>
+               extends AbstractComboElement<TC> {
 
-       private VOC emptyElement;
+       private TC emptyElement;
        private static String EMPTY_ELEMENT_LABEL = "";
 
-       private ArrayList<VOC> terms;
+       private ArrayList<TC> terms;
 
-       private Comparator<VOC> vocComparator;
+       private Comparator<TC> vocComparator;
 
-    private final TermType termType;
+    private final EnumSet<TermType> termTypes;
 
-    public VocabularyComboElement(CdmFormFactory formFactory,
-               ICdmFormElement parentElement, TermType termType, String labelString,
-               VOC selection, int style) {
+    public TermCollectionComboElement(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, TermType termType, String labelString,
+            TC selection, int style){
+        this(formFactory, parentElement, EnumSet.of(termType), labelString, selection, style);
+    }
+
+    public TermCollectionComboElement(CdmFormFactory formFactory,
+               ICdmFormElement parentElement, EnumSet<TermType> termTypes, String labelString,
+               TC selection, int style) {
         super(formFactory, parentElement);
 
-        this.termType = termType;
+        this.termTypes = termTypes;
 
         populateTerms(getVocabularies());
 
@@ -67,12 +74,12 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
         }
        }
 
-       public VocabularyComboElement(CdmFormFactory formFactory,
-            ICdmFormElement parentElement, TermType termType, String labelString,
-            TermVocabularyDto selection, int style) {
+       public TermCollectionComboElement(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, EnumSet<TermType> termTypes, String label,
+            TermCollectionDto selection, int style) {
         super(formFactory, parentElement);
 
-        this.termType = termType;
+        this.termTypes = termTypes;
 
         populateTerms(getVocabularies());
 
@@ -96,7 +103,7 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
         *            a T object or <code>null</code> to clear the selection
         */
        @Override
-    public void setSelection(VOC selection) {
+    public void setSelection(TC selection) {
                this.selection = selection;
 
                Listener[] listeners = combo.getListeners(SWT.Selection);
@@ -122,7 +129,7 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
 //             }
        }
 
-    public void setSelectionDto(TermVocabularyDto selection) {
+    public void setSelectionDto(TermCollectionDto selection) {
         Listener[] listeners = combo.getListeners(SWT.Selection);
 
 //      for (Listener listener : listeners) {
@@ -133,7 +140,7 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
             // set selection to the emptyElement
             selectedIndex = 0;
         }else{
-            for (VOC voc: terms){
+            for (TC voc: terms){
 
                 if (voc != null && voc.getUuid().equals(selection.getUuid())){
                     selectedIndex = terms.indexOf(voc);
@@ -160,11 +167,11 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
         *
         * @param preferredTerms
         */
-       private void populateTerms(List<VOC> preferredTerms) {
+       private void populateTerms(List<TC> preferredTerms) {
 
                combo.removeAll();
 
-               terms = new ArrayList<VOC>();
+               terms = new ArrayList<>();
 
                int i = 1;
                int index = 0;
@@ -176,20 +183,18 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
                if (vocComparator != null) {
                        Collections.sort(preferredTerms, vocComparator);
                }else{
-                   Collections.sort(preferredTerms, new Comparator<VOC>() {
-
-                @Override
-                public int compare(VOC o1, VOC o2) {
-                    if (o1.equals(o2)){
+                   Collections.sort(preferredTerms, (o1,o2)->{
+                       if (o1.equals(o2)){
                         return 0;
                     }
-                    int result = ((TermVocabulary) o1).getTitleCache().toLowerCase().compareTo(((TermVocabulary)o2).getTitleCache().toLowerCase());
+                    int result = o1.getTitleCache().toLowerCase().compareTo(o2.getTitleCache().toLowerCase());
 
                     return result;
                 }
-            });
+            );
                }
-               for (VOC term : preferredTerms) {
+
+               for (TC term : preferredTerms) {
                        String label = getLabel(term);
                        if (label == null) {
                                if (term.getTitleCache() != null) {
@@ -225,20 +230,16 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
                combo.select(index);
        }
 
-       protected List<VOC> getVocabularies(){
-           List<TermVocabulary<TERM>> list = CdmStore.getService(IVocabularyService.class).<TERM>findByTermType(termType, null);
-               return (List<VOC>) list;
+       protected List<TC> getVocabularies(){
+           List<TermCollection> list = CdmStore.getService(ITermCollectionService.class).list(termTypes, null, null, null, null);
+               return (List<TC>) list;
        }
 
        /**
         * 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(VOC term) {
+       protected String getLabel(TC term) {
                if (term == null){
                        return "";
                }else{
@@ -246,8 +247,8 @@ public class VocabularyComboElement<TERM extends DefinedTermBase<TERM>, VOC exte
                }
        }
 
-       private void createTermNotInPreferredTerms(VOC term) {
-               List<VOC> preferredTerms = getVocabularies();
+       private void createTermNotInPreferredTerms(TC term) {
+               List<TC> preferredTerms = getVocabularies();
 
                preferredTerms.add(term);
 
index 58e9abf5e36777fb6f5ff26335f1b4f6dd9242f3..8ddd172cbb8a15bc47f6a8dd4f38f359feadc02b 100755 (executable)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2017 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.combo.term;
 
 import java.util.ArrayList;
@@ -33,8 +38,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 /**
  * @author n.hoffmann
  * @created Nov 5, 2009
- * @version 1.0
- * @param <T>
  */
 public class TermComboElement<T extends DefinedTermBase>
                extends AbstractComboElement<T> {
@@ -44,7 +47,7 @@ public class TermComboElement<T extends DefinedTermBase>
 
        private ArrayList<T> terms;
 
-       public ArrayList<T> getTerms() {
+       public List<T> getTerms() {
         return terms;
     }
 
@@ -57,11 +60,11 @@ public class TermComboElement<T extends DefinedTermBase>
        public void setTermComparator(Comparator<T> termComparator) {
                this.termComparator = termComparator;
                populateTerms();
-
        }
 
        private final TermType termType;
-       private final TermVocabulary termVocabulary;
+       @SuppressWarnings("rawtypes")
+    private final TermVocabulary termVocabulary;
        private final Class<T> termClass;
 
        private List<T> customPreferredTerms;
@@ -92,38 +95,42 @@ public class TermComboElement<T extends DefinedTermBase>
             int style) {
         this(formFactory, parentElement, termClass, null, null, null, labelString, selection, addEmptyElement, style, false, null);
     }
+
     public TermComboElement(CdmFormFactory formFactory,
             ICdmFormElement parentElement, Class<T> termClass, String labelString, T selection, boolean addEmptyElement,
             int style, boolean useAbbrevLabel) {
-        this(formFactory, parentElement, termClass, null, null, null,labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
-
+        this(formFactory, parentElement, termClass, null, null, null, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
     }
 
     public TermComboElement(CdmFormFactory formFactory,
             ICdmFormElement parentElement, List<T> terms, String labelString, T selection, boolean addEmptyElement,
             int style, boolean useAbbrevLabel, Comparator<T> comparator) {
         this(formFactory, parentElement, null, null, null, terms,labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
-
     }
 
        private TermComboElement(CdmFormFactory formFactory,
-               ICdmFormElement parentElement, Class<T> termClass, TermType termType, TermVocabulary<?> termVocabulary, List<T> terms,String labelString, T selection, boolean addEmptyElement,
+               ICdmFormElement parentElement, Class<T> termClass, TermType termType, TermVocabulary<?> termVocabulary, List<T> terms, String labelString, T selection, boolean addEmptyElement,
                int style, boolean useAbbrevLabel, Comparator<T> comparator) {
-        super(formFactory, parentElement);
+
+           super(formFactory, parentElement);
 
         this.termVocabulary = termVocabulary;
         this.termClass = termClass;
         this.addEmptyElement = addEmptyElement;
         this.useAbbrevLabel = useAbbrevLabel;
-        this.termComparator = comparator;
+
         if (labelString != null) {
             label.setText(labelString);
         }
         this.selection = selection;
-
+        if (comparator == null) {
+                this.termComparator = new DefaultTermComparator<>();
+        }else {
+                this.termComparator = comparator;
+        }
         if(termType!=null){
             //TODO try to remove generic T and avoid classes to be used
-               addTerms((List<T>) getTermManager().getPreferredTerms(termType));            
+               addTerms((List<T>) getTermManager().getPreferredTerms(termType));
         }
         else if(termVocabulary!=null){
             addTerms((List<T>) getTermManager().getPreferredTerms(termVocabulary));
@@ -142,12 +149,9 @@ public class TermComboElement<T extends DefinedTermBase>
         addContentProposalAdapter();
         combo.addSelectionListener(this);
         combo.addDisposeListener(this);
-        if (comparator == null){
-            setTermComparator(new DefaultTermComparator<T>());
-        }else{
-               populateTerms();
-        }
-        
+
+        populateTerms();
+
         PreferencesUtil.getPreferenceStore().addPropertyChangeListener(this);
 
         if (selection != null) {
@@ -156,7 +160,7 @@ public class TermComboElement<T extends DefinedTermBase>
        }
 
        protected void addTerms(List<T> preferredTerms) {
-               terms = new ArrayList<T>();
+               terms = new ArrayList<>();
                Collections.sort(preferredTerms, termComparator);
                if(addEmptyElement){
                    // Add an empty element for when nothing was selected yet
@@ -165,7 +169,7 @@ public class TermComboElement<T extends DefinedTermBase>
                }
                for (T term: preferredTerms){
                        terms.add(term);
-               }               
+               }
        }
 
        private TermComboElement(CdmFormFactory formFactory,
@@ -177,7 +181,11 @@ public class TermComboElement<T extends DefinedTermBase>
         this.termClass = termClass;
         this.addEmptyElement = addEmptyElement;
         this.useAbbrevLabel = useAbbrevLabel;
-        this.termComparator = comparator;
+        if (comparator == null) {
+               this.termComparator = new DefaultTermComparator<T>();
+        }else {
+               this.termComparator = comparator;
+        }
         if (labelString != null) {
             label.setText(labelString);
         }
@@ -193,7 +201,7 @@ public class TermComboElement<T extends DefinedTermBase>
             addTerms(getPreferredTerms());
         }else if (terms != null && !terms.isEmpty()){
             addTerms(terms);
-            
+
         }
         if (termType == null){
                this.termType = terms.get(0).getTermType();
@@ -204,11 +212,9 @@ public class TermComboElement<T extends DefinedTermBase>
         addContentProposalAdapter();
         combo.addSelectionListener(this);
         combo.addDisposeListener(this);
-        if (comparator == null){
-            setTermComparator(new DefaultTermComparator<T>());
-        }else{
-               populateTerms();
-        }
+
+        populateTerms();
+
         PreferencesUtil.getPreferenceStore().addPropertyChangeListener(this);
         if (this.terms != null && selection != null){
             for (T term: this.terms){
@@ -250,13 +256,13 @@ public class TermComboElement<T extends DefinedTermBase>
                                selectedIndex = terms.indexOf(selection);
                        }
                }
-               
+
 
                for (Listener listener : listeners) {
-                       combo.addListener(SWT.Selection, listener);                     
+                       combo.addListener(SWT.Selection, listener);
                }
                combo.select(selectedIndex);
-               
+
        }
 
        public void setSelectionDto(TermDto selection) {
@@ -292,7 +298,7 @@ public class TermComboElement<T extends DefinedTermBase>
                    combo.add(EMPTY_ELEMENT_LABEL);
                }
                List<T> withoutNull = new ArrayList<>(terms);
-               
+
                if (termComparator != null) {
                        if (addEmptyElement){
                                withoutNull = terms.subList(1, terms.size());
@@ -328,11 +334,10 @@ public class TermComboElement<T extends DefinedTermBase>
                }
 
                combo.select(index);
-
        }
 
        protected List<T> getPreferredTerms(){
-           List<T> preferredTerms = new ArrayList<T>();
+           List<T> preferredTerms = new ArrayList<>();
                if (customPreferredTerms != null){
                        return customPreferredTerms;
                }
@@ -367,14 +372,14 @@ public class TermComboElement<T extends DefinedTermBase>
                            }
                        }
                        if (termLabel == null){
-                               termLabel = term.getLabel(CdmStore.getDefaultLanguage());
+                               termLabel = term.getLabel(PreferencesUtil.getGlobalLanguage());
                        }
                        if (termLabel == null){
                            termLabel = term.getLabel();
                        }
                        if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS)
                            && term.getVocabulary()!=null){
-                           String vocLabel = term.getVocabulary().getLabel(CdmStore.getDefaultLanguage());
+                           String vocLabel = term.getVocabulary().getLabel(PreferencesUtil.getGlobalLanguage());
                            if (vocLabel == null){
                                vocLabel = term.getVocabulary().getLabel();
                            }
@@ -384,17 +389,11 @@ public class TermComboElement<T extends DefinedTermBase>
                }
        }
 
-       /**
-        *
-        *
-        * @param term
-        */
        private void createTermNotInPreferredTerms(T term, List<T> preferredTerms) {
                terms.add(term);
                populateTerms();
        }
 
-       /** {@inheritDoc} */
        @Override
     public void widgetSelected(SelectionEvent e) {
            if (e.getSource().equals(combo) && combo.getSelectionIndex() >= 0){
@@ -402,10 +401,8 @@ public class TermComboElement<T extends DefinedTermBase>
                selection = terms.get(combo.getSelectionIndex());
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
            }
-
        }
 
-       /** {@inheritDoc} */
        @Override
     public void propertyChange(PropertyChangeEvent event) {
                super.propertyChange(event);
@@ -452,5 +449,4 @@ public class TermComboElement<T extends DefinedTermBase>
                }
            }
        }
-
-}
+}
\ No newline at end of file
index 55ac72d4a0f260e53ef81e2dd88426e956ed3b69..6cb99b15587da14a6690389c81a76141a0cc2105 100644 (file)
@@ -39,7 +39,7 @@ AbstractCdmDetailElement<Classification>{
     protected void createControls(ICdmFormElement formElement, Classification entity, int style) {
          txtClassificationName = formFactory.createTextWithLabelElement(formElement, "Classification name", null, style);
          comboRelationType = formFactory.createDefinedTermComboElement(TermType.TaxonRelationshipType, formElement, "Taxon relation", null, style);
-         selectReference = formFactory.createSelectionElement(Reference.class, //getConversationHolder(),
+         selectReference = formFactory.createSelectionElement(Reference.class,
                  formElement, "Reference", null, EntitySelectionElement.SELECTABLE, style);
     }
 
@@ -59,4 +59,10 @@ AbstractCdmDetailElement<Classification>{
         return selectReference.getSelection();
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index fd2edd9dbc405e2aec858fb3ffe7e16cc6a6b5cd..e910c28439c524b010f70589bc5ad6ea91379e76 100644 (file)
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  * @author n.hoffmann
  * @created 16.06.2009
- * @version 1.0
+
  */
 public class LoginDialog extends Dialog {
 
@@ -43,8 +43,6 @@ public class LoginDialog extends Dialog {
                title = Messages.LoginDialog_LOGIN;
        }
 
-
-       /** {@inheritDoc} */
        @Override
        protected Control createDialogArea(Composite parent) {
                Composite composite = (Composite) super.createDialogArea(parent);
index 263af1c95e354255442ac4051a6b7664aec5c735..b007bee2f78aad21ce9b76e9b035c67aae4c3622 100644 (file)
@@ -17,7 +17,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -149,9 +150,12 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
     protected Shell shlConnect;
     protected Text txtCdmServerStatus;
     protected Text txtCdmInstanceStatus;
+
     protected Combo comboCdmServer;
+    protected boolean allowServerChange = true;
     protected Combo comboCdmInstance;
-    protected Button btnConnect;
+    protected boolean allowInstanceChange = true;
+    public Button btnConnect;
 
     protected Composite remotingComposite;
     protected Button btnCdmServerRefresh;
@@ -203,8 +207,6 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
 
     /**
      * Create the dialog.
-     * @param parent
-     * @param style
      */
     public RemotingLoginDialog(Shell parent, int style) {
         super(parent, style);
@@ -220,6 +222,11 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
             String contextPath = source.getContext();
             this.setInstanceName(contextPath == null? "" : contextPath.substring(contextPath.lastIndexOf("/") + 1)); //$NON-NLS-1$
         }
+        //disable datasource selection if datasource is given, see #10463
+
+        allowServerChange = false;
+        allowInstanceChange = false;
+
         return open(getServerName(), getInstanceName(), loadLoginPrefs, autoConnect);
     }
 
@@ -466,17 +473,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         txtServerCdmlibVersion = new Text(compAdvanced, SWT.BORDER);
         txtServerCdmlibVersion.setEditable(false);
         txtServerCdmlibVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
-/*
-        btnStopServer = new Button(compAdvanced, SWT.FLAT);
-        btnStopServer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
-        btnStopServer.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseUp(MouseEvent e) {
-                onStopManagedServer();
-            }
-        });
-        btnStopServer.setText(Messages.RemotingLoginDialog_LABEL_STOP_MANAGED_SERVER);
-*/
+
         lblEditorCdmlibVersion = new Label(compAdvanced, SWT.CENTER);
         lblEditorCdmlibVersion.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
         lblEditorCdmlibVersion.setText(Messages.RemotingLoginDialog_LABEL_EDITOR_CDMLIB_VERSION);
@@ -513,22 +510,18 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
 
     }
 
-    @SuppressWarnings("unused")
-    private void addEmptyCells(int cnt) {
+    protected void addEmptyCells(int cnt) {
         for (int i = 0; i < cnt; i++) {
             new Label(compAdvanced, SWT.NONE);
         }
     }
 
        protected void onConnectButtonPressed() {
-               /*if(selectedServerInfo.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
-                       startManagedServer();
-               } else {*/
-                       connect();
-                       if (CdmStore.isActive() && CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_REMOTING)){
-                           PreferencesUtil.setNomenclaturalCodePreferences();
-                       }
-//             }
+               connect();
+               if (CdmStore.isActive() && CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_REMOTING)){
+                   PreferencesUtil.setNomenclaturalCodePreferences();
+               }
+
        }
 
     protected void populateCdmServerCombo() {
@@ -583,7 +576,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         getServerInfoMap().put(csii.getName(), csii);
     }
     public void onRefreshCdmServer() {
-        try{
+       try{
             txtCdmServerStatus.setText(STATUS_CHECKING_AVAILABILITY);
             clearOnServerChange();
             emptyCredentials();
@@ -685,6 +678,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         txtCdmInstanceStatus.setText(STATUS_RETRIEVING);
         txtCdmInstanceStatus.setToolTipText(""); //$NON-NLS-1$
 
+
         serverJob = new Job(Messages.RemotingLoginDialog_RETRIEVE_SERVER_INSTANCES) {
             @Override
             protected IStatus run(IProgressMonitor monitor) {
@@ -710,7 +704,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
                                     comboCdmInstance.select(instanceIndex);
                                 }
                                 onRefreshCdmInstance();
-                                comboCdmInstance.setEnabled(true);
+                                comboCdmInstance.setEnabled(allowInstanceChange);
                                 if(isAutoConnect()) {
                                     connect();
                                 }
@@ -763,122 +757,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
             }
         }
     }
-/*
-    private void updateManagedServerControls() {
-        if(selectedServerInfo.isLocalhostMgd()) {
-            if(isSelectedCdmInstanceRunningInManagedServer()) {
-                txtCdmInstanceStatus.setText(STATUS_STARTED);
-            } else {
-                txtCdmInstanceStatus.setText(STATUS_NOT_STARTED);
-            }
-            btnConnect.setEnabled(true);
-            selectedServerInfo.setPort(getManagedServerPort());
-            updatePort();
-        }
-
-        if(isManagedServerRunning()) {
-            btnStopServer.setEnabled(true);
-        } else {
-            btnStopServer.setEnabled(false);
-        }
-    }
-
-    private boolean isManagedServerRunning() {
-        return CdmStore.getManagedServer() != null && CdmStore.getManagedServer().isAlive();
-    }
-
-    private boolean isSelectedCdmInstanceRunningInManagedServer() {
-        return CdmStore.getManagedServer() != null &&
-                CdmStore.getManagedServer().isAlive() &&
-                selectedServerInfo.isLocalhostMgd() &&
-                CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName());
-    }
-
-    private void startManagedServer() {
-        /*if(isManagedServerRunning()) {
-            if(CdmStore.getManagedServer().getDataSourceName().equals(selectedCdmInstance.getName())) {
-                return;
-            } else {
-                Display.getDefault().syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        onStopManagedServer();
-                    }
-                });
-            }
-        }
-        boolean forceSchemaCreate = !schemaExists(selectedCdmInstance);
-        boolean forceSchemaUpdate = LABEL_UPDATE_SCHEMA_VERSION.equals(btnConnect.getText());
-
-        Job job = new Job(Messages.RemotingLoginDialog_JOB_SERVER_LAUNCH) {
 
-            @Override
-            public IStatus run(IProgressMonitor monitor) {
-                String mgdServerConfigFileName = "mgd.datasources.xml"; //$NON-NLS-1$
-                String config = CdmServerUtils.convertEditorToServerConfig();
-                int maxUnits = 50;
-                monitor.beginTask(Messages.RemotingLoginDialog_TASK_LAUNCHING_SERVER, maxUnits);
-                try {
-                    monitor.subTask(String.format(Messages.RemotingLoginDialog_GENERATING_CONFIG_FILE, selectedCdmInstance.getName()));
-                    File managedServerConfigFile = CdmServerUtils.writeManagedServerConfig(config, mgdServerConfigFileName);
-                    monitor.worked(1);
-                    CdmServer cdmServer = new CdmServer(selectedCdmInstance.getName(), managedServerConfigFile);
-                    cdmServer.setForceSchemaCreate(forceSchemaCreate);
-                    cdmServer.setForceSchemaUpdate(forceSchemaUpdate);
-                    CdmStore.setManagedServer(cdmServer);
-                    monitor.subTask(Messages.RemotingLoginDialog_STARTING_MGD_SERVER);
-                    cdmServer.start(false, RemotingLoginDialog.this);
-                    int serverUnits = 0;
-
-                    // the following loop is a 'fake' progress monitoring where the progress
-                    // bar is advanced by one unit every second until maxUnits -2
-                    while(!CdmStore.getManagedServer().isStarted() && !CdmStore.getManagedServer().isFailed()) {
-                        if(serverUnits < maxUnits - 2) {
-                            try {
-                                Thread.sleep(1000);
-                            } catch (InterruptedException e) {
-                            }
-                            monitor.worked(1);
-                            serverUnits++;
-                        }
-                    }
-                    Display.getDefault().syncExec(()->{
-                                hide(false);
-                                updateManagedServerControls();
-                                connect();
-                    });
-                } catch (IOException ioe) {
-                    MessagingUtils.errorDialog(Messages.RemotingLoginDialog_ERROR_GENERATING_CONFIG_FILE,
-                            this,
-                            ioe.getMessage(),
-                            TaxeditorStorePlugin.PLUGIN_ID,
-                            ioe,
-                            true);
-                } catch (CdmEmbeddedServerException cese) {
-                    MessagingUtils.errorDialog(Messages.RemotingLoginDialog_ERROR_STARTING_SERVER,
-                            this,
-                            cese.getMessage(),
-                            TaxeditorStorePlugin.PLUGIN_ID,
-                            cese,
-                            true);
-                } finally {
-                    monitor.done();
-                }
-                // NOTE: Errors thrown during server startup are passed to the handleError() implementation
-                // TODO: is the above catch clause for CdmEmbeddedServerException still valuable?
-
-                return Status.OK_STATUS;
-            }
-       };
-
-        // configure the job
-        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
-        job.setUser(true);
-        // schedule job
-        hide(true);
-        job.schedule();
-    }
-    */
     private boolean schemaExists(CdmInstanceInfo instanceInfo) {
         if (instanceInfo.getDataSource() != null){
             try {
@@ -903,44 +782,7 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
     private int compareSchemaVersion(CdmInstanceInfo instanceInfo) throws CdmSourceException {
         return CdmMetaData.compareVersion(managedSchemaVersion(instanceInfo), CdmMetaData.getDbSchemaVersion(), 3, null);
     }
-/*
-    @Override
-    public void handleError(final Throwable t) {
-
-        Display.getDefault().syncExec(()-> {
-            serverJob.cancel();
 
-            String title = Messages.RemotingLoginDialog_SERVER_LAUNCH_ERROR;
-            String  message = t.getMessage();
-
-            MessagingUtils.errorDialog(title,
-                    this,
-                    message,
-                    TaxeditorStorePlugin.PLUGIN_ID,
-                    t,
-                    true);
-        });
-    }
-
-    private void onStopManagedServer() {
-        try {
-            CdmStore.getManagedServer().stop();
-        } catch (Exception e) {
-            MessagingUtils.errorDialog(Messages.RemotingLoginDialog_ERROR_STOPPING_SERVER,
-                    this,
-                    String.format(Messages.RemotingLoginDialog_COULD_NOT_STOP_SERVER, CdmStore.getManagedServer().getPort()),
-                    TaxeditorStorePlugin.PLUGIN_ID,
-                    e,
-                    true);
-        }
-        CdmStore.setManagedServer(null);
-        updateManagedServerControls();
-    }
-
-    private int getManagedServerPort() {
-        return CdmStore.getManagedServer() == null ? CdmServerInfo.NULL_PORT : CdmStore.getManagedServer().getPort();
-    }
-*/
     protected void checkSelectedCdmInstance() {
         try {
             if (selectedCdmInstance != null && selectedCdmInstance.getDataSource() != null){
@@ -1003,63 +845,6 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         }
     }
 
-//    private void checkManagedSelectedInstance() {
-//        boolean available = false;
-//        String instanceStatus = STATUS_NOT_AVAILABLE;
-//        String message = null;
-//        String connect = LABEL_CONNECT;
-//        Integer color = null;
-//        String schemaVersion = CdmMetaData.getDbSchemaVersion();
-//
-//        if (!schemaExists(selectedCdmInstance)){
-//            message = MESG_SCHEMA_MISSING;
-//            connect = LABEL_CREATE_SCHEMA;
-//            color = BTN_COLOR_ATTENTION;
-//            schemaVersion = MESG_NO_SCHEMA;
-//        } else {
-//            int compare;
-//            try {
-//                schemaVersion = managedSchemaVersion(selectedCdmInstance);
-//                compare = compareSchemaVersion(selectedCdmInstance);
-//                if (compare > 0){
-//                    instanceStatus = STATUS_NOT_COMPATIBLE;
-//                    message = MESG_COMPATIBLE_EDITOR_OLD;
-//                    available = false;
-//                }else if (compare < 0){
-//                    instanceStatus = STATUS_NOT_COMPATIBLE;
-//                    message = MESG_UPDATE_SCHEMA_VERSION;
-//                    available = true;
-//                    connect = LABEL_UPDATE_SCHEMA_VERSION;
-//                    color = BTN_COLOR_ATTENTION;
-//                }else{
-//                    available = true;
-//                    instanceStatus = STATUS_AVAILABLE;
-//                }
-//            } catch (CdmSourceException e) {
-//                available = false;
-//            }
-//        }
-//
-//        setManagedValues(available, instanceStatus, connect, color, schemaVersion);
-//        setMessage(message);
-//    }
-//
-//    private void setManagedValues(boolean available, String instanceStatus, String connect, Integer color,
-//            String schemaVersion) {
-//        Display.getDefault().syncExec(()->{
-//            btnConnect.setEnabled(available);
-//            btnConnect.setText(connect);
-//            Color systemColor = null;
-//            if(color != null) {
-//                systemColor = Display.getCurrent().getSystemColor(color);
-//            }
-//            btnConnect.setBackground(systemColor);
-//            btnConnect.requestLayout();
-//            txtCdmInstanceStatus.setText(instanceStatus);
-//            txtServerSchemaVersion.setText(schemaVersion);
-//            lblDefaultLogin.setVisible(true);
-//         });
-//    }
 
     public void connect() {
         checkSelectedCdmInstance();
@@ -1224,13 +1009,6 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         }
     }
 
-//    private int getHeightWithoutMessage() {
-//        if(xpndblcmpstAdvanced.isExpanded()) {
-//            return MIN_EXP_HEIGHT;
-//        } else {
-//            return MIN_HEIGHT;
-//        }
-//    }
 
     public void hide(boolean isHidden) {
         if (!shlConnect.isDisposed()){
@@ -1313,16 +1091,15 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
     private void updateControls(){
 
         //server
-//      comboCdmServer; //nothing to change
         String strServerStatus = this.selectedServerInfo != null? STATUS_NOT_AVAILABLE : STATUS_AVAILABLE;
         txtCdmServerStatus.setText(strServerStatus);
-//      btnCdmServerRefresh;  //nothing to change
+
 
         //database
 //        comboCdmInstance
         String strInstanceStatus = this.selectedCdmInstance != null? STATUS_NOT_AVAILABLE : STATUS_AVAILABLE;
         txtCdmInstanceStatus.setText(strInstanceStatus);
-//        btnCdmInstanceRefresh;  //nothing to change
+
 
         //login + connect
         txtLogin.setText(Nz(login));
@@ -1330,21 +1107,6 @@ public class RemotingLoginDialog extends Dialog implements ICdmServerError {
         btnConnect.setText(LABEL_CONNECT);  //TODO
         btnConnect.setEnabled(true);
 
-        //rememberMe + defaultValues
-//        btnRememberMe;
-//        lblDefaultLogin;
-
-        //message
-//        styledTxtMessage;
-
-        //Advanced
-//        txtPort
-//        btnStopServer;
-
-//        txtServerCdmlibVersion;
-//        txtEditorCdmlibVersion;
-//        txtServerSchemaVersion;
-//        txtEditorCdmVersion;
     }
 
     private String Nz(String value) {
index bd5385bdefefd118d9b678ea12d6c2c859f7f82b..dbacdc9f55d261294c7d41b2b5274db43323cb77 100755 (executable)
@@ -29,36 +29,36 @@ import eu.etaxonomy.taxeditor.ui.dialog.configurator.wizard.SuperAreaPage;
  */
 public class SuperAreaSelectionWizard extends Wizard {
 
-        private final SuperAreaPage aPage;
-        DistributionAggregationConfiguration configurator;
+    private final SuperAreaPage aPage;
+    DistributionAggregationConfiguration configurator;
 
-        public SuperAreaSelectionWizard(DistributionAggregationConfiguration configurator, NamedAreaLevel level) {
-            setWindowTitle(Messages.AvailableDistributionWizard_WINDOW_TITLE);
-            // TODO if preferenceStore has elements checked load elements in wizard
-            aPage = new SuperAreaPage(Messages.AvailableDistributionWizard_PAGE_TITLE, level);
-            this.configurator = configurator;
-        }
+    public SuperAreaSelectionWizard(DistributionAggregationConfiguration configurator, NamedAreaLevel level) {
+        setWindowTitle(Messages.AvailableDistributionWizard_WINDOW_TITLE);
+        // TODO if preferenceStore has elements checked load elements in wizard
+        aPage = new SuperAreaPage(Messages.AvailableDistributionWizard_PAGE_TITLE, level);
+        this.configurator = configurator;
+    }
 
-        @Override
-        public boolean performFinish() {
-            // TODO: get Selection and save in EditorPreferences
-            if (!checkNoneChecked()) {
-                Object[] checkedElements = aPage.getViewer().getCheckedElements();
-                Object[] grayedElements = aPage.getViewer().getGrayedElements();
-                List<Object> checkedList = new ArrayList<>(Arrays.asList(checkedElements));
-                List<Object> grayedList = new ArrayList<>(Arrays.asList(grayedElements));
-                checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
-                ArrayList<UUID> listUIIDChecked = new ArrayList<>();
-                ArrayList<UUID> listUIIDGrayed = new ArrayList<>();
-                for (Object o : checkedList) {
-                    if (o instanceof TermDto) {
-                        listUIIDChecked.add(((TermDto) o).getUuid());
+    @Override
+    public boolean performFinish() {
+        // TODO: get Selection and save in EditorPreferences
+        if (!checkNoneChecked()) {
+            Object[] checkedElements = aPage.getViewer().getCheckedElements();
+            Object[] grayedElements = aPage.getViewer().getGrayedElements();
+            List<Object> checkedList = new ArrayList<>(Arrays.asList(checkedElements));
+            List<Object> grayedList = new ArrayList<>(Arrays.asList(grayedElements));
+            checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
+            ArrayList<UUID> listUIIDChecked = new ArrayList<>();
+            ArrayList<UUID> listUIIDGrayed = new ArrayList<>();
+            for (Object o : checkedList) {
+                if (o instanceof TermDto) {
+                    listUIIDChecked.add(((TermDto) o).getUuid());
 
-                    }else if(o instanceof TermVocabularyDto){
-                        TermVocabularyDto termVocDto = (TermVocabularyDto) o;
-                        listUIIDGrayed.add(termVocDto.getUuid());
-                    }
+                }else if(o instanceof TermVocabularyDto){
+                    TermVocabularyDto termVocDto = (TermVocabularyDto) o;
+                    listUIIDGrayed.add(termVocDto.getUuid());
                 }
+            }
 //                for (Object o : grayedList) {
 //                    if (o instanceof TermDto) {
 //                        listUIIDChecked.add(((TermDto) o).getUuid());
@@ -69,41 +69,28 @@ public class SuperAreaSelectionWizard extends Wizard {
 //                    }
 //                }
 
-               configurator.setSuperAreas(listUIIDChecked);
+           configurator.setSuperAreas(listUIIDChecked);
 
 
-                return true;
-            } else {
-                return false;
-            }
+            return true;
+        } else {
+            return false;
         }
+    }
 
-        @Override
-        public void addPages() {
-            addPage(aPage);
-        }
+    @Override
+    public void addPages() {
+        addPage(aPage);
+    }
 
-        private boolean checkNoneChecked() {
+    private boolean checkNoneChecked() {
 
-            if (aPage.getViewer().getCheckedElements().length == 0) {
-                aPage.setMessage(Messages.AvailableDistributionWizard_CHECK_MESSAGE, aPage.WARNING);
-                return true;
-            } else {
-                aPage.setMessage(null);
-                return false;
-            }
+        if (aPage.getViewer().getCheckedElements().length == 0) {
+            aPage.setMessage(Messages.AvailableDistributionWizard_CHECK_MESSAGE, aPage.WARNING);
+            return true;
+        } else {
+            aPage.setMessage(null);
+            return false;
         }
-    //
-//        @Override
-//        public ConversationHolder getConversationHolder() {
-//            if (conversation == null) {
-//                conversation = CdmStore.createConversation();
-//            }
-//            return conversation;
-//        }
-    //
-//        @Override
-//        public void update(CdmDataChangeMap changeEvents) {
-//        }
     }
-
+}
\ No newline at end of file
index 4f6e0c589e90ad9257b237211afa87b7ffa25734..dc0df4e34075118bbf519dcd4a68f607fea457c0 100755 (executable)
@@ -158,7 +158,7 @@ public class SetSecundumConfiguratorWizardPage extends WizardPage implements Lis
 //        new Label(compositeRef, SWT.NONE);
 //        new Label(compositeRef, SWT.NONE);
 
-       // selectReference = toolkit.createSelectionElement(Rights.class, getConversationHolder(), composite, "Rights", null, EntitySelectionElement.SELECTABLE);
+       // selectReference = toolkit.createSelectionElement(Rights.class, composite, "Rights", null, EntitySelectionElement.SELECTABLE);
         final Composite control = new Composite(composite, SWT.WRAP);
         GridLayout gridLayoutControl = new GridLayout();
 
index 0a80946d2b579e6fa70ad4f2c4f1a25875a8afc8..8b7ce879dedea7167e2b0ef67129ef924a2515c3 100755 (executable)
@@ -12,8 +12,8 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermDtoContentProvider;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -24,9 +24,9 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NamedAreaTermDtoContentProvider extends TermDtoContentProvider {
 
     @Override
-    public Collection<? extends TermDto> getChildTerms(TermVocabularyDto voc) {
+    public Collection<? extends TermDto> getChildTerms(TermCollectionDto voc) {
         Collection<TermDto> children = getVocabularyToChildTermMap().get(voc);
-        if(children==null){
+        if (children == null) {
             children = new ArrayList<>(CdmStore.getService(IVocabularyService.class).getCompleteTermHierarchy(voc));
             getVocabularyToChildTermMap().put(voc, children);
         }
index e99f3b8a48773ed305ca773d9971057dead134f1..ebc6984b5bba9fc88b5a9e0b7a3898e033c143a5 100644 (file)
@@ -35,8 +35,6 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.term.IEnumTerm;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -50,9 +48,7 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 * @created 18.07.2013
 */
 public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm> extends
-               FilteredItemsSelectionDialog implements IConversationEnabled {
-
-       private ConversationHolder conversation;
+               FilteredItemsSelectionDialog {
 
        protected List<T> model;
        private String settings;
@@ -69,7 +65,6 @@ public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm
         * @param <T> a T object.
         */
        protected AbstractFilteredCdmEnumSelectionDialog(Shell shell,
-                       ConversationHolder conversation,
                        String title,
                        boolean multi,
                        String settings,
@@ -78,9 +73,6 @@ public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm
                setTitle(title);
                setMessage("Use * for wildcard, or ? to see all entries");
                this.settings = settings;
-
-               this.conversation = conversation;
-
                init();
 
                initModel();
@@ -391,23 +383,11 @@ public abstract class AbstractFilteredCdmEnumSelectionDialog<T extends IEnumTerm
                                        T entity = (T) wizard.getEntity();
 
                                        refresh();
-                                       setPattern(entity);
-                                       getConversationHolder().bind();
+                                       setPattern(entity);                                     
                                }
                        }
                };
        }
 
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
-    public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {}
+       
 }
\ No newline at end of file
index e11c01e7be3c2abbce8d9893f23a61d878adc046..2bbbb4dd8611c0459c2bfd83ef217aae869decb0 100644 (file)
@@ -42,12 +42,12 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.persistence.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -56,8 +56,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
- * Abstract AbstractFilteredCdmResourceSelectionDialog class.
- *
  * @author n.hoffmann
  * @created 04.06.2009
  */
@@ -442,15 +440,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog<T extends ICdmB
                                        T entity = (T) wizard.getEntity();
                                        refresh();
                                        setPattern(entity);
-
-//                                     if (getConversationHolder() != null){
-//                                         getConversationHolder().bind();
-//                                     }
                                    }
-                                   //FIXME : Need to make sure this is a stable fix (ticket 3822)
-//                                 if (getConversationHolder() != null){
-//                                     getConversationHolder().commit();
-//                                 }
                                }
                            }
                        }
index b6a62ea06b61dfeaba3294b620bb8d9494328b34..6a6e14719942b0ea0d1d1074ebf16777d81149cf 100644 (file)
@@ -7,7 +7,7 @@ import eu.etaxonomy.cdm.api.service.IIdentifiableEntityService;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.IdentifierType;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -15,7 +15,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public abstract class AbstractFilteredIdentifierSelectionDialog<T extends ICdmBase>
         extends AbstractFilteredCdmResourceSelectionDialog<T> {
 
-    private DefinedTerm identifierType;
+    private IdentifierType identifierType;
     private MatchMode matchMode;
     private Class<T> type;
 
index 4dfde1622fe529e612bb9228079702bf1e46ba3c..1d20e6bcc82ec736ab60b65e0119fc15741e1bf6 100644 (file)
@@ -17,12 +17,12 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
-import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.persistence.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.persistence.dto.TeamOrPersonUuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
@@ -49,7 +49,6 @@ public class AgentSelectionDialog<T extends AgentBase>
         * select
         *
         * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
         * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
         */
@@ -66,7 +65,6 @@ public class AgentSelectionDialog<T extends AgentBase>
         * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
         * @param title a {@link java.lang.String} object.
         * @param agent a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param multi a boolean.
         * @param settings a {@link java.lang.String} object.
         */
index 1f37bb224879467298f792acd62de8ad8864ac7f..69c372667d0b81ee0a4d458a147dae8b5d9e35f7 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class AmplificationSelectionDialog extends
 AbstractFilteredCdmResourceSelectionDialog<Amplification> {
 
-    public static Amplification select(Shell shell, //ConversationHolder conversation,
+    public static Amplification select(Shell shell,
             Amplification amplification){
         AmplificationSelectionDialog dialog = new AmplificationSelectionDialog(shell, //conversation,
                 "Choose Amplification", false, AmplificationSelectionDialog.class.getCanonicalName(), amplification);
@@ -38,7 +38,7 @@ AbstractFilteredCdmResourceSelectionDialog<Amplification> {
     /**
      * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
      */
-    protected AmplificationSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected AmplificationSelectionDialog(Shell shell,
             String title,
             boolean multi, String settings, Amplification cdmObject) {
         super(shell, //conversation,
index 1efec831407ff23b8f7b09c5b28267961df6766b..f5b4b78ea429017147c910f58ab2de6f25aa11af 100644 (file)
@@ -29,71 +29,34 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class ClassificationSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<Classification> {
 
-       /**
-        * <p>
-        * select
-        * </p>
-        *
-        * @param shell
-        *            a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param curentSelection
-        * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
-        */
-       public static Classification select(Shell shell,//ConversationHolder conversation,
+       public static Classification select(Shell shell,
                Classification curentSelection) {
-               ClassificationSelectionDialog dialog = new ClassificationSelectionDialog(shell, //conversation,
+               ClassificationSelectionDialog dialog = new ClassificationSelectionDialog(shell,
                        "Choose a Classification", false, "", null);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>
-        * Constructor for FilteredClassificationSelectionDialog.
-        * </p>
-        *
-        * @param shell
-        *            a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title
-        *            a {@link java.lang.String} object.
-        * @param multi
-        *            a boolean.
-        * @param settings
-        *            a {@link java.lang.String} object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param classification
-        *            a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
-        */
-       protected ClassificationSelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected ClassificationSelectionDialog(Shell shell,
                String title, boolean multi,
                        String settings, Classification classification) {
-               super(shell, //conversation,
-                       title, multi, settings, classification);
+               super(shell, title, multi, settings, classification);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected Classification getPersistentObject(UUID cdmUuid) {
                return CdmStore.getService(IClassificationService.class).load(cdmUuid);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
            model = CdmStore.getService(IClassificationService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
     }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return null;
index 59ff7510d0abada47577e4745dc4c47cecafec65..56d795e86cc07c53335b9442610cf87900a5f75a 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.UUID;
@@ -20,82 +19,43 @@ import eu.etaxonomy.taxeditor.newWizard.NewCollectionWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredCollectionSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created Oct 13, 2010
- * @version 1.0
  */
 public class CollectionSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<Collection> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param collection a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
-        * @return a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
-        */
-       public static Collection select(Shell shell, //ConversationHolder conversation,
+       public static Collection select(Shell shell,
                Collection collection){
                CollectionSelectionDialog dialog = new CollectionSelectionDialog(shell, //conversation,
                                "Choose Collection", false, CollectionSelectionDialog.class.getCanonicalName(), collection);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredCollectionSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
-        */
-       protected CollectionSelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected CollectionSelectionDialog(Shell shell,
                         String title, boolean multi,
                        String settings, Collection cdmObject) {
                super(shell, //conversation,
                        title, multi, settings, cdmObject);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
-       /** {@inheritDoc} */
        @Override
        protected Collection getPersistentObject(UUID uuid) {
                return CdmStore.getService(ICollectionService.class).load(uuid);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
-        */
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
           model = CdmStore.getService(ICollectionService.class).getUuidAndTitleCache(limitOfInitialElements,pattern);
     }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
         return new String[]{ "New Collection"};
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
-        */
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return new NewCollectionWizard();
        }
-
-
-}
+}
\ No newline at end of file
index 7acb7c9b31b2e66b3846e9e5e3471307e34024a1..626928198159a31d792808bc92a8e2d96031f230 100755 (executable)
@@ -20,13 +20,13 @@ import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
-import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.persistence.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.persistence.dto.TeamOrPersonUuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
index 72fc4616fb17d167f6dad43c1dcbee8f5055bb6f..72631010b6ff4b09b34c546aa81810ae0b073220 100755 (executable)
@@ -15,12 +15,15 @@ import java.util.UUID;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.widgets.Shell;
 
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.PreferenceSubject;
+import eu.etaxonomy.cdm.model.term.TermCollection;
+import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;
@@ -54,7 +57,7 @@ public class CommonNameNamedAreaSelectionDialog extends NamedAreaSelectionDialog
     }
     @Override
     protected void init() {
-        vocabularies = getAvailableVocabularies();
+        allVocabularies = getAvailableVocabularies();
     }
 
     protected List<TermVocabulary> getAvailableVocabularies(){
@@ -65,17 +68,33 @@ public class CommonNameNamedAreaSelectionDialog extends NamedAreaSelectionDialog
         PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.CommonNameAreaVocabularies);
         CdmPreference pref = cache.findBestMatching(key);
         if (preselectedVocabularyUuids != null){
-            for(int i=0;i<preselectedVocabularyUuids.length;i++){
-                TermVocabulary<?> preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
-                vocabularies.add(preselectedVocabulary);
+            for(UUID preselectedVocabularyUuid : preselectedVocabularyUuids){
+                TermCollection<?,?> preselectedVocabulary = CdmStore.getService(ITermCollectionService.class).find(preselectedVocabularyUuid);
+                if (preselectedVocabulary instanceof TermVocabulary) {
+                    vocabularies.add((TermVocabulary)preselectedVocabulary);
+                }else {
+                    if (allTrees == null) {
+                        allTrees = new ArrayList<>();
+                    }
+                    allTrees.add((TermTree)preselectedVocabulary);
+                }
+            }
+            selectedTermCollections = new ArrayList<>();
+            selectedTermCollections.addAll(vocabularies);
+            if (allTrees != null) {
+                selectedTermCollections.addAll(allTrees);
             }
         }
         if ((pref != null && !pref.isAllowOverride()) && preselectedVocabularyUuids!=null) {
              return vocabularies;
         }else{
-            selectedVocabularies = vocabularies;
 
-            return CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
+            if (allVocabularies == null) {
+                allVocabularies = new ArrayList<>();
+            }
+            allVocabularies.addAll(CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null));
+
+            return allVocabularies;
         }
     }
 
@@ -86,15 +105,14 @@ public class CommonNameNamedAreaSelectionDialog extends NamedAreaSelectionDialog
      *              The shell for displaying this widget
      * @param namedArea
      *              A namedArea that should be selected when the dialog opens
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
      * @param preferenceId a class which is used for generating the preference key so that every
-     * dialogs can be grouped to have their own preferences depending on this id
+     *              dialogs can be grouped to have their own preferences depending on this id
      * @param preselectedVocabularyUuids the {@link UUID}s of the pre-selected vocabularies
      * @return a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
      */
-    public static NamedArea select(Shell shell, //ConversationHolder conversation,
+    public static NamedArea select(Shell shell,
             NamedArea namedArea, String preferenceId) {
-        CommonNameNamedAreaSelectionDialog dialog = new CommonNameNamedAreaSelectionDialog(shell, //conversation,
+        CommonNameNamedAreaSelectionDialog dialog = new CommonNameNamedAreaSelectionDialog(shell,
                 "Choose an area", false, namedArea, preferenceId);
         return getSelectionFromDialog(dialog);
     }
index 3a54ac002c956973e27f808c5f1ab73cc778af49..0b45c430fd9c681603d120856204555865c1b717 100755 (executable)
@@ -20,44 +20,19 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author k.luther
  * @since 26.09.2018
- *
  */
 public class CommonNameReferenceSelectionDialog extends ReferenceSelectionDialog {
 
-    /**
-     * @param shell
-     * @param title
-     * @param multi
-     * @param reference
-     */
     protected CommonNameReferenceSelectionDialog(Shell shell, String title, boolean multi, Reference reference) {
         super(shell, title, multi, reference, null);
-
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#search
-     */
-    /** {@inheritDoc} */
     @Override
     protected void callService(String pattern) {
-
         model = CdmStore.getService(IReferenceService.class).findUuidAndTitleCacheByMarker(100, pattern, MarkerType.COMMON_NAME_REFERENCE());
-
-
     }
 
-    /**
-     * <p>select</p>
-     *
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     */
-
-    public static Reference select(Shell shell, //ConversationHolder conversation,
+    public static Reference select(Shell shell,
             Reference reference) {
         CommonNameReferenceSelectionDialog dialog = new CommonNameReferenceSelectionDialog(shell,// conversation,
                 "Choose a common name reference", isInReference, reference);
@@ -68,5 +43,4 @@ public class CommonNameReferenceSelectionDialog extends ReferenceSelectionDialog
     protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
         return new NewCommonNameReferenceWizard(null);
     }
-
-}
+}
\ No newline at end of file
index 5ccdd67b6feafe54fb294ba254c27e2c9f0f8ca7..4c4f12db1c83c6cf96189b08aab7d1fe2b5c184e 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.UUID;
@@ -23,48 +22,25 @@ import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredDerivedUnitSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created Jun 17, 2010
- * @version 1.0
  */
 public class DerivedUnitSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<DerivedUnit> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param unit a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase} object.
-        * @return a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase} object.
-        */
-       public static DerivedUnit select(Shell shell, //ConversationHolder conversation,
+       public static DerivedUnit select(Shell shell,
                DerivedUnit unit){
                DerivedUnitSelectionDialog dialog = new DerivedUnitSelectionDialog(shell, //conversation,
                                "Choose Unit", false, DerivedUnitSelectionDialog.class.getCanonicalName(), unit);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase} object.
-        */
-       protected DerivedUnitSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected DerivedUnitSelectionDialog(Shell shell,
                String title,
                        boolean multi, String settings, DerivedUnit cdmObject) {
-               super(shell, //conversation,
-                       title, multi, settings, cdmObject);
+               super(shell, title, multi, settings, cdmObject);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected DerivedUnit getPersistentObject(UUID uuid) {
                Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
@@ -78,21 +54,18 @@ public class DerivedUnitSelectionDialog extends
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
            model = CdmStore.getService(IOccurrenceService.class).getDerivedUnitUuidAndTitleCache(limitOfInitialElements,pattern);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return new NewDerivedUnitBaseWizard();
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return new String[]{ "New Unit"};
        }
-}
+}
\ No newline at end of file
index dc588186d4e5ca9380d974b2e3657778a221c05d..a8e0288b78cdb88624b5932881b0efcc0d38cada 100644 (file)
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class FeatureSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<Feature> {
 
-       public static Feature select(Shell shell, //ConversationHolder conversation,
+       public static Feature select(Shell shell,
                Feature feature){
                FeatureSelectionDialog dialog = new FeatureSelectionDialog(shell, //conversation,
                                "Choose Feature", false, FeatureSelectionDialog.class.getCanonicalName(), feature);
@@ -42,7 +42,7 @@ public class FeatureSelectionDialog extends
         * @param settings
         * @param cdmObject
         */
-       protected FeatureSelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected FeatureSelectionDialog(Shell shell,
                         String title, boolean multi,
                        String settings, Feature cdmObject) {
                super(shell,//conversation,
index d3d91fab37d996a6a35a7ed7251e6e97dd91e51a..97ef7b8218b29f2ab9d78aaead5a317468054fca 100644 (file)
@@ -81,7 +81,7 @@ public class FeatureTreeSelectionDialog extends
                         tree = TermTree.NewInstance(termType);
                     }
                     else{
-                        tree = TermTree.NewInstance();
+                        tree = TermTree.NewFeatureInstance();
                     }
                     tree.setTitleCache(dialog.getValue(), true);
                     CdmStore.getService(ITermTreeService.class).merge(tree,true);
index 33a176be689443c0ddd3420361561f68d5e25bf9..f13ffdbf31ffd6d364abd87b4d8d54e0f6da19be 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.UUID;
@@ -23,51 +22,25 @@ import eu.etaxonomy.taxeditor.newWizard.NewFieldUnitWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredFieldUnitSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created Jun 17, 2010
- * @version 1.0
  */
 public class FieldUnitSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<FieldUnit> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param observation a {@link eu.etaxonomy.cdm.model.occurrence.FieldUnit} object.
-        * @return a {@link eu.etaxonomy.cdm.model.occurrence.FieldUnit} object.
-        */
-       public static FieldUnit select(Shell shell, //ConversationHolder conversation,
+       public static FieldUnit select(Shell shell,
                FieldUnit observation){
                FieldUnitSelectionDialog dialog = new FieldUnitSelectionDialog(shell, //conversation,
                                "Choose Derived Unit", false, FieldUnitSelectionDialog.class.getCanonicalName(), observation);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredFieldUnitSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.FieldUnit} object.
-        */
-       protected FieldUnitSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected FieldUnitSelectionDialog(Shell shell,
                        String title, boolean multi, String settings,
                        FieldUnit cdmObject) {
-               super(shell, //conversation,
-                       title, multi, settings, cdmObject);
+               super(shell, title, multi, settings, cdmObject);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
-       /** {@inheritDoc} */
        @Override
        protected FieldUnit getPersistentObject(UUID uuid) {
                Object object = CdmStore.getService(IOccurrenceService.class).load(uuid);
@@ -81,25 +54,18 @@ public class FieldUnitSelectionDialog extends
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
-        */
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
            model = CdmStore.getService(IOccurrenceService.class).getUuidAndTitleCache(FieldUnit.class, limitOfInitialElements, pattern);
-
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return new NewFieldUnitWizard();
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return new String[]{"New Field Unit"};
        }
-}
+}
\ No newline at end of file
index bfbc457ff3c5021bfe84e7a475ecc8890f4a128a..8d832200883ccc0eb9451468d3b1972f2cf71881 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2017 EDIT
 * European Distributed Institute of Taxonomy
@@ -24,43 +23,39 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * @author k.luther
  * @date 21.11.2017
- *
  */
 public class FilterDialog extends Dialog {
 
-    List<TermVocabulary> vocabularies = new ArrayList<TermVocabulary>();
+    @SuppressWarnings("rawtypes")
+    private List<TermCollection> vocabularies = new ArrayList<>();
 
-    List<TermVocabulary> selectedVocabularies = new ArrayList<TermVocabulary>();
-    List<TermVocabulary> tempSelectedVocabularies = new ArrayList<TermVocabulary>();
-    boolean performOk = true;
+    @SuppressWarnings("rawtypes")
+    private List<TermCollection> selectedVocabularies = new ArrayList<>();
+    @SuppressWarnings("rawtypes")
+    private List<TermCollection> tempSelectedVocabularies = new ArrayList<>();
 
-    Object preferenceId;
+    private Object preferenceId;
 
-    /**
-     * @param parentShell
-     */
-    protected FilterDialog(Shell parentShell, Object preferenceId, List<TermVocabulary> selectedVocabularies, List<TermVocabulary> vocabularies) {
+    protected FilterDialog(Shell parentShell, Object preferenceId, List<TermCollection> selectedVocabularies, List<TermCollection> vocabularies) {
         super(parentShell);
         this.vocabularies = vocabularies;
         this.preferenceId = preferenceId;
         this.selectedVocabularies = selectedVocabularies;
-        this.tempSelectedVocabularies = new ArrayList();
+        this.tempSelectedVocabularies = new ArrayList<>();
         this.tempSelectedVocabularies.addAll(selectedVocabularies);
-
-
     }
 
     @Override
     protected Control createDialogArea(Composite parent) {
         Composite dialogArea = new Composite(parent, SWT.NULL);
         dialogArea.setLayout(new GridLayout(1, false));
-        for (TermVocabulary voc: vocabularies){
+        for (TermCollection voc: vocabularies){
             Button btnCheckButton = new Button(dialogArea, SWT.CHECK);
             btnCheckButton.setText(voc.getLabel());
             btnCheckButton.setData(voc);
@@ -76,7 +71,7 @@ public class FilterDialog extends Dialog {
                 public void widgetSelected(SelectionEvent e) {
                    if (btnCheckButton.getSelection()){
                        if (!tempSelectedVocabularies.contains(btnCheckButton.getData())){
-                          tempSelectedVocabularies.add((TermVocabulary)btnCheckButton.getData());
+                          tempSelectedVocabularies.add((TermCollection)btnCheckButton.getData());
                           if (!tempSelectedVocabularies.isEmpty()) {
                                   getButton(IDialogConstants.OK_ID).setEnabled(true);
                           }
@@ -89,15 +84,12 @@ public class FilterDialog extends Dialog {
                           }
                        }
                    }
-
                 }
 
                 @Override
                 public void widgetDefaultSelected(SelectionEvent e) {
                     // TODO Auto-generated method stub
-
                 }
-
             });
         }
 
@@ -106,13 +98,12 @@ public class FilterDialog extends Dialog {
         gd_table.widthHint = 543;
 
         return dialogArea;
-
     }
 
     @Override
     protected void okPressed(){
 
-        for (TermVocabulary voc: vocabularies){
+        for (TermCollection voc: vocabularies){
             if (tempSelectedVocabularies.contains(voc)){
                 PreferencesUtil.setBooleanValue(getPrefKey(voc), false);
                 selectedVocabularies.add(voc);
@@ -124,8 +115,7 @@ public class FilterDialog extends Dialog {
         super.okPressed();
     }
 
-    private String getPrefKey(TermVocabulary vocabulary){
+    private String getPrefKey(TermCollection vocabulary){
         return "hide_"+NamedAreaSelectionDialog.class.getCanonicalName()+vocabulary.getUuid()+preferenceId;
     }
-
-}
+}
\ No newline at end of file
index 675a0739b4b8da276a0e791dea448e7c8de0ed5a..796dc9c1a282950bc69860ce38639904e867efdd 100644 (file)
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityLabelT
 public class GrantedAuthoritySelectionDialog
         extends AbstractFilteredCdmResourceSelectionDialog<GrantedAuthorityImpl> {
 
-       public static GrantedAuthority select(Shell shell, //ConversationHolder conversation,
+       public static GrantedAuthority select(Shell shell,
                GrantedAuthorityImpl authority){
 
                GrantedAuthoritySelectionDialog dialog = new GrantedAuthoritySelectionDialog(shell,//conversation,
@@ -41,7 +41,7 @@ public class GrantedAuthoritySelectionDialog
                return getSelectionFromDialog(dialog);
        }
 
-       protected GrantedAuthoritySelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected GrantedAuthoritySelectionDialog(Shell shell,
                String title, boolean multi,
                        String settings, GrantedAuthorityImpl cdmObject) {
                super(shell, //conversation,
index ae49aaded181f2ee666b47475185137eff4a2dcb..36d5a00176626d02b00c70fda80959d81a00610e 100644 (file)
@@ -34,7 +34,7 @@ public class GroupSelectionDialog extends
 
     User user;
 
-       public static Group select(Shell shell, //ConversationHolder conversation,
+       public static Group select(Shell shell,
                Group group, User user){
                GroupSelectionDialog dialog = new GroupSelectionDialog(shell, //conversation,
                                "Choose Group", false, GroupSelectionDialog.class.getCanonicalName(), group, user);
@@ -49,7 +49,7 @@ public class GroupSelectionDialog extends
         * @param settings
         * @param cdmObject
         */
-       protected GroupSelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected GroupSelectionDialog(Shell shell,
                String title, boolean multi,
                        String settings, Group cdmObject, User user) {
                super(shell, //conversation,
index ecf151ad0ecb24c8f16c9b5f7565762ebe8097d4..93fc010922971b5f3fc802a883e3d502b46ac6a6 100644 (file)
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class MediaSelectionDialog extends
 AbstractFilteredCdmResourceSelectionDialog<Media> {
 
-    public static Media select(Shell shell, //ConversationHolder conversation,
+    public static Media select(Shell shell,
             Media media){
         MediaSelectionDialog dialog = new MediaSelectionDialog(shell, //conversation,
                 "Choose Media", false, MediaSelectionDialog.class.getCanonicalName(), media);
@@ -37,7 +37,7 @@ AbstractFilteredCdmResourceSelectionDialog<Media> {
     /**
      * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
      */
-    protected MediaSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected MediaSelectionDialog(Shell shell,
             String title,
             boolean multi, String settings, Media cdmObject) {
         super(shell, //conversation,
index 9e39afef646f6a92d9f1102315d1058672211bd0..b7816619c646271a980e468236907fee8208b73c 100644 (file)
@@ -21,18 +21,21 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Shell;\r
 \r
+import eu.etaxonomy.cdm.api.service.ITermCollectionService;\r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.api.service.ITermTreeService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;\r
 import eu.etaxonomy.cdm.model.metadata.TermSearchField;\r
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
+import eu.etaxonomy.cdm.model.term.TermCollection;\r
+import eu.etaxonomy.cdm.model.term.TermTree;\r
 import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.model.ImageResources;\r
 import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;\r
-import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;\r
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
@@ -43,32 +46,12 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NamedAreaSelectionDialog extends\r
                AbstractFilteredCdmResourceSelectionDialog<NamedArea> {\r
 \r
-//     private class IncludeNamedAreaVocabulary extends Action {\r
-//             private final TermVocabulary<NamedArea> vocabulary;\r
-//\r
-//             /**\r
-//              * Creates a new instance of the class.\r
-//              */\r
-//             public IncludeNamedAreaVocabulary(TermVocabulary<NamedArea> vocabulary) {\r
-//                     super(vocabulary.getTitleCache(), IAction.AS_CHECK_BOX);\r
-//                     this.vocabulary = vocabulary;\r
-//             }\r
-//\r
-//             @Override\r
-//        public void run(){\r
-//                     if(isChecked()){\r
-//                             selectedVocabularies.add(vocabulary);\r
-//                     }else{\r
-//                             selectedVocabularies.remove(vocabulary);\r
-//                     }\r
-//                     PreferencesUtil.setBooleanValue(getPrefKey(vocabulary), !isChecked());\r
-//                     search();\r
-//             }\r
-//     }\r
-\r
        protected List<NamedArea> selectedAreas;\r
-       protected List<TermVocabulary> selectedVocabularies;\r
-    protected List<TermVocabulary> vocabularies;\r
+       @SuppressWarnings("rawtypes")\r
+    protected List<TermCollection> selectedTermCollections;\r
+    @SuppressWarnings("rawtypes")\r
+    protected List<TermVocabulary> allVocabularies;\r
+    protected List<TermTree> allTrees;\r
 \r
        /**\r
         * Creates a filtered selection dialog to select a named area.\r
@@ -77,9 +60,8 @@ public class NamedAreaSelectionDialog extends
         *                              The shell for displaying this widget\r
         * @param namedArea\r
         *                              A namedArea that should be selected when the dialog opens\r
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.\r
         * @param preferenceId a class which is used for generating the preference key so that every\r
-        * dialogs can be grouped to have their own preferences depending on this id\r
+        *        dialogs can be grouped to have their own preferences depending on this id\r
         * @param preselectedVocabularyUuids the {@link UUID}s of the pre-selected vocabularies\r
         * @return a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.\r
         */\r
@@ -92,26 +74,27 @@ public class NamedAreaSelectionDialog extends
 \r
        protected NamedAreaSelectionDialog(Shell shell,\r
                String title, boolean multi, NamedArea namedArea, Object preferenceId, UUID... preselectedVocabularyUuids) {\r
-               super(shell,\r
-                       title, multi, NamedAreaSelectionDialog.class.getCanonicalName(), namedArea);\r
 \r
-               selectedVocabularies = new ArrayList<TermVocabulary>();\r
+               super(shell, title, multi, NamedAreaSelectionDialog.class.getCanonicalName(), namedArea);\r
+\r
+               selectedTermCollections = new ArrayList<>();\r
                this.preferenceID = preferenceId;\r
 \r
                if (preselectedVocabularyUuids != null && preselectedVocabularyUuids.length > 0){\r
-               for(int i=0;i<preselectedVocabularyUuids.length;i++){\r
-                       TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);\r
-                       selectedVocabularies.add(preselectedVocabulary);\r
+               for(UUID preselectedVocabularyUuid : preselectedVocabularyUuids){\r
+                TermCollection<?,?> preselectedVocabulary = CdmStore.getService(ITermCollectionService.class).find(preselectedVocabularyUuid);\r
+                       selectedTermCollections.add(preselectedVocabulary);\r
                }\r
                }else{\r
-                   selectedVocabularies = createSelectedVocabularies();\r
+                   selectedTermCollections = createSelectedVocabularies();\r
                }\r
        }\r
 \r
-    protected List<TermVocabulary> createSelectedVocabularies() {\r
-        List<TermVocabulary> tempSelectedVocabularies = new ArrayList<TermVocabulary>();\r
-        for(TermVocabulary vocabulary:vocabularies){\r
-                       if((selectedVocabularies.contains(vocabulary) && !PreferencesUtil.getBooleanValue(getPrefKey(vocabulary)))\r
+    protected List<TermCollection> createSelectedVocabularies() {\r
+        @SuppressWarnings("rawtypes")\r
+        List<TermCollection> tempSelectedVocabularies = new ArrayList<>();\r
+        for(TermCollection<?,?> vocabulary: allVocabularies){\r
+                       if((selectedTermCollections.contains(vocabulary) && !PreferencesUtil.getBooleanValue(getPrefKey(vocabulary)))\r
                                        || !PreferencesUtil.getBooleanValue(getPrefKey(vocabulary))){\r
                                tempSelectedVocabularies.add(vocabulary);\r
                        }\r
@@ -119,29 +102,14 @@ public class NamedAreaSelectionDialog extends
         return tempSelectedVocabularies;\r
     }\r
 \r
-//    private static UUID[] createVocabularyUuidList() {\r
-//        String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());\r
-//        if (StringUtils.isBlank(preselectedVocString)){\r
-//            return null;\r
-//        }\r
-//        String[] preselectedVocArray = preselectedVocString.split(";");\r
-//        UUID[] uuidList = new UUID[preselectedVocArray.length];\r
-//        int i = 0;\r
-//        for (String uuidString: preselectedVocArray){\r
-//            uuidList[i]= UUID.fromString(uuidString);\r
-//            i++;\r
-//        }\r
-//        return uuidList;\r
-//    }\r
-\r
-       private String getPrefKey(TermVocabulary vocabulary){\r
-               return "hide_"+NamedAreaSelectionDialog.class.getCanonicalName()+vocabulary.getUuid()+preferenceID;\r
+       private String getPrefKey(TermCollection<?,?> termCollection){\r
+               return "hide_"+NamedAreaSelectionDialog.class.getCanonicalName()+termCollection.getUuid()+preferenceID;\r
        }\r
 \r
        @Override\r
        protected NamedArea getPersistentObject(UUID uuid) {\r
 \r
-           DefinedTermBase area =  CdmStore.getService(ITermService.class).find(uuid);\r
+           DefinedTermBase<?> area =  CdmStore.getService(ITermService.class).find(uuid);\r
            if (area instanceof NamedArea){\r
                return (NamedArea) area;\r
            }\r
@@ -151,14 +119,17 @@ public class NamedAreaSelectionDialog extends
 \r
        @Override\r
        protected void init() {\r
-               vocabularies = getAvailableVocabularies();\r
+               getAvailableVocabularies();\r
        }\r
 \r
-       private List<TermVocabulary> getAvailableVocabularies(){\r
-           vocabularies = new ArrayList<>();\r
-           CdmPreferenceCache cache = CdmPreferenceCache.instance();\r
-           vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);\r
-           return vocabularies;\r
+    private void getAvailableVocabularies(){\r
+           allVocabularies = new ArrayList<>();\r
+           allVocabularies.addAll(CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null));\r
+\r
+           allTrees = CdmStore.getService(ITermTreeService.class).list(TermType.NamedArea, null, null, null, null);\r
+           if (allTrees == null) {\r
+               allTrees = new ArrayList<>();\r
+           }\r
        }\r
 \r
        @Override\r
@@ -185,15 +156,19 @@ public class NamedAreaSelectionDialog extends
        @Override\r
     void createFilterButton(Composite searchAndFilter){\r
         filterButton = new Button(searchAndFilter, SWT.NONE);\r
-//            filterButton.setText("Filter");\r
         filterButton.setImage(ImageResources.getImage(ImageResources.FUNNEL_ICON));\r
-//            SelectionListener filterSelectionListener = new FilterSelectionListener(preferenceID, this);\r
         filterButton.addSelectionListener(new SelectionListener(){\r
             @Override\r
             public void widgetSelected(SelectionEvent e) {\r
                 Object source = e.getSource();\r
                 if (source instanceof Button){\r
-                    Dialog dialog = new FilterDialog(getShell(), preferenceID, selectedVocabularies, vocabularies);\r
+                    List<TermCollection> allCollections = new ArrayList<>();\r
+                    allCollections.addAll(allVocabularies);\r
+                    if (allTrees!= null) {\r
+                        allCollections.addAll(allTrees);\r
+                    }\r
+\r
+                    Dialog dialog = new FilterDialog(getShell(), preferenceID, selectedTermCollections, allCollections);\r
                     dialog.open();\r
                     createSelectedVocabularies();\r
                     search();\r
@@ -209,6 +184,7 @@ public class NamedAreaSelectionDialog extends
 \r
     @Override\r
     protected void callService(String pattern) {\r
+        //label type\r
         String abbrevTypeString = PreferencesUtil.getStringValue(PreferencePredicate.NamedAreaSearchForAbbrev.getKey());\r
         TermSearchField abbrevType;\r
         try{\r
@@ -216,18 +192,7 @@ public class NamedAreaSelectionDialog extends
         }catch(IllegalArgumentException e){\r
             abbrevType = null;\r
         }\r
-        if (selectedVocabularies == null || selectedVocabularies.size() == 0){\r
-            if (abbrevType != null && !abbrevType.equals(TermSearchField.NoAbbrev)){\r
-                model = CdmStore.getService(ITermService.class).getUuidAndTitleCacheNamedAreaByAbbrev(vocabularies, limitOfInitialElements, pattern, PreferencesUtil.getGlobalLanguage(), abbrevType);\r
-            }else{\r
-                model = CdmStore.getService(ITermService.class).getUuidAndTitleCacheNamedArea(vocabularies, limitOfInitialElements, pattern, PreferencesUtil.getGlobalLanguage());\r
-            }\r
-        }else{\r
-            if (abbrevType != null  && !abbrevType.equals(TermSearchField.NoAbbrev)){\r
-                model = CdmStore.getService(ITermService.class).getUuidAndTitleCacheNamedAreaByAbbrev(selectedVocabularies, limitOfInitialElements, pattern, PreferencesUtil.getGlobalLanguage(), abbrevType);\r
-            }else{\r
-                model = CdmStore.getService(ITermService.class).getUuidAndTitleCacheNamedArea(selectedVocabularies, limitOfInitialElements, pattern, PreferencesUtil.getGlobalLanguage());\r
-            }\r
-        }\r
+\r
+        model = CdmStore.getService(ITermService.class).getUuidAndTitleCache(NamedArea.class, selectedTermCollections, limitOfInitialElements, pattern, PreferencesUtil.getGlobalLanguage(), abbrevType);\r
     }\r
 }
\ No newline at end of file
index b6d173939852d7e8fe8ede3d9e9a011339de76e0..f3f53bec76eff6e131d9111ab554f947deb60868 100644 (file)
@@ -17,11 +17,11 @@ import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
-import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.persistence.dto.EntityDTOBase;
 import eu.etaxonomy.cdm.persistence.dto.TeamOrPersonUuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
@@ -66,14 +66,6 @@ public class NomenclaturalAuthorSelectionDialog extends TeamOrPersonBaseSelectio
 //             return new FilteredCdmResourceAbbrevLabelProvider();
 //     }
 
-    /**
-     * <p>select</p>
-     *
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
-     * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
-     */
     public static TeamOrPersonBase<?> select(Shell shell,
             TeamOrPersonBase<?> entity, boolean teamMemberSelection) {
         NomenclaturalAuthorSelectionDialog dialog = new NomenclaturalAuthorSelectionDialog(shell, //conversation,
@@ -161,6 +153,4 @@ public class NomenclaturalAuthorSelectionDialog extends TeamOrPersonBaseSelectio
                        }
                };
        }
-
-
-}
+}
\ No newline at end of file
index 1bd1c42e71eb33bf0ba1d1b53ba33823ef3acfd4..36549f66ab2e9db1179a2523022b604fc73c8105 100644 (file)
@@ -29,14 +29,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class NomenclaturalAuthorTeamSelectionDialog
         extends AbstractFilteredCdmResourceSelectionDialog<Team> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        */
        public static Team select(Shell shell,
                Team team){
                NomenclaturalAuthorTeamSelectionDialog dialog = new NomenclaturalAuthorTeamSelectionDialog(shell, //conversation,
@@ -44,16 +36,6 @@ public class NomenclaturalAuthorTeamSelectionDialog
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        */
        protected NomenclaturalAuthorTeamSelectionDialog(Shell shell,
                String title,
                        boolean multi, String settings, Team agent) {
@@ -71,17 +53,6 @@ public class NomenclaturalAuthorTeamSelectionDialog
                return new String[]{"new Team"};
        }
 
-//     @Override
-//     protected void search() {
-//         Control control =getSearchField();
-//        String pattern = null;
-//        if (control != null){
-//            pattern = ((Text)control).getText();
-//        }
-//
-//             model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Team.class);
-//     }
-
        @Override
        protected Team getPersistentObject(UUID uuid) {
                return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class) ;
index 1bd62611d6f60c8caa25fcab9ccc81d405f214f0..294c88a391d314a033c9181a47dfa6ce001b9951 100644 (file)
@@ -19,36 +19,16 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author k.luther
  * @date 21.06.2016
- *
  */
 public class NomenclaturalPersonAuthorSelectionDialog extends PersonSelectionDialog {
 
-    /**
-     * @param shell
-     * @param conversation
-     * @param title
-     * @param multi
-     * @param settings
-     * @param agent
-     */
-    protected NomenclaturalPersonAuthorSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected NomenclaturalPersonAuthorSelectionDialog(Shell shell,
             String title, boolean multi,
             String settings, Person agent) {
-        super(shell, //conversation,
-                title, multi, settings, agent);
-        // TODO Auto-generated constructor stub
+        super(shell, title, multi, settings, agent);
     }
 
-
-    /**
-     * <p>select</p>
-     *
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
-     * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
-     */
-    public static Person select(Shell shell, //ConversationHolder conversation,
+    public static Person select(Shell shell,
             Person entity, boolean teamMemberSelection) {
         NomenclaturalPersonAuthorSelectionDialog dialog = new NomenclaturalPersonAuthorSelectionDialog(shell,
                 "Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity);
@@ -59,5 +39,4 @@ public class NomenclaturalPersonAuthorSelectionDialog extends PersonSelectionDia
     protected void callService(String pattern) {
         model = (List)CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(Person.class, limitOfInitialElements, pattern);
     }
-
-}
+}
\ No newline at end of file
index ec4d074be390f9fb6732cf71b1fd214f58e87100..2c11c0f607429c82f67ae1bceecbe9eaf7ec1d30 100644 (file)
@@ -13,11 +13,11 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.api.service.IReferenceService;
-import eu.etaxonomy.cdm.api.service.dto.EntityDTOBase.CdmEntity;
 import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.persistence.dto.EntityDTOBase.CdmEntity;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -29,7 +29,7 @@ public class NomenclaturalReferenceSelectionDialog extends
     private TeamOrPersonBase author;
     private boolean firstCall = true;
 
-       protected NomenclaturalReferenceSelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected NomenclaturalReferenceSelectionDialog(Shell shell,
                         String title, boolean multi,
                        Reference reference, boolean inReference, TeamOrPersonBase author) {
                super(shell, //conversation,
@@ -99,76 +99,14 @@ public class NomenclaturalReferenceSelectionDialog extends
        protected ILabelProvider createListLabelProvider() {
                return new FilteredCdmResourceAbbrevLabelProvider();
        }
-//   @Override
-//   protected void addIdentifierCheckButton(Composite searchAndFilter) {
-//       Button btnCheckButton = new Button(searchAndFilter, SWT.CHECK);
-//       btnCheckButton.setText("Use Identifier");
-//       btnCheckButton.addSelectionListener(new SelectionAdapter() {
-//           @Override
-//           public void widgetSelected(SelectionEvent e) {
-//               useIdentifier = btnCheckButton.getSelection();
-//           }
-//       });
-//   }
 
-       /**
-        * <p>select</p>
-        *
-        * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        */
-
-       public static Reference select(Shell shell, //ConversationHolder conversation,
+       public static Reference select(Shell shell,
                Reference reference, TeamOrPersonBase author) {
                NomenclaturalReferenceSelectionDialog dialog = new NomenclaturalReferenceSelectionDialog(shell,// conversation,
                                "Choose a reference", isInReference, reference, false, author);
                return getSelectionFromDialog(dialog);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createFilter()
-        */
-       /** {@inheritDoc} */
-//     @Override
-//     protected ItemsFilter createFilter() {
-//             return new ItemsFilter() {
-//
-//                     /**
-//                      * Always returns false to enforce refiltering even if the pattern is equal
-//                      */
-//                     @Override
-//                     public boolean equalsFilter(ItemsFilter filter) {
-//                             return false;
-//                     }
-//
-//                     @Override
-//                     public boolean isConsistentItem(Object item) {
-//                             return false;
-//                     }
-//
-//                     @Override
-//                     public boolean matchItem(Object item) {
-//                             return true;
-////                           String text = null;
-////                           if(item instanceof UuidAndTitleCache){
-////                                   if (((UuidAndTitleCache) item).getAbbrevTitleCache() != null){
-////                                           text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
-////                                   } else{
-////                                           text = ((UuidAndTitleCache) item).getTitleCache();
-////                                   }
-////                           }else if(item instanceof String){
-////                                   text = (String) item;
-////                           }
-////                           return text != null ? matches(text) : false;
-//                     }
-//
-//             };
-//     }
-
-
-
        public class FilteredCdmResourceAbbrevLabelProvider extends LabelProvider {
                @Override
                public String getText(Object element) {
@@ -191,7 +129,7 @@ public class NomenclaturalReferenceSelectionDialog extends
                        }
             return abbrevTitleCache;
                }
-       };
+       }
 
        @Override
     protected Comparator getItemsComparator() {
index f9942d69ab01ee62810314bf240c2fdc6f71c16c..f7acfd51a169ebe049a6d7eb1fefb1352bb63bb4 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.ArrayList;
@@ -14,71 +13,45 @@ import java.util.EnumSet;
 
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 
 /**
- * <p>OriginalSourceTypeSelectionDialog class.</p>
- *
  * @author c.mathew
  * @created 18.07.2013
- * @version 1.0
  */
 public class OriginalSourceTypeSelectionDialog extends
                AbstractFilteredCdmEnumSelectionDialog<OriginalSourceType> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @return a {@link eu.etaxonomy.cdm.model.reference.OriginalSourceType} object.
-        */
-       public static OriginalSourceType select(Shell shell, ConversationHolder conversation){
+       public static OriginalSourceType select(Shell shell){
                OriginalSourceTypeSelectionDialog dialog =
                                new OriginalSourceTypeSelectionDialog(shell,
-                                               conversation,
                                                "Choose Original Source Type",
                                                false,
                                                OriginalSourceTypeSelectionDialog.class.getCanonicalName());
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        */
        protected OriginalSourceTypeSelectionDialog(Shell shell,
-                       ConversationHolder conversation,
                        String title,
                        boolean multi,
                        String settings) {
-               super(shell, conversation, title, multi, settings, OriginalSourceType.PrimaryTaxonomicSource);
+               super(shell,  title, multi, settings, OriginalSourceType.PrimaryTaxonomicSource);
        }
 
-
-       /** {@inheritDoc} */
        @Override
        protected void initModel() {
-               model = new ArrayList<OriginalSourceType>();
+               model = new ArrayList<>();
                model.addAll(EnumSet.allOf(OriginalSourceType.class));
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getNewWizardLinkText() {
                return null;
        }
-}
+}
\ No newline at end of file
index 4845c0f7a0746cc6c64304877966bbb3797f9161..49aa07ce388754d4c3ba39d5630583dc7988767e 100644 (file)
@@ -6,10 +6,8 @@
 * 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.dialog.selection;
 
-import java.util.List;
 import java.util.UUID;
 
 import org.eclipse.swt.widgets.Shell;
@@ -21,75 +19,40 @@ import eu.etaxonomy.taxeditor.newWizard.NewPersonWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredPersonSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created Sep 24, 2009
- * @version 1.0
  */
 public class PersonSelectionDialog extends
                        AgentSelectionDialog<Person> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param person a {@link eu.etaxonomy.cdm.model.agent.Person} object.
-        * @return a {@link eu.etaxonomy.cdm.model.agent.Person} object.
-        */
-       public static Person select(Shell shell, //onversationHolder conversation,
-               Person person){
-               PersonSelectionDialog dialog = new PersonSelectionDialog(shell, //conversation,
+       public static Person select(Shell shell, Person person){
+               PersonSelectionDialog dialog = new PersonSelectionDialog(shell,
                                "Choose a person", false, PersonSelectionDialog.class.getCanonicalName(), person);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredPersonSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param cdmObject a {@link eu.etaxonomy.cdm.model.agent.Person} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       protected PersonSelectionDialog(Shell shell,// ConversationHolder conversation,
-               String title,
+       protected PersonSelectionDialog(Shell shell, String title,
                        boolean multi, String settings, Person cdmObject) {
                super(shell, title, multi, settings, cdmObject, true);
        }
 
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
-       /** {@inheritDoc} */
        @Override
        protected Person getPersistentObject(UUID uuid) {
                return (Person) CdmStore.getService(IAgentService.class).load(uuid);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
-        */
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
                model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Person.class, limitOfInitialElements, pattern);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return new NewPersonWizard();
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return new String[]{"New Person"};
        }
-}
+}
\ No newline at end of file
index 86c0f1d792801c176aff44f84b292baa7a7a1d23..42782334fab69469b4d6854de1f37354f82fecc1 100644 (file)
@@ -26,7 +26,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class PolytomousKeySelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<PolytomousKey> {
 
-       public static PolytomousKey select(Shell shell, //ConversationHolder conversation,
+       public static PolytomousKey select(Shell shell,
                PolytomousKey key){
                PolytomousKeySelectionDialog dialog = new PolytomousKeySelectionDialog(shell, //conversation,
                                "Choose Polytomous Key", false, PolytomousKeySelectionDialog.class.getCanonicalName(), key);
@@ -41,7 +41,7 @@ public class PolytomousKeySelectionDialog extends
         * @param settings
         * @param cdmObject
         */
-       protected PolytomousKeySelectionDialog(Shell shell,//ConversationHolder conversation,
+       protected PolytomousKeySelectionDialog(Shell shell,
                         String title, boolean multi,
                        String settings, PolytomousKey cdmObject) {
                super(shell, //conversation,
index a0166e807c8606d2898143c0866b5a26ac3182d9..f26ca3a2eaa0459f0d4aa02e52d256d4d87f970e 100644 (file)
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class PrimerSelectionDialog extends
 AbstractFilteredCdmResourceSelectionDialog<Primer> {
 
-    public static Primer select(Shell shell, //ConversationHolder conversation,
+    public static Primer select(Shell shell,
             Primer primer){
         PrimerSelectionDialog dialog = new PrimerSelectionDialog(shell, //conversation,
                 "Choose Primer", false, PrimerSelectionDialog.class.getCanonicalName(), primer);
@@ -38,7 +38,7 @@ AbstractFilteredCdmResourceSelectionDialog<Primer> {
     /**
      * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
      */
-    protected PrimerSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected PrimerSelectionDialog(Shell shell,
             String title,
             boolean multi, String settings, Primer cdmObject) {
         super(shell, //conversation,
index f69157b59d9ceee5e289f259bfad0840cdd4e8d2..98eb33a4aa52a0fbd072095f636c514f7b6f3aa2 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.ArrayList;
@@ -41,11 +40,8 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredReferenceSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created 04.06.2009
- * @version 1.0
  */
 public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Reference> {
 
@@ -55,30 +51,14 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
     Map<UUID, AlternativeIdentifier> identifierMap;
     Set<Reference> preSelectedReferences = new HashSet<>();
 
-       /**
-        * <p>select</p>
-        *
-        * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        */
-       public static Reference select(Shell shell, //ConversationHolder conversation,
+       public static Reference select(Shell shell,
                Reference reference, boolean isInReference) {
                ReferenceSelectionDialog dialog = new ReferenceSelectionDialog(shell, //conversation,
                                "Choose a reference", false, reference, isInReference);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-     * <p>select</p>
-     *
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     */
-    public static Reference select(Shell shell, //ConversationHolder conversation,
+    public static Reference select(Shell shell,
             Reference reference) {
         ReferenceSelectionDialog dialog = new ReferenceSelectionDialog(shell, //conversation,
                 "Choose a reference", false, reference, null);
@@ -92,53 +72,21 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
         return getSelectionFromDialog(dialog);
     }
 
-
-
-
-       /**
-        * <p>Constructor for FilteredReferenceSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title a {@link java.lang.String} object.
-        * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param multi a boolean.
-        */
-       protected ReferenceSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected ReferenceSelectionDialog(Shell shell,
                String title, boolean multi, Reference reference, Set<Reference> preSelectedReferences) {
-               super(shell, //conversation,
+               super(shell,
                        title, multi, ReferenceSelectionDialog.class.getCanonicalName(), reference);
                this.currentReference = reference;
                this.preSelectedReferences = preSelectedReferences;
-
        }
-
-
-
-
-       /**
-     * <p>Constructor for FilteredReferenceSelectionDialog.</p>
-     *
-     * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-     * @param title a {@link java.lang.String} object.
-     * @param reference a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-     * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     * @param multi a boolean.
-     */
-    protected ReferenceSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected ReferenceSelectionDialog(Shell shell,
             String title, boolean multi, Reference reference, boolean isInReference) {
         super(shell, //conversation,
                 title, multi, ReferenceSelectionDialog.class.getCanonicalName());
-        this.isInReference = isInReference;
+        ReferenceSelectionDialog.isInReference = isInReference;
         this.currentReference = reference;
-
     }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
-        */
-       /** {@inheritDoc} */
        @Override
        protected Reference getPersistentObject(UUID cdmUuid) {
            if (lastSelectedReferences == null){
@@ -155,10 +103,6 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                return CdmStore.getService(IReferenceService.class).load(cdmUuid);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#search
-        */
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
 
@@ -186,7 +130,6 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                    }else{
                        model = CdmStore.getService(IReferenceService.class).getUuidAndTitleCacheForUUIDS(uuids);
                    }
-
                }
 
            } else if (isInReference && currentReference != null){
@@ -197,11 +140,9 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                     model.clear();
                 }
                 for (IdentifiedEntityDTO dto: list){
-
                     model.add(dto.getCdmEntity());
                 }
             }else{
-
                 model = CdmStore.getService(IReferenceService.class).getUuidAndTitleCache(limitOfInitialElements,pattern, currentReference.getType());
             }
 
@@ -211,31 +152,27 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                 if (model!= null){
                     model.clear();
                 }
-                identifierMap = new HashMap();
+                identifierMap = new HashMap<>();
                 for (IdentifiedEntityDTO dto: list){
                     if (dto.getIdentifier() != null){
                         identifierMap.put(dto.getCdmEntity().getUuid(), dto.getIdentifier());
                     }
                     model.add(dto.getCdmEntity());
-
                 }
             }else if (isUseIdentifier() ){
                 List<IdentifiedEntityDTO<Reference>> list = CdmStore.getService(IReferenceService.class).listByIdentifierAbbrev(pattern, null, MatchMode.BEGINNING, limitOfInitialElements);
                 if (model!= null){
                     model.clear();
                 }
-                identifierMap = new HashMap();
+                identifierMap = new HashMap<>();
                 for (IdentifiedEntityDTO dto: list){
                     identifierMap.put(dto.getCdmEntity().getUuid(), dto.getIdentifier());
                     model.add(dto.getCdmEntity());
-
                 }
             }else {
                 model = CdmStore.getService(IReferenceService.class).getUuidAndTitleCache(limitOfInitialElements,pattern);
             }
-
         }
-
        }
 
        @Override
@@ -254,7 +191,7 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
             }
         });
     }
-       /** {@inheritDoc} */
+
        @Override
        protected String getTitle(Reference cdmObject) {
                if(cdmObject == null){
@@ -262,12 +199,8 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                }else{
                    return super.getTitle(cdmObject);
                }
-//             }else{
-//                     return DefaultReferenceCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorship().getTitleCache());
-//             }
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
            if (isInReference){
@@ -278,13 +211,11 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                return new NewReferenceWizard(null);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return new String[]{"New Reference"};
        }
 
-       /** {@inheritDoc} */
     @Override
     protected void search() {
         Control control =getSearchField();
@@ -321,11 +252,9 @@ public class ReferenceSelectionDialog extends AbstractFilteredCdmResourceSelecti
                         titleCache += " (-)";
                     }
                 }
-
             }
 
             return titleCache;
         }
-    };
-
-}
+    }
+}
\ No newline at end of file
index e4995d8116fae4526e8f82322ec9d8433d89d132..c1d79aff6734517ea46aabfcf2241ab80da0abca 100644 (file)
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class RightsSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Rights> {
 
 
-    public static Rights select(Shell shell, //ConversationHolder conversation,
+    public static Rights select(Shell shell,
             Rights rights){
         RightsSelectionDialog dialog = new RightsSelectionDialog(shell, //conversation,
                 "Choose Rights", false, RightsSelectionDialog.class.getCanonicalName(), rights);
@@ -37,7 +37,7 @@ public class RightsSelectionDialog extends AbstractFilteredCdmResourceSelectionD
     /**
      * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
      */
-    protected RightsSelectionDialog(Shell shell, //ConversationHolder conversation,
+    protected RightsSelectionDialog(Shell shell,
             String title,
             boolean multi, String settings, Rights rights) {
         super(shell, //conversation,
index 0786eac362dfc5fc0ba4c1ce307262acb7f39898..9972a6d6a3e9ec446af1afaf6548b71d9cd0a3b2 100644 (file)
@@ -87,7 +87,7 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.CdmFilteredItemsSelectionDialo
  * @author k.luther
  * @date 15.11.2017d
  */
-public abstract class SearchDialog<T extends ICdmBase> extends Dialog{// implements IConversationEnabled{
+public abstract class SearchDialog<T extends ICdmBase> extends Dialog{
 
     private TableViewer list;
     private Text searchField;
index c642891542d3a8023dd8a6ed7dbd7ddd8d489edf..08031d0ca7b09af2646eb57236c7e409052d701b 100644 (file)
@@ -13,7 +13,7 @@ import java.util.UUID;
 \r
 import org.eclipse.swt.widgets.Shell;\r
 \r
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;\r
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;\r
 import eu.etaxonomy.cdm.model.agent.AgentBase;\r
 import eu.etaxonomy.cdm.model.agent.Institution;\r
 import eu.etaxonomy.cdm.model.agent.Person;\r
@@ -116,7 +116,7 @@ public class SelectionDialogFactory {
                if(clazz.equals(Team.class)){\r
                        return (T) TeamSelectionDialog.select(shell, (Team)currentSelection);\r
                }\r
-               if(clazz.equals(TeamOrPersonBase.class) && (parentElement instanceof AuthorshipDetailElement \r
+               if(clazz.equals(TeamOrPersonBase.class) && (parentElement instanceof AuthorshipDetailElement\r
                                || (parentElement instanceof ReferenceDetailElement && ((ReferenceDetailElement)parentElement).isNomenclaturalReference()))){\r
             return (T) NomenclaturalAuthorSelectionDialog.select(shell,\r
                     (TeamOrPersonBase) currentSelection, false);\r
index 643501dfbd403faf3a2cd0bf5a2ba25f8d6d00d3..663ba2b9adee77bebe416a2571093a4e6b1aa922 100644 (file)
@@ -26,14 +26,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class SpecimenOrObservationBaseSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<SpecimenOrObservationBase> {
 
-       public static SpecimenOrObservationBase select(Shell shell, //ConversationHolder conversation,
+       public static SpecimenOrObservationBase select(Shell shell,
                SpecimenOrObservationBase observation){
                SpecimenOrObservationBaseSelectionDialog dialog = new SpecimenOrObservationBaseSelectionDialog(shell, //conversation,
                                "Choose field unit or derived unit", false, SpecimenOrObservationBaseSelectionDialog.class.getCanonicalName(), observation);
                return getSelectionFromDialog(dialog);
        }
 
-       protected SpecimenOrObservationBaseSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected SpecimenOrObservationBaseSelectionDialog(Shell shell,
                        String title, boolean multi, String settings,
                        SpecimenOrObservationBase cdmObject) {
                super(shell, //conversation,
index 15df121d38aacdc3933ed050316a2685db300904..7509d85295a302d9e0352ced100f7f6b3b796185 100644 (file)
@@ -1,5 +1,11 @@
-//$Id$
-
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.dialog.selection;
 
 import java.util.ArrayList;
@@ -7,71 +13,45 @@ import java.util.EnumSet;
 
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 
 /**
-* <p>OriginalSourceTypeSelectionDialog class.</p>
-*
 * @author c.mathew
 * @created 18.07.2013
-* @version 1.0
 */
 public class SpecimenOrObservationTypeSelectionDialog extends
                AbstractFilteredCdmEnumSelectionDialog<SpecimenOrObservationType> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @return a {@link eu.etaxonomy.cdm.model.reference.OriginalSourceType} object.
-        */
-       public static SpecimenOrObservationType select(Shell shell, ConversationHolder conversation){
+       public static SpecimenOrObservationType select(Shell shell){
                SpecimenOrObservationTypeSelectionDialog dialog =
                                new SpecimenOrObservationTypeSelectionDialog(shell,
-                                               conversation,
                                                "Choose Specimen / Observation Type",
                                                false,
                                                SpecimenOrObservationTypeSelectionDialog.class.getCanonicalName());
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        */
        protected SpecimenOrObservationTypeSelectionDialog(Shell shell,
-                       ConversationHolder conversation,
                        String title,
                        boolean multi,
                        String settings) {
-               super(shell, conversation, title, multi, settings, SpecimenOrObservationType.Unknown);
+               super(shell, title, multi, settings, SpecimenOrObservationType.Unknown);
        }
 
-
-       /** {@inheritDoc} */
        @Override
        protected void initModel() {
                model = new ArrayList<SpecimenOrObservationType>();
                model.addAll(EnumSet.allOf(SpecimenOrObservationType.class));
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getNewWizardLinkText() {
                return null;
        }
-}
+}
\ No newline at end of file
index f15b0bd3bae70816f13191366483d9e82991f87d..df960fb37586096a409cf23b19b0748fde520245 100644 (file)
@@ -6,7 +6,6 @@
  * 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.dialog.selection;
 
 import java.util.Collections;
@@ -27,38 +26,35 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 /**
  * @author n.hoffmann
  * @created Sep 21, 2009
- * @version 1.0
  */
 public class TaxonBaseSelectionDialog<T extends TaxonBase> extends AbstractFilteredCdmResourceSelectionDialog {
 
-
-    public static TaxonBase selectTaxonBase(Shell shell){//, ConversationHolder conversation) {
-        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, //conversation,
+    public static TaxonBase selectTaxonBase(Shell shell){
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog<>(TaxonBase.class, shell,
                 "Choose a taxon/synonym", false, null, null);
         return getSelectionFromDialog(dialog);
     }
 
-    public static Taxon selectTaxon(Shell shell, //ConversationHolder conversation,
+    public static Taxon selectTaxon(Shell shell,
             Taxon taxonToBeFiltered) {
 
 
-        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Taxon.class, shell, //conversation,
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog<>(Taxon.class, shell,
                 "Choose a taxon", false, null, taxonToBeFiltered);
         return (Taxon) getSelectionFromDialog(dialog);
     }
 
-    public static Synonym selectSynonym(Shell shell){//, ConversationHolder conversation) {
-        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, //conversation,
+    public static Synonym selectSynonym(Shell shell){
+        AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog<>(Synonym.class, shell,
                 "Choose a synonym", false, null, null);
         return (Synonym) getSelectionFromDialog(dialog);
     }
 
     private final Class<? extends TaxonBase> clazz;
 
-    protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, //ConversationHolder conversation,
+    protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell,
             String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) {
-        super(shell, //conversation,
-                title, multi, TaxonBaseSelectionDialog.class.getCanonicalName(), taxon);
+        super(shell, title, multi, TaxonBaseSelectionDialog.class.getCanonicalName(), taxon);
         if (taxonToBeFiltered != null){
             this.cdmBaseToBeFiltered = new HashSet<>();
             this.cdmBaseToBeFiltered.add(taxonToBeFiltered.getUuid());
@@ -67,27 +63,22 @@ public class TaxonBaseSelectionDialog<T extends TaxonBase> extends AbstractFilte
         search();
     }
 
-    /** {@inheritDoc} */
     @Override
     protected TaxonBase getPersistentObject(UUID uuid) {
         return CdmStore.getService(ITaxonService.class).load(uuid);
     }
 
-    /** {@inheritDoc} */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings({ "unchecked"})
        @Override
     protected void callService(String pattern) {
-
         model = CdmStore.getService(ITaxonService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
     }
 
-    /** {@inheritDoc} */
     @Override
     protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
         return new NewTaxonWizard();
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String[] getNewWizardText() {
         return new String[]{"New Taxon"};
@@ -100,4 +91,4 @@ public class TaxonBaseSelectionDialog<T extends TaxonBase> extends AbstractFilte
         }
       // otherwise result is already sorted
     }
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeAndBoolean.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeAndBoolean.java
new file mode 100644 (file)
index 0000000..4d4dabe
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+* Copyright (C) 2023 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.dialog.selection;
+
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+
+/**
+ * @author katjaluther
+ * @since 27.10.2023
+ */
+public class TaxonNodeAndBoolean {
+    private TaxonNode node;
+    private Boolean bool;
+    
+    
+    public TaxonNodeAndBoolean(TaxonNode node, Boolean bool) {
+        this.node = node;
+        this.bool = bool;
+        
+    }
+
+    public TaxonNode getNode() {
+        return node;
+    }
+    
+    public void setNode(TaxonNode node) {
+        this.node = node;
+    }
+
+    /**
+     * @return the bool
+     */
+    public Boolean getBool() {
+        return bool;
+    }
+
+    /**
+     * @param bool the bool to set
+     */
+    public void setBool(Boolean bool) {
+        this.bool = bool;
+    }
+
+}
index fc4829f4bf855fa912276d01e0c2c50e7e3f681a..9959837344066240680b3513e0688ab993b8e3a4 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
@@ -27,6 +28,7 @@ import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
+import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -36,7 +38,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{
 
-       public static TaxonNode select(Shell shell, //ConversationHolder conversation,
+       public static TaxonNode select(Shell shell,
                String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
                TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
                                //conversation,
@@ -44,10 +46,10 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                                excludeTaxa,
                                false,
                                node,
-                               classificationUUID, allowSelectClassification);
+                               classificationUUID, allowSelectClassification, false);
                return getSelectionFromDialog(dialog);
        }
-       public static TaxonNode select(Shell shell, //ConversationHolder conversation,
+       public static TaxonNode select(Shell shell,
             String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
         TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
                 //conversation,
@@ -58,8 +60,23 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                 classificationUUID);
         return getSelectionFromDialog(dialog);
     }
+       
+       public static TaxonNodeAndBoolean select(Shell shell,
+            String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID, boolean allowClassification, boolean showDefaultDescription) {
+        TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
+                //conversation,
+                title,
+                excludeTaxa,
+                false,
+                node,
+                classificationUUID, allowClassification, showDefaultDescription);
+        TaxonNode nodeResult = getSelectionFromDialog(dialog);
+        TaxonNodeAndBoolean result = new TaxonNodeAndBoolean(nodeResult,dialog.useDefaultDescription);
+        
+        return result;
+    }
 
-       public static UuidAndTitleCache<TaxonNode> selectUuidAndTitleCache(Shell shell, //ConversationHolder conversation,
+       public static UuidAndTitleCache<TaxonNode> selectUuidAndTitleCache(Shell shell,
             String title, Set<UUID> excludeTaxa, TaxonNode node, UUID classificationUUID) {
         TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
                 //conversation,
@@ -67,7 +84,7 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                 excludeTaxa,
                 false,
                 node,
-                classificationUUID, false);
+                classificationUUID, false, false);
         return getUuidAndTitleCacheSelectionFromDialog(dialog);
     }
 
@@ -79,9 +96,14 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        private UUID selectedUuid;
 //     private final Set<UUID> excludeTaxa;
        private boolean allowClassificationSelection = false;
+       
+       private boolean useDefaultDescription = false;
+
+       Button checkDefaultDescription; 
+       private boolean showDefaultDescriptionCheck = false;
 
-       protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation,
-               String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification) {
+       protected TaxonNodeSelectionDialog(Shell shell,
+               String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID, boolean allowSelectClassification, boolean showDefaultDescription) {
                super(shell, //conversation,
                        title, multi, TaxonNodeSelectionDialog.class.getCanonicalName(), node);
 
@@ -96,18 +118,20 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
 
                fillClassifications();
                this.allowClassificationSelection = allowSelectClassification;
+               this.showDefaultDescriptionCheck = showDefaultDescription;
 
                //createClassificationSelectionCombo(shell);
        }
-       protected TaxonNodeSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected TaxonNodeSelectionDialog(Shell shell,
             String title, Set<UUID> excludeTaxa, boolean multi, TaxonNode node, UUID classificationUUID) {
-           this(shell, title, excludeTaxa, multi, node, classificationUUID, false);
+           this(shell, title, excludeTaxa, multi, node, classificationUUID, false, false);
        }
 
        /** {@inheritDoc} */
        @Override
-       protected Control createDialogArea(Composite parent) {
+       protected Control createDialogArea(Composite parent) {      
            Composite container = (Composite) super.createDialogArea(parent);
+           
                return createClassificationSelectionCombo(container);
        }
 
@@ -118,14 +142,41 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
 //             classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
 
                Composite classificationSelection = new Composite(parent, SWT.NULL);
-               classificationSelection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+               classificationSelection.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
+               
 
                GridLayout layout = new GridLayout();
                classificationSelection.setLayout(layout);
-
+               layout.numColumns = 2;
+
+               if (showDefaultDescriptionCheck) {
+            
+            Label labelDefault = new Label(classificationSelection, SWT.NULL);
+            labelDefault.setText(Messages.TaxonNodeSelectionDialog_0);
+            GridData labelDefaultLayout = new GridData(SWT.LEFT, SWT.TOP, false, false,1,1);
+            labelDefault.setLayoutData(labelDefaultLayout);
+            checkDefaultDescription = new Button(classificationSelection, SWT.CHECK);
+            checkDefaultDescription.addSelectionListener(new SelectionListener() {
+                
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    useDefaultDescription = checkDefaultDescription.getSelection();                    
+                }
+                
+                @Override
+                public void widgetDefaultSelected(SelectionEvent e) {
+                    // TODO Auto-generated method stub
+                    
+                }
+            });
+            
+        }
+               
                Label label = new Label(classificationSelection, SWT.NULL);
                // TODO not working is not really true but leave it here to remind everyone that this is under construction
-               label.setText("Select Classification");
+               label.setText(Messages.TaxonNodeSelectionDialog_1);
+               GridData labelLayout = new GridData(SWT.LEFT, SWT.TOP, true, false,2,1);
+               label.setLayoutData(labelLayout);
                classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY);
                classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
 
@@ -153,7 +204,7 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                        return taxonNode.getTaxon().getTitleCache();
                }
 
-               return "";
+               return ""; //$NON-NLS-1$
        }
 
        @Override
index 6b7c8cd88a185c159eb5eb4906ffa8a562ce2846..796348b89abe01dac6c62fa2b7d7847bdab6f67d 100644 (file)
@@ -11,7 +11,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 public class TaxonNodeSelectionNaturalOrderDialog extends\r
                TaxonNodeSelectionDialog {\r
 \r
-       protected TaxonNodeSelectionNaturalOrderDialog(Shell shell,//ConversationHolder conversation,\r
+       protected TaxonNodeSelectionNaturalOrderDialog(Shell shell,\r
                String title,\r
                        Set<UUID> excludeTaxa, boolean multi, TaxonNode node,\r
                        Classification classification) {\r
index 839ac0083a8a57bb0bee110bacf107a7c6fa9947..29f72b2fa0482f81448b5ec269ba8a5efbc8790b 100755 (executable)
@@ -43,7 +43,7 @@ public class TaxonSelectionDialog extends TaxonBaseSelectionDialog<Taxon> {
         // TODO Auto-generated constructor stub
     }
 
-    public static Taxon selectTaxon(Shell shell, //ConversationHolder conversation,
+    public static Taxon selectTaxon(Shell shell,
             Taxon taxonToBeFiltered) {
         AbstractFilteredCdmResourceSelectionDialog<Taxon> dialog = new TaxonSelectionDialog(Taxon.class, shell, //conversation,
                 "Choose a taxon", false, null, taxonToBeFiltered);
index 787092116a72cc113ad9631ef81c66e4d690379b..b9aa719fefba85e486143a7ec1a1faee5305ed71 100644 (file)
@@ -6,7 +6,6 @@
 * 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.dialog.selection;
 
 import java.util.UUID;
@@ -21,72 +20,43 @@ import eu.etaxonomy.taxeditor.newWizard.NewTeamWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>FilteredTeamSelectionDialog class.</p>
- *
  * @author n.hoffmann
  * @created Sep 24, 2009
- * @version 1.0
  */
 public class TeamSelectionDialog extends
                AbstractFilteredCdmResourceSelectionDialog<Team> {
 
-       /**
-        * <p>select</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        */
-       public static Team select(Shell shell, //ConversationHolder conversation,
+       public static Team select(Shell shell,
                Team team){
-               TeamSelectionDialog dialog = new TeamSelectionDialog(shell, //conversation,
+               TeamSelectionDialog dialog = new TeamSelectionDialog(shell,
                                "Choose Team", false, TeamSelectionDialog.class.getCanonicalName(), team);
                return getSelectionFromDialog(dialog);
        }
 
-       /**
-        * <p>Constructor for FilteredTeamSelectionDialog.</p>
-        *
-        * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
-        * @param title a {@link java.lang.String} object.
-        * @param multi a boolean.
-        * @param settings a {@link java.lang.String} object.
-        * @param cdmObject a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       protected TeamSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected TeamSelectionDialog(Shell shell,
                        String title, boolean multi, String settings,
                        Team cdmObject) {
-               super(shell, //conversation,
-                       title, multi, settings, cdmObject);
+               super(shell, title, multi, settings, cdmObject);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
-        */
-       /** {@inheritDoc} */
        @Override
        protected void callService(String pattern) {
                model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(Team.class, limitOfInitialElements, pattern);
 
        }
 
-       /** {@inheritDoc} */
        @Override
        protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
                return new NewTeamWizard();
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String[] getNewWizardText() {
                return new String[]{"New Team"};
        }
 
-       /** {@inheritDoc} */
        @Override
        protected Team getPersistentObject(UUID uuid) {
                return CdmBase.deproxy(CdmStore.getService(IAgentService.class).load(uuid), Team.class);
        }
-}
+}
\ No newline at end of file
index 9ae2fdb7f732907f53064b83524f0c15c17e956c..13f69605be775734b88939bb12796f696123f831 100644 (file)
@@ -43,7 +43,7 @@ public class UserSelectionDialog extends
         * @param user
         * @return
         */
-       public static User select(Shell shell, //ConversationHolder conversation,
+       public static User select(Shell shell,
                User user, Group group){
                UserSelectionDialog dialog = new UserSelectionDialog(shell, //conversation,
                                "Choose User", false, UserSelectionDialog.class.getCanonicalName(), user, group);
@@ -58,7 +58,7 @@ public class UserSelectionDialog extends
         * @param settings
         * @param cdmObject
         */
-       protected UserSelectionDialog(Shell shell, //ConversationHolder conversation,
+       protected UserSelectionDialog(Shell shell,
                        String title, boolean multi, String settings, User cdmObject, Group group) {
                super(shell, //conversation,
                        title, multi, settings, cdmObject);
index 6d0a3a6923162263a6675355c5260d8d38e402ad..7deb5e9d7ccf62fe9d5b57fc3748c1d6a283936a 100644 (file)
@@ -18,60 +18,32 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-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.section.AbstractCdmDetailElement;
 
 /**
- * <p>
- * Abstract AbstractCdmEntityWizardPage class.
- * </p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
  */
 public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
-               implements IConversationEnabled, IPropertyChangeListener {
+               implements IPropertyChangeListener {
 
        protected CdmFormFactory formFactory;
        protected T entity;
 
        AbstractCdmDetailElement<T> detailElement;
-       private final ConversationHolder conversation;
 
-       /**
-        * <p>
-        * Constructor for AbstractCdmEntityWizardPage.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param entity
-        *            a T object.
-        * @param <T>
-        *            a T object.
-        */
-       protected AbstractCdmEntityWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, T entity) {
+       protected AbstractCdmEntityWizardPage(CdmFormFactory formFactory, T entity) {
                super("page");
                this.formFactory = formFactory;
                this.entity = entity;
-               this.conversation = conversation;
                setDescription(getEntityTitle());
 
                formFactory.addPropertyChangeListener(this);
                setPageComplete(false);
        }
 
-       /**
-        * @return
-        */
+
        private String getEntityTitle() {
                if (entity instanceof IIdentifiableEntity) {
                        ((IIdentifiableEntity) entity).getTitleCache();
@@ -79,7 +51,6 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                return "";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void createControl(Composite parent) {
                ScrolledForm scrolledForm = formFactory.createScrolledForm(parent);
@@ -93,7 +64,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                layout.bottomMargin = 25;
         control.setLayout(layout);
                WizardPageRootElement rootElement = new WizardPageRootElement(
-                               formFactory, control, getConversationHolder());
+                               formFactory, control);
 
                Color bgColor = getShell().getBackground();
 
@@ -106,39 +77,17 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                setControl(scrolledForm);
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>entity</code>.
-        * </p>
-        *
-        * @return a T object.
-        */
        public T getEntity() {
                return entity;
        }
 
-       /**
-        * Creates the detail element for this wizard page
-        *
-        * @param rootElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement}
-        *         object.
-        */
        public abstract AbstractCdmDetailElement<T> createElement(
                        ICdmFormElement rootElement);
 
-       protected class WizardPageRootElement extends RootElement implements
-                       IConversationEnabled {
-
-               private final ConversationHolder conversation;
+       protected class WizardPageRootElement extends RootElement {
 
-               public WizardPageRootElement(CdmFormFactory formFactory,
-                               Composite layoutComposite, ConversationHolder conversation) {
+               public WizardPageRootElement(CdmFormFactory formFactory, Composite layoutComposite) {
                        super(formFactory, layoutComposite);
-                       this.conversation = conversation;
                }
 
                @Override
@@ -148,15 +97,6 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                        detailElement = createElement(this);
                        ((Composite) getControl()).layout();
                }
-
-               @Override
-               public ConversationHolder getConversationHolder() {
-                       return conversation;
-               }
-
-               @Override
-               public void update(CdmDataChangeMap changeEvents) {
-               }
        }
 
        @Override
@@ -193,20 +133,6 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                return true;
        }
 
-       /**
-        * <p>
-        * getConversationHolder
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *         object.
-        */
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-       /** {@inheritDoc} */
        @Override
        public void dispose() {
                if (detailElement != null) {
@@ -216,21 +142,7 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                super.dispose();
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>detailElement</code>.
-        * </p>
-        *
-        * @return a
-        *         {@link eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement}
-        *         object.
-        */
        public AbstractCdmDetailElement<T> getDetailElement() {
                return detailElement;
        }
-
-       /** {@inheritDoc} */
-       @Override
-       public void update(CdmDataChangeMap changeEvents) {
-       }
-}
+}
\ No newline at end of file
index 10584bab3a597aebe15b48911c24eb0d53275661..595708563df95c52e859c3ec43529433fb9b291d 100644 (file)
@@ -35,8 +35,6 @@ import org.eclipse.ui.forms.widgets.Section;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import org.eclipse.ui.forms.widgets.ToggleHyperlink;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -55,7 +53,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 //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 {
+        implements ISelectionChangedListener, IEntityElement<ENTITY> {
 
     /**
      * The default number of columns in detail sections
@@ -385,30 +383,4 @@ public abstract class AbstractFormSection<ENTITY>
                // empty default implementation
        }
 
-       @Override
-    public ConversationHolder getConversationHolder() {
-           if(AbstractUtility.getActivePart() instanceof IConversationEnabled){
-            return ((IConversationEnabled) AbstractUtility.getActivePart()).getConversationHolder();
-        }
-           if(getParentElement() instanceof RootElement || getParentElement() == null){
-
-               Object activeEditor = AbstractUtility.getActiveEditor();
-               if(activeEditor instanceof IConversationEnabled){
-                   ConversationHolder conversation = ((IConversationEnabled) AbstractUtility.getActiveEditor()).getConversationHolder();
-                   return conversation;
-               }
-           }else if(getParentElement() instanceof IConversationEnabled){
-               return ((IConversationEnabled) getParentElement()).getConversationHolder();
-           }
-               MessagingUtils.error(getClass(), "Could not get conversation for AbstractFormSection. There is an error in the implementation. There should have been an active editor but it wasn't",
-                               new IllegalArgumentException());
-               return null;
-
-       }
-
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {
-
-       }
-
 }
index c2c45a8d88c917c6f9b590dc2ddfbe0694f54458..f93b560726bd9c67641a63c063d630a9e08dd24f 100755 (executable)
@@ -10,6 +10,7 @@ package eu.etaxonomy.taxeditor.ui.element;
 
 import java.util.ArrayList;
 import java.util.Comparator;
+import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -53,10 +54,9 @@ import org.joda.time.DateTime;
 import org.joda.time.Partial;
 import org.springframework.security.core.GrantedAuthority;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.common.DOI;
 import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.ORCID;
@@ -67,7 +67,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Credit;
 import eu.etaxonomy.cdm.model.common.ExtendedTimePeriod;
 import eu.etaxonomy.cdm.model.common.Extension;
-import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.cdm.model.common.LSID;
@@ -89,7 +88,6 @@ import eu.etaxonomy.cdm.model.description.KeyStatement;
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.description.QuantitativeData;
-import eu.etaxonomy.cdm.model.description.State;
 import eu.etaxonomy.cdm.model.description.StateData;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
@@ -127,13 +125,17 @@ import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.IEnumTerm;
 import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.model.term.TermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
+import eu.etaxonomy.cdm.persistence.dto.AnnotationDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
+import eu.etaxonomy.cdm.persistence.dto.ICdmBaseDto;
+import eu.etaxonomy.cdm.persistence.dto.MarkerDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -142,8 +144,9 @@ import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.InverseTermWrapper;
 import eu.etaxonomy.taxeditor.ui.combo.MisappliedRelationshipComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.RelationshipTypeCombo;
-import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.TermCollectionComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
+//import eu.etaxonomy.taxeditor.ui.combo.term.TermDtoComboElement;
 import eu.etaxonomy.taxeditor.ui.dialog.CloneClassificationDetailElement;
 import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
 import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
@@ -348,21 +351,25 @@ import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceAdvancedSection
 import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.reference.SecundumSourceDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.reference.SecundumSourceElement;
-import eu.etaxonomy.taxeditor.ui.section.reference.SecundumSourceSection;
 import eu.etaxonomy.taxeditor.ui.section.reference.SingleSourceSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationDtoElement;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseDtoElement;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseSection;
-
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CreditElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CreditSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.ExtensionElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.ExtensionSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.IdentifiableSourceElement;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerDtoElement;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsElement;
@@ -398,14 +405,14 @@ import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollection
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.PresenceAbsenceTermDetailElement;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierDtoVocabulariesElement;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesDtoCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesElement;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionElement;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionElement;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsDtoCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierDtoCollectionsElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateCollectionsDtoElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionElement;
@@ -901,41 +908,13 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     *
-     * @param parentElement
-     * @param labelString
-     * @param conversationEnabled
-     * @param user
-     * @param style
-     * @return
-     */
-    public EditPasswordElement createEditPasswordElement(ICdmFormElement parentElement, String labelString,
-            ConversationHolder conversation, User user, int style) {
-        EditPasswordElement element = new EditPasswordElement(this, parentElement, labelString, user, conversation);
+    public EditPasswordElement createEditPasswordElement(ICdmFormElement parentElement, String labelString, User user, int style) {
+        EditPasswordElement element = new EditPasswordElement(this, parentElement, labelString, user);
         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.
-     * @return a
-     *         {@link eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement}
-     *         object.
-     */
        public FloatWithLabelElement createFloatTextWithLabelElement(
                        ICdmFormElement parentElement, String labelString,
                        Number initialNumber, int style) {
@@ -970,23 +949,6 @@ public class CdmFormFactory extends FormToolkit {
         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.
-     */
     public KeyValueViewerElement createKeyValueViewerElement(ICdmFormElement parentElement, String keyHeading,
             String valueHeading, Map<Object, Object> map) {
         KeyValueViewerElement element = new KeyValueViewerElement(this, parentElement, keyHeading, valueHeading, map);
@@ -995,18 +957,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * @deprecated Use {@link #createDefinedTermComboElement(TermType, ICdmFormElement, String, DefinedTermBase, int)} instead
-     */
-    @Deprecated
-    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, true, style);
-        adapt(element);
-        parentElement.addElement(element);
-        return element;
-    }
-
     public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
             TermType termType,
             ICdmFormElement parentElement,
@@ -1053,7 +1003,7 @@ public class CdmFormFactory extends FormToolkit {
         return  this.createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, true, style, false, null);
     }
 
-       public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+       public <T extends DefinedTermBase<?>> TermComboElement<T> createDefinedTermComboElement(
             List<T> terms,
             ICdmFormElement parentElement,
             String labelString,
@@ -1061,8 +1011,16 @@ public class CdmFormFactory extends FormToolkit {
             int style) {
         return  this.createDefinedTermComboElement(null, null, terms, parentElement, labelString, selection, true, style, false, null);
     }
+//     public TermDtoComboElement createDefinedTermDtoComboElement(
+//            List<TermDto> terms,
+//            ICdmFormElement parentElement,
+//            String labelString,
+//            TermDto selection,
+//            int style) {
+//        return  this.createDefinedTermDtoComboElement(null, null, terms, parentElement, labelString, selection, false, style, false, null);
+//    }
 
-       public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
+       public <T extends DefinedTermBase<?>> TermComboElement<T> createDefinedTermComboElement(
                List<T> terms,
                ICdmFormElement parentElement,
                String labelString,
@@ -1082,7 +1040,17 @@ public class CdmFormFactory extends FormToolkit {
                        boolean useAbbrevLabel) {
                return createDefinedTermComboElement(termType, null, null, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
        }
-
+    
+//    public TermDtoComboElement createDefinedTermDtoComboElement(
+//            TermType termType,
+//            ICdmFormElement parentElement,
+//            String labelString,
+//            TermDto selection,
+//            boolean addEmptyElement,
+//            int style,
+//            boolean useAbbrevLabel) {
+//        return createDefinedTermDtoComboElement(termType, null, null, parentElement, labelString, selection, addEmptyElement, style, useAbbrevLabel, null);
+//    }
 
     public <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
             TermVocabulary<?> termVocabulary,
@@ -1117,13 +1085,13 @@ public class CdmFormFactory extends FormToolkit {
                Comparator<T> comparator) {
 
            if(termType!=null){
-               TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+               TermComboElement<T> element = new TermComboElement<>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
                adapt(element);
                parentElement.addElement(element);
                return element;
            }
-           else if(termVocabulary!=null){
-               TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termVocabulary, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+           else if(termVocabulary != null){
+               TermComboElement<T> element = new TermComboElement<>(this, parentElement, termVocabulary, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
 //             if (comparator!= null){
 //                     element.setTermComparator(comparator);
 //             }
@@ -1132,7 +1100,7 @@ public class CdmFormFactory extends FormToolkit {
                return element;
            }else if (terms != null){
 
-               TermComboElement<T> element = new TermComboElement<T>(this, parentElement, terms, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+               TermComboElement<T> element = new TermComboElement<>(this, parentElement, terms, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
 
             adapt(element);
             parentElement.addElement(element);
@@ -1143,6 +1111,45 @@ public class CdmFormFactory extends FormToolkit {
                return null;
            }
        }
+//     private TermDtoComboElement createDefinedTermDtoComboElement(
+//            TermType termType,
+//            TermVocabulary<?> termVocabulary,
+//            List<TermDto> terms,
+//            ICdmFormElement parentElement,
+//            String labelString,
+//            TermDto selection,
+//            boolean addEmptyElement,
+//            int style,
+//            boolean useAbbrevLabel,
+//            Comparator<TermDto> comparator) {
+//
+//        if(termType!=null){
+//            TermDtoComboElement element = new TermDtoComboElement<>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+//            adapt(element);
+//            parentElement.addElement(element);
+//            return element;
+//        }
+//        else if(termVocabulary != null){
+//            TermDtoComboElement element = new TermDtoComboElement<>(this, parentElement, termVocabulary, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+////          if (comparator!= null){
+////              element.setTermComparator(comparator);
+////          }
+//            adapt(element);
+//            parentElement.addElement(element);
+//            return element;
+//        }else if (terms != null){
+//
+//            TermDtoComboElement element = new TermDtoComboElement<>(this, parentElement, terms, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+//
+//            adapt(element);
+//            parentElement.addElement(element);
+//            return element;
+//        }
+//        else {
+//            //this should never happen
+//            return null;
+//        }
+//    }
 
           private <T extends DefinedTermBase> TermComboElement<T> createDefinedTermComboElement(
                    TermType termType,
@@ -1155,13 +1162,13 @@ public class CdmFormFactory extends FormToolkit {
                    int style,
                    boolean useAbbrevLabel,
                    Comparator<T> comparator) {
-               if(termType!=null){
-                   TermComboElement<T> element = new TermComboElement<T>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
+
+              if(termType!=null){
+                   TermComboElement<T> element = new TermComboElement<>(this, parentElement, termType, labelString, selection, addEmptyElement, style, useAbbrevLabel, comparator);
                    adapt(element);
                    parentElement.addElement(element);
                    return element;
                }
-
                else {
                    //this should never happen
                    return null;
@@ -1223,37 +1230,23 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-       public <TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>> VocabularyComboElement<TERM, VOC> createVocabularyComboElement(
+       public <TERM extends DefinedTermBase<TERM>, VOC extends TermCollection<TERM,?>> TermCollectionComboElement<TERM, VOC> createTermCollectionComboElement(
                TermType termType, String label, VOC selection, ICdmFormElement parentElement, int style) {
-           VocabularyComboElement<TERM, VOC> element = new VocabularyComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
+
+           TermCollectionComboElement<TERM, VOC> element = new TermCollectionComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
            adapt(element);
            parentElement.addElement(element);
            return element;
        }
 
-       public <TERM extends DefinedTermBase<TERM>, VOC extends TermVocabulary<TERM>> VocabularyComboElement<TERM, VOC> createVocabularyDtoComboElement(
-            TermType termType, String label, TermVocabularyDto selection, ICdmFormElement parentElement, int style) {
-        VocabularyComboElement<TERM, VOC> element = new VocabularyComboElement<TERM, VOC>(this, parentElement, termType, label, selection, style);
+       public <TERM extends DefinedTermBase<TERM>, VOC extends TermCollection<TERM,?>> TermCollectionComboElement<TERM, VOC> createTermCollectionDtoComboElement(
+            EnumSet<TermType> termTypes, String label, TermCollectionDto selection, ICdmFormElement parentElement, int style) {
+        TermCollectionComboElement<TERM, VOC> element = new TermCollectionComboElement<TERM, VOC>(this, parentElement, termTypes, label, selection, style);
         adapt(element);
         parentElement.addElement(element);
         return element;
     }
 
-    /**
-     * <p>
-     * createBrowserElement
-     * </p>
-     *
-     * @param imageUri
-     *            a {@link eu.etaxonomy.cdm.common.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);
@@ -1261,20 +1254,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * <p>
-     * createImageElement
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param imageUri
-     *            a {@link eu.etaxonomy.cdm.common.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);
@@ -1282,25 +1261,6 @@ public class CdmFormFactory extends FormToolkit {
         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) {
         TextActionElement element = new TextActionElement(this, parentElement, labelString, buttonLabel, initialText,
@@ -1310,23 +1270,6 @@ public class CdmFormFactory extends FormToolkit {
         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.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
-     *         object.
-     */
     public CheckboxElement createCheckbox(ICdmFormElement parentElement, String label, Boolean initialState, int style) {
         if(initialState==null){
             initialState = Boolean.FALSE;
@@ -1509,19 +1452,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    /**
-     * <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<TimePeriod> createDateDetailSection(ICdmFormElement parentElement, int style) {
         DateDetailSection<TimePeriod> section = new DateDetailSection<TimePeriod>(this, parentElement, false, style);
         parentElement.addElement(section);
@@ -1529,19 +1459,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    /**
-     * <p>
-     * createVerbatimDateDetailSection
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param style
-     *            a int.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.VerbatimDateDetailSection}
-     *         object.
-     */
     public DateDetailSection<VerbatimTimePeriod> createVerbatimDateDetailSection(ICdmFormElement parentElement, int style) {
         DateDetailSection<VerbatimTimePeriod> section
                = new DateDetailSection<VerbatimTimePeriod>(this, parentElement, true, style);
@@ -1550,19 +1467,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-       /**
-        * <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.MinMaxTextSection}
-        *         object.
-        */
        public MinMaxTextSection createMinMaxTextSection(ICdmFormElement parentElement, UnitType unitType, int style) {
                MinMaxTextSection section = new MinMaxTextSection(this, parentElement, unitType, style);
                parentElement.addElement(section);
@@ -1570,23 +1474,6 @@ public class CdmFormFactory extends FormToolkit {
                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.
-     * @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);
@@ -1603,26 +1490,10 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * <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) {
             MessagingUtils.error(this.getClass(),
@@ -1632,15 +1503,6 @@ public class CdmFormFactory extends FormToolkit {
         }
     }
 
-    /**
-     * <p>
-     * addPropertyChangeListener
-     * </p>
-     *
-     * @param listener
-     *            a {@link org.eclipse.jface.util.IPropertyChangeListener}
-     *            object.
-     */
     public void addPropertyChangeListener(IPropertyChangeListener listener) {
         if (propertyChangeListeners.contains(listener)) {
             return;
@@ -1648,61 +1510,20 @@ public class CdmFormFactory extends FormToolkit {
         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.
-     */
     public VersionElement createVersionElement(ICdmFormElement parentElement, VersionableEntity entity, int style) {
         VersionElement element = new VersionElement(this, parentElement, entity, style);
         adapt(element);
@@ -1710,12 +1531,6 @@ public class CdmFormFactory extends FormToolkit {
         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);
@@ -1723,50 +1538,33 @@ public class CdmFormFactory extends FormToolkit {
         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 CdmBaseDtoElement createCdmBaseDtoElement(ICdmFormElement parentElement, ICdmBaseDto entity, int style) {
+        CdmBaseDtoElement element = new CdmBaseDtoElement(this, parentElement, entity, style);
+        adapt(element);
+        parentElement.addElement(element);
+        return element;
+    }
+
     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;
     }
+    public CdmBaseDtoSection createCdmBaseDtoSection(ICdmFormElement parentElement, int style) {
+        CdmBaseDtoSection section = new CdmBaseDtoSection(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, String emptyText) {
         EmptyElement element = new EmptyElement(this, parentElement, emptyText, SWT.NULL);
         adapt(element);
@@ -1774,18 +1572,6 @@ public class CdmFormFactory extends FormToolkit {
         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) {
         HeadlineSection section = new HeadlineSection(this, parentElement, SWT.NULL);
         parentElement.addElement(section);
@@ -1793,23 +1579,13 @@ public class CdmFormFactory extends FormToolkit {
         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 HeadlineDtoSection createHeadlineDtoSection(ICdmFormElement parentElement) {
+        HeadlineDtoSection section = new HeadlineDtoSection(this, parentElement, SWT.NULL);
+        parentElement.addElement(section);
+        adapt(section);
+        return section;
+    }
+
     public ParsingMessageElement createParsingMessageElement(ICdmFormElement parentElement,
             ParserProblem parserProblem, int style) {
         ParsingMessageElement element = new ParsingMessageElement(this, parentElement, parserProblem, style);
@@ -1818,45 +1594,37 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public DefinedTermDetailSection createDefinedTermDetailSection(Class definedTermClass, ConversationHolder conversation,
+    public <T extends DefinedTermBase> DefinedTermDetailSection<T> createDefinedTermDetailSection(Class clazz,
             ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-
-        DefinedTermDetailSection section = new DefinedTermDetailSection(this, definedTermClass, conversation, parentElement,
+        @SuppressWarnings("unchecked")
+        Class<T> definedTermClass = clazz;
+        DefinedTermDetailSection<T> section = new DefinedTermDetailSection<>(this, definedTermClass, parentElement,
                 selectionProvider, style);
 
         parentElement.addElement(section);
         adapt(section);
         return section;
-
     }
 
-    public TermMediaSection createTermMediaSection(ConversationHolder conversation,
+    public TermMediaSection createTermMediaSection(
             ICdmFormElement parentElement, int style) {
-        TermMediaSection section = new TermMediaSection(this, conversation, parentElement, style);
+        TermMediaSection section = new TermMediaSection(this, parentElement, style);
         parentElement.addElement(section);
         adapt(section);
         return section;
-
     }
 
-    public DerivedUnitMediaSection createDerivedUnitMediaSection(ConversationHolder conversation,
+    public DerivedUnitMediaSection createDerivedUnitMediaSection(
             ICdmFormElement parentElement, int style) {
-        DerivedUnitMediaSection section = new DerivedUnitMediaSection(this, conversation, parentElement, style);
+        DerivedUnitMediaSection section = new DerivedUnitMediaSection(this, parentElement, style);
         parentElement.addElement(section);
         adapt(section);
         return section;
-
     }
 
-    /**
-     * @param definedTermClass
-     * @param formElement
-     * @param style
-     * @return
-     */
     public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass,
             ICdmFormElement parentElement, int style) {
-        AbstractCdmDetailElement element = null;
+        AbstractCdmDetailElement<?> element = null;
 
         if (NamedArea.class.isAssignableFrom(definedTermClass)) {
             element = new eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailElement(this, parentElement);
@@ -1867,35 +1635,34 @@ public class CdmFormFactory extends FormToolkit {
         } else if(definedTermClass.equals(Language.class)){
             element = new LanguageDetailElement(this, parentElement);
         } else {
-            element = new DefinedTermDetailElement(this, parentElement);
+            element = new DefinedTermDetailElement<>(this, parentElement);
         }
 
-
         adapt(element);
         parentElement.addElement(element);
         return element;
     }
 
-    public CharacterNodeDetailSection createCharacterNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        CharacterNodeDetailSection section = new CharacterNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public CharacterNodeDetailSection createCharacterNodeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterNodeDetailSection section = new CharacterNodeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CharacterNodeDtoDetailSection createCharacterNodeDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        CharacterNodeDtoDetailSection section = new CharacterNodeDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public CharacterNodeDtoDetailSection createCharacterNodeDtoDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterNodeDtoDetailSection section = new CharacterNodeDtoDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CharacterDetailSection createCharacterDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        CharacterDetailSection section = new CharacterDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public CharacterDetailSection createCharacterDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterDetailSection section = new CharacterDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CharacterDtoDetailSection createCharacterDtoDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        CharacterDtoDetailSection section = new CharacterDtoDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public CharacterDtoDetailSection createCharacterDtoDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        CharacterDtoDetailSection section = new CharacterDtoDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -1928,11 +1695,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * @param parentElement
-     * @param style
-     * @return
-     */
     public AbstractCdmDetailElement<TermTree> createFeatureTreeDetailElementForTree(
             AbstractCdmDetailSection<TermTree> parentElement, int style) {
         TermTreeDetailElementForNode element = new TermTreeDetailElementForNode(this, parentElement);
@@ -1948,43 +1710,48 @@ public class CdmFormFactory extends FormToolkit {
 
 
     //--------DetailSections---------
-    public NameDetailSection createNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        NameDetailSection section = new NameDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public NameDetailSection createNameDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NameDetailSection section = new NameDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TermNodeDetailSection createFeatureNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TermNodeDetailSection section = new TermNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TermNodeDetailSection createFeatureNodeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermNodeDetailSection section = new TermNodeDetailSection(this, parentElement, selectionProvider, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+    public TermNodeDetailSection createTermNodeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermNodeDetailSection section = new TermNodeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TermTreeDetailSection createFeatureTreeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TermTreeDetailSection section = new TermTreeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TermTreeDetailSection createFeatureTreeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermTreeDetailSection section = new TermTreeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public TermTreeDetailSectionForNode createFeatureTreeDetailSectionForTree(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TermTreeDetailSectionForNode section = new TermTreeDetailSectionForNode(this, conversation, parentElement, selectionProvider, style);
+    public TermTreeDetailSectionForNode createFeatureTreeDetailSectionForTree(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermTreeDetailSectionForNode section = new TermTreeDetailSectionForNode(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ReferenceDetailSection createReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        ReferenceDetailSection section = new ReferenceDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public ReferenceDetailSection createReferenceDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferenceDetailSection section = new ReferenceDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public NomenclaturalSourceDetailSection createNomenclaturalReferenceDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        NomenclaturalSourceDetailSection section = new NomenclaturalSourceDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public NomenclaturalSourceDetailSection createNomenclaturalReferenceDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NomenclaturalSourceDetailSection section = new NomenclaturalSourceDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public OriginalSourceAdvancedSection createOriginalSourceAdvancedSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        OriginalSourceAdvancedSection section = new OriginalSourceAdvancedSection(this, conversation, parentElement, selectionProvider, style);
+    public OriginalSourceAdvancedSection createOriginalSourceAdvancedSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        OriginalSourceAdvancedSection section = new OriginalSourceAdvancedSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -2001,322 +1768,316 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public SingleSourceSection createSingleSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, String label, int style){
-        SingleSourceSection section = new SingleSourceSection(this, conversation, parentElement, cdmEntity, selectionProvider, style, label);
+    public SingleSourceSection createSingleSourceSection(ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, String label, int style){
+        SingleSourceSection section = new SingleSourceSection(this, parentElement, cdmEntity, selectionProvider, style, label);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TaxonBaseDetailSection createTaxonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TaxonBaseDetailSection section = new TaxonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TaxonBaseDetailSection createTaxonBaseDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonBaseDetailSection section = new TaxonBaseDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-//    public SecundumSourceSection createSecundumDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-//     SecundumSourceSection section = new SecundumSourceSection(this, conversation, parentElement, selectionProvider, style);
-//        addAndAdaptSection(parentElement, section);
-//        return section;
-//    }
-
-    public AuthorshipDetailSection createAuthorshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        AuthorshipDetailSection section = new AuthorshipDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public AuthorshipDetailSection createAuthorshipDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AuthorshipDetailSection section = new AuthorshipDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TeamOrPersonBaseDetailSection createTeamOrPersonBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TeamOrPersonBaseDetailSection section = new TeamOrPersonBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TeamOrPersonBaseDetailSection createTeamOrPersonBaseDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TeamOrPersonBaseDetailSection section = new TeamOrPersonBaseDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TeamDetailSection createTeamDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        TeamDetailSection section = new TeamDetailSection(this, conversation, parentElement, null, style);
+    public TeamDetailSection createTeamDetailSection(ICdmFormElement parentElement, int style){
+        TeamDetailSection section = new TeamDetailSection(this, parentElement, null, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PersonDetailSection createPersonDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        PersonDetailSection section = new PersonDetailSection(this, conversation, parentElement, null, style);
+    public PersonDetailSection createPersonDetailSection(ICdmFormElement parentElement, int style){
+        PersonDetailSection section = new PersonDetailSection(this, parentElement, null, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DescriptionDetailSection createDescriptionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DescriptionDetailSection section = new DescriptionDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DescriptionDetailSection createDescriptionDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionDetailSection section = new DescriptionDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DescriptionElementDetailSection createDescriptionElementDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DescriptionElementDetailSection section = new DescriptionElementDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DescriptionElementDetailSection createDescriptionElementDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DescriptionElementDetailSection section = new DescriptionElementDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ParsingMessagesSection createParsingMessagesSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        ParsingMessagesSection section = new ParsingMessagesSection(this, conversation, parentElement, selectionProvider, style);
+    public ParsingMessagesSection createParsingMessagesSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ParsingMessagesSection section = new ParsingMessagesSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
 
 
-    public NonViralNameDetailSection createNonViralNameDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, boolean nameChoosable, int style){
-        NonViralNameDetailSection section = new NonViralNameDetailSection(this, conversation, parentElement, selectionProvider, nameChoosable, style);
+    public NonViralNameDetailSection createNonViralNameDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, boolean nameChoosable, int style){
+        NonViralNameDetailSection section = new NonViralNameDetailSection(this, parentElement, selectionProvider, nameChoosable, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MediaDetailsSection createMediaDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        MediaDetailsSection section = new MediaDetailsSection(this, conversation, parentElement, selectionProvider, style);
+    public MediaDetailsSection createMediaDetailsSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        MediaDetailsSection section = new MediaDetailsSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public FieldUnitFacadeDetailSection createFieldUnitFacadeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FieldUnitFacadeDetailSection section = new FieldUnitFacadeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public FieldUnitFacadeDetailSection createFieldUnitFacadeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldUnitFacadeDetailSection section = new FieldUnitFacadeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GatheringEventDetailSection createGatheringEventDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GatheringEventDetailSection section = new GatheringEventDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public GatheringEventDetailSection createGatheringEventDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DerivedUnitBaseDetailSection createDerivedUnitBaseDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DerivedUnitBaseDetailSection section = new DerivedUnitBaseDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DerivedUnitBaseDetailSection createDerivedUnitBaseDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitBaseDetailSection section = new DerivedUnitBaseDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DerivedUnitTypeDesignationSection createDerivedUnitTypeDesignationSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DerivedUnitTypeDesignationSection section = new DerivedUnitTypeDesignationSection(this, conversation, parentElement, style);
+    public DerivedUnitTypeDesignationSection createDerivedUnitTypeDesignationSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitTypeDesignationSection section = new DerivedUnitTypeDesignationSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TaxonAssociationDetailSection createTaxonAssociationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TaxonAssociationDetailSection section = new TaxonAssociationDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TaxonAssociationDetailSection createTaxonAssociationDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonAssociationDetailSection section = new TaxonAssociationDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public OriginalLabelDataSection createOriginalLabelDataSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        OriginalLabelDataSection section = new OriginalLabelDataSection(this, conversation, parentElement, selectionProvider, style);
+    public OriginalLabelDataSection createOriginalLabelDataSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        OriginalLabelDataSection section = new OriginalLabelDataSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public NaturalLanguageSection createNaturalLanguageSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        NaturalLanguageSection section = new NaturalLanguageSection(this, conversation, parentElement, selectionProvider, style);
+    public NaturalLanguageSection createNaturalLanguageSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NaturalLanguageSection section = new NaturalLanguageSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public FeatureDistributionDetailSection createFeatureDistributionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FeatureDistributionDetailSection section = new FeatureDistributionDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public FeatureDistributionDetailSection createFeatureDistributionDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FeatureDistributionDetailSection section = new FeatureDistributionDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ClassificationDetailSection createClassificationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        ClassificationDetailSection section = new ClassificationDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public ClassificationDetailSection createClassificationDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ClassificationDetailSection section = new ClassificationDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TaxonNodeDetailSection createTaxonNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TaxonNodeDetailSection section = new TaxonNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TaxonNodeDetailSection createTaxonNodeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonNodeDetailSection section = new TaxonNodeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PolytomousKeyDetailSection createPolytomousKeyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        PolytomousKeyDetailSection section = new PolytomousKeyDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public PolytomousKeyDetailSection createPolytomousKeyDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyDetailSection section = new PolytomousKeyDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PolytomousKeyNodeDetailSection createPolytomousKeyNodeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        PolytomousKeyNodeDetailSection section = new PolytomousKeyNodeDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public PolytomousKeyNodeDetailSection createPolytomousKeyNodeDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PolytomousKeyNodeDetailSection section = new PolytomousKeyNodeDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public InstitutionDetailSection createInstitutionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        InstitutionDetailSection section = new InstitutionDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public InstitutionDetailSection createInstitutionDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        InstitutionDetailSection section = new InstitutionDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public FieldUnitFacadeGeneralDetailSection createFieldUnitFacadeGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        FieldUnitFacadeGeneralDetailSection section = new FieldUnitFacadeGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public FieldUnitFacadeGeneralDetailSection createFieldUnitFacadeGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        FieldUnitFacadeGeneralDetailSection section = new FieldUnitFacadeGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DerivedUnitGeneralDetailSection createDerivedUnitGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DerivedUnitGeneralDetailSection section = new DerivedUnitGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DerivedUnitGeneralDetailSection createDerivedUnitGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DerivedUnitGeneralDetailSection section = new DerivedUnitGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PreservedSpecimenGeneralDetailSection createPreservedSpecimenGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        PreservedSpecimenGeneralDetailSection section = new PreservedSpecimenGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public PreservedSpecimenGeneralDetailSection createPreservedSpecimenGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        PreservedSpecimenGeneralDetailSection section = new PreservedSpecimenGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TissueSampleGeneralDetailSection createTissueSampleGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TissueSampleGeneralDetailSection section = new TissueSampleGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TissueSampleGeneralDetailSection createTissueSampleGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TissueSampleGeneralDetailSection section = new TissueSampleGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DnaSampleGeneralDetailSection createDnaSampleGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DnaSampleGeneralDetailSection section = new DnaSampleGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DnaSampleGeneralDetailSection createDnaSampleGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DnaSampleGeneralDetailSection section = new DnaSampleGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DnaSamplePreparationPreservationSection createDnaSamplePreparationPreservationSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DnaSamplePreparationPreservationSection section = new DnaSamplePreparationPreservationSection(this, conversation, parentElement, selectionProvider, style);
+    public DnaSamplePreparationPreservationSection createDnaSamplePreparationPreservationSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DnaSamplePreparationPreservationSection section = new DnaSamplePreparationPreservationSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DnaQualityDetailSection createDnaQualityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DnaQualityDetailSection section = new DnaQualityDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DnaQualityDetailSection createDnaQualityDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DnaQualityDetailSection section = new DnaQualityDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SequenceGeneralDetailSection createSequenceGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        SequenceGeneralDetailSection section = new SequenceGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public SequenceGeneralDetailSection createSequenceGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SequenceGeneralDetailSection section = new SequenceGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SequenceContigFileCollectionDetailSection createSequenceContigFileCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SequenceContigFileCollectionDetailSection section = new SequenceContigFileCollectionDetailSection(this, conversation, parentElement, style);
+    public SequenceContigFileCollectionDetailSection createSequenceContigFileCollectionDetailSection(ICdmFormElement parentElement, int style){
+        SequenceContigFileCollectionDetailSection section = new SequenceContigFileCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SingleReadPherogramCollectionDetailSection createSingleReadPherogramCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SingleReadPherogramCollectionDetailSection section = new SingleReadPherogramCollectionDetailSection(this, conversation, parentElement, style);
+    public SingleReadPherogramCollectionDetailSection createSingleReadPherogramCollectionDetailSection(ICdmFormElement parentElement, int style){
+        SingleReadPherogramCollectionDetailSection section = new SingleReadPherogramCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SequenceReferenceCollectionDetailSection createSequenceReferenceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SequenceReferenceCollectionDetailSection section = new SequenceReferenceCollectionDetailSection(this, conversation, parentElement, style);
+    public SequenceReferenceCollectionDetailSection createSequenceReferenceCollectionDetailSection(ICdmFormElement parentElement, int style){
+        SequenceReferenceCollectionDetailSection section = new SequenceReferenceCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SingleReadGeneralDetailSection createSingleReadGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        SingleReadGeneralDetailSection section = new SingleReadGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public SingleReadGeneralDetailSection createSingleReadGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SingleReadGeneralDetailSection section = new SingleReadGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public AmplificationGeneralDetailSection createAmplificationGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        AmplificationGeneralDetailSection section = new AmplificationGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public AmplificationGeneralDetailSection createAmplificationGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AmplificationGeneralDetailSection section = new AmplificationGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public AmplificationPrimerDetailSection createAmplificationPrimerDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        AmplificationPrimerDetailSection section = new AmplificationPrimerDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public AmplificationPrimerDetailSection createAmplificationPrimerDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AmplificationPrimerDetailSection section = new AmplificationPrimerDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public AmplificationCloningDetailSection createAmplificationCloningDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        AmplificationCloningDetailSection section = new AmplificationCloningDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public AmplificationCloningDetailSection createAmplificationCloningDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        AmplificationCloningDetailSection section = new AmplificationCloningDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public AmplificationGelPhotoCollectionDetailSection createAmplificationGelPhotoCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        AmplificationGelPhotoCollectionDetailSection section = new AmplificationGelPhotoCollectionDetailSection(this, conversation, parentElement, style);
+    public AmplificationGelPhotoCollectionDetailSection createAmplificationGelPhotoCollectionDetailSection(ICdmFormElement parentElement, int style){
+        AmplificationGelPhotoCollectionDetailSection section = new AmplificationGelPhotoCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MediaSpecimenGeneralDetailSection createMediaSpecimenGeneralDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        MediaSpecimenGeneralDetailSection section = new MediaSpecimenGeneralDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public MediaSpecimenGeneralDetailSection createMediaSpecimenGeneralDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        MediaSpecimenGeneralDetailSection section = new MediaSpecimenGeneralDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public HybridDetailSection createHybridDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        HybridDetailSection section = new HybridDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public HybridDetailSection createHybridDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        HybridDetailSection section = new HybridDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public UserDetailSection createUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        UserDetailSection section = new UserDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public UserDetailSection createUserDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UserDetailSection section = new UserDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GroupDetailSection createGroupDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        GroupDetailSection section = new GroupDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public GroupDetailSection createGroupDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GroupDetailSection section = new GroupDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DeterminationDetailSection createDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        DeterminationDetailSection section = new DeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public DeterminationDetailSection createDeterminationDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        DeterminationDetailSection section = new DeterminationDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SampleDesignationDetailSection createSampleDesignationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        SampleDesignationDetailSection section = new SampleDesignationDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public SampleDesignationDetailSection createSampleDesignationDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        SampleDesignationDetailSection section = new SampleDesignationDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, conversation, parentElement, selectionProvider, style, true);
+    public TaxonRelationshipDetailSection createTaxonRelationshipDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TaxonRelationshipDetailSection section = new TaxonRelationshipDetailSection(this, parentElement, selectionProvider, style, true);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ReferencedEntityDetailSection createReferencedEntityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        ReferencedEntityDetailSection section = new ReferencedEntityDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public ReferencedEntityDetailSection createReferencedEntityDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        ReferencedEntityDetailSection section = new ReferencedEntityDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TermVocabularyDetailSection createTermVocabularyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        TermVocabularyDetailSection section = new TermVocabularyDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public TermVocabularyDetailSection createTermVocabularyDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        TermVocabularyDetailSection section = new TermVocabularyDetailSection(this, 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);
+    public GatheringEventDetailSection createGatheringSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        GatheringEventDetailSection section = new GatheringEventDetailSection(this, 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);
+    public NamedAreaDetailSection createNamedAreaDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        NamedAreaDetailSection section = new NamedAreaDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public UseRecordDetailSection createUseRecordDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
-        UseRecordDetailSection section = new UseRecordDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public UseRecordDetailSection createUseRecordDetailSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+        UseRecordDetailSection section = new UseRecordDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -2363,12 +2124,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-//    public SecundumSourceDetailElement createSecundumSourceDetailElement(ICdmFormElement parentElement){
-//     SecundumSourceDetailElement element = new SecundumSourceDetailElement(this, parentElement);
-//        addAndAdaptElement(parentElement, element);
-//        return element;
-//    }
-
     public SecundumSourceElement createSecundumSourceElement(ICdmFormElement parentElement, CdmBase cdmEntity, String label){
         SecundumSourceElement element = new SecundumSourceElement(this, parentElement, cdmEntity, label);
         addAndAdaptElement(parentElement, element);
@@ -2434,8 +2189,8 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public TaxonNodeAgentRelationCollectionSection createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement, ConversationHolder conversation, int style){
-        TaxonNodeAgentRelationCollectionSection element = new TaxonNodeAgentRelationCollectionSection(this, conversation, parentElement, style);
+    public TaxonNodeAgentRelationCollectionSection createTaxonNodeAgentRelationCollectionElement(ICdmFormElement parentElement, int style){
+        TaxonNodeAgentRelationCollectionSection element = new TaxonNodeAgentRelationCollectionSection(this, parentElement, style);
         adapt(element);
         parentElement.addElement(element);
 
@@ -2682,350 +2437,356 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * @param parentElement
-     * @param element
-     */
     private void addAndAdaptElement(ICdmFormElement parentElement, AbstractCdmDetailElement<?> element) {
         adapt(element);
         parentElement.addElement(element);
     }
 
     //--------EntityCollectionSection----------
-    public TeamMemberSection createTeamMemberSection(ConversationHolder conversation, ICdmFormElement parentElement, int style, boolean isNomenclatural, boolean isCollector){
-        TeamMemberSection section = new TeamMemberSection(this, conversation, parentElement, style, isNomenclatural, isCollector);
+    public TeamMemberSection createTeamMemberSection(ICdmFormElement parentElement, int style, boolean isNomenclatural, boolean isCollector){
+        TeamMemberSection section = new TeamMemberSection(this, parentElement, style, isNomenclatural, isCollector);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+
+    public InapplicableIfEntityCollectionSection createInapplicableIfEntityCollectionSection(ICdmFormElement parentElement, int style){
+        InapplicableIfEntityCollectionSection section = new InapplicableIfEntityCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public InapplicableIfEntityCollectionSection createInapplicableIfEntityCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        InapplicableIfEntityCollectionSection section = new InapplicableIfEntityCollectionSection(this, conversation, parentElement, style);
+    public OnlyApplicableIfEntityCollectionSection createOnlyApplicableIfEntityCollectionSection(ICdmFormElement parentElement, int style){
+        OnlyApplicableIfEntityCollectionSection section = new OnlyApplicableIfEntityCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public OnlyApplicableIfEntityCollectionSection createOnlyApplicableIfEntityCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        OnlyApplicableIfEntityCollectionSection section = new OnlyApplicableIfEntityCollectionSection(this, conversation, parentElement, style);
+    public InapplicableIfEntityCollectionSectionForNode createInapplicableIfEntityCollectionSectionForNode(ICdmFormElement parentElement, int style){
+        InapplicableIfEntityCollectionSectionForNode section = new InapplicableIfEntityCollectionSectionForNode(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public InapplicableIfEntityCollectionSectionForNode createInapplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        InapplicableIfEntityCollectionSectionForNode section = new InapplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+    public OnlyApplicableIfEntityCollectionSectionForNode createOnlyApplicableIfEntityCollectionSectionForNode(ICdmFormElement parentElement, int style){
+        OnlyApplicableIfEntityCollectionSectionForNode section = new OnlyApplicableIfEntityCollectionSectionForNode(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public OnlyApplicableIfEntityCollectionSectionForNode createOnlyApplicableIfEntityCollectionSectionForNode(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        OnlyApplicableIfEntityCollectionSectionForNode section = new OnlyApplicableIfEntityCollectionSectionForNode(this, conversation, parentElement, style);
+    public AnnotationSection createAnnotationSection(ICdmFormElement parentElement, int style){
+        AnnotationSection section = new AnnotationSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public AnnotationSection createAnnotationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        AnnotationSection section = new AnnotationSection(this, conversation, parentElement, style);
+    public AnnotationDtoSection createAnnotationDtoSection(ICdmFormElement parentElement, int style){
+        AnnotationDtoSection section = new AnnotationDtoSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CreditSection createCreditSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        CreditSection section = new CreditSection(this, conversation, parentElement, style);
+    public CreditSection createCreditSection(ICdmFormElement parentElement, int style){
+        CreditSection section = new CreditSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, style);
+    public DescriptionElementSourceSection createDescriptionElementSourceSection(ICdmFormElement parentElement, int style){
+        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, Reference defaultSource, int style){
-        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, defaultSource, style);
+    public DescriptionElementSourceSection createDescriptionElementSourceSection(ICdmFormElement parentElement, Reference defaultSource, int style){
+        DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, parentElement, defaultSource, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ExtensionSection createExtensionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ExtensionSection section = new ExtensionSection(this, conversation, parentElement, style);
+    public ExtensionSection createExtensionSection(ICdmFormElement parentElement, int style){
+        ExtensionSection section = new ExtensionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MarkerSection createMarkerSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MarkerSection section = new MarkerSection(this, conversation, parentElement, style);
+    public MarkerSection createMarkerSection(ICdmFormElement parentElement, int style){
+        MarkerSection section = new MarkerSection(this, parentElement, style);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+    public MarkerDtoSection createMarkerDtoSection(ICdmFormElement parentElement, int style){
+        MarkerDtoSection section = new MarkerDtoSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MediaSection createMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MediaSection section = new MediaSection(this, conversation, parentElement, style);
+    public MediaSection createMediaSection(ICdmFormElement parentElement, int style){
+        MediaSection section = new MediaSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DescriptionElementMediaSection createDescriptionElementMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        DescriptionElementMediaSection section = new DescriptionElementMediaSection(this, conversation, parentElement, style);
+    public DescriptionElementMediaSection createDescriptionElementMediaSection(ICdmFormElement parentElement, int style){
+        DescriptionElementMediaSection section = new DescriptionElementMediaSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MediaRepresentationSection createMediaRepresentationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MediaRepresentationSection section = new MediaRepresentationSection(this, conversation, parentElement, style);
+    public MediaRepresentationSection createMediaRepresentationSection(ICdmFormElement parentElement, int style){
+        MediaRepresentationSection section = new MediaRepresentationSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MediaRepresentationPartSection createMediaRepresentationPartSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MediaRepresentationPartSection section = new MediaRepresentationPartSection(this, conversation, parentElement, style);
+    public MediaRepresentationPartSection createMediaRepresentationPartSection(ICdmFormElement parentElement, int style){
+        MediaRepresentationPartSection section = new MediaRepresentationPartSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ModifierSection createModifierSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ModifierSection section = new ModifierSection(this, conversation, parentElement, style);
+    public ModifierSection createModifierSection(ICdmFormElement parentElement, int style){
+        ModifierSection section = new ModifierSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public NomenclaturalStatusSection createNomenclaturalStatusSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        NomenclaturalStatusSection section = new NomenclaturalStatusSection(this, conversation, parentElement, style);
+    public NomenclaturalStatusSection createNomenclaturalStatusSection(ICdmFormElement parentElement, int style){
+        NomenclaturalStatusSection section = new NomenclaturalStatusSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public NameRelationshipDetailSection createNameRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        NameRelationshipDetailSection section = new NameRelationshipDetailSection(this, conversation, parentElement, style);
+    public NameRelationshipDetailSection createNameRelationshipDetailSection(ICdmFormElement parentElement, int style){
+        NameRelationshipDetailSection section = new NameRelationshipDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-//    public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-//        ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style);
-//        addAndAdaptSection(parentElement, section);
-//        return section;
-//    }
-    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, style);
+    public ExternalLinksSection createExternalLinksSection(ICdmFormElement parentElement, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, String label, int style){
-        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, true, label, style);
+    public ExternalLinksSection createExternalLinksSection(ICdmFormElement parentElement, String label, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, parentElement, true, label, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ExternalLinksSection createExternalLinksSection(ConversationHolder conversation, ICdmFormElement parentElement, String label, boolean isWithTypeAndDesc, int style){
-        ExternalLinksSection section = new ExternalLinksSection(this, conversation, parentElement, isWithTypeAndDesc, label, style);
+    public ExternalLinksSection createExternalLinksSection(ICdmFormElement parentElement, String label, boolean isWithTypeAndDesc, int style){
+        ExternalLinksSection section = new ExternalLinksSection(this, parentElement, isWithTypeAndDesc, label, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public RightsSection createRightsSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        RightsSection section = new RightsSection(this, conversation, parentElement, style);
+    public RightsSection createRightsSection(ICdmFormElement parentElement, int style){
+        RightsSection section = new RightsSection(this, parentElement, style);
 
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SourceSection createSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SourceSection section = new SourceSection(this, conversation, parentElement, style);
+    public SourceSection createSourceSection(ICdmFormElement parentElement, int style){
+        SourceSection section = new SourceSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ScopeSection createScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ScopeSection section = new ScopeSection(this, conversation, parentElement, style);
+    public ScopeSection createScopeSection(ICdmFormElement parentElement, int style){
+        ScopeSection section = new ScopeSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DescriptionSourceSection createDescriptionSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        DescriptionSourceSection section = new DescriptionSourceSection(this, conversation, parentElement, style);
+    public DescriptionSourceSection createDescriptionSourceSection(ICdmFormElement parentElement, int style){
+        DescriptionSourceSection section = new DescriptionSourceSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TypeDesignationSection createTypeDesignationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        TypeDesignationSection section = new TypeDesignationSection(this, conversation, parentElement, style);
+    public TypeDesignationSection createTypeDesignationSection(ICdmFormElement parentElement, int style){
+        TypeDesignationSection section = new TypeDesignationSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public StateDataSection createStateDataSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StateDataSection section = new StateDataSection(this, conversation, parentElement, style);
+    public StateDataSection createStateDataSection(ICdmFormElement parentElement, int style){
+        StateDataSection section = new StateDataSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public StatisticalMeasurementValueSection createStatisticalMeasurementValueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StatisticalMeasurementValueSection section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style);
+    public StatisticalMeasurementValueSection createStatisticalMeasurementValueSection(ICdmFormElement parentElement, int style){
+        StatisticalMeasurementValueSection section = new StatisticalMeasurementValueSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DescribedSpecimenSection createDescribedSpecimenSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        DescribedSpecimenSection section = new DescribedSpecimenSection(this, conversation, parentElement, style);
+    public DescribedSpecimenSection createDescribedSpecimenSection(ICdmFormElement parentElement, int style){
+        DescribedSpecimenSection section = new DescribedSpecimenSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public StateVocabularyCollectionSection createStateVocabulariesSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StateVocabularyCollectionSection section = new StateVocabularyCollectionSection(this, conversation, parentElement, style);
+    public RecommendedStateCollectionSection createStateVocabulariesSection(ICdmFormElement parentElement, int style){
+        RecommendedStateCollectionSection section = new RecommendedStateCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-
-    public StateVocabularyDtoCollectionSection createStateVocabulariesDtoSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StateVocabularyDtoCollectionSection section = new StateVocabularyDtoCollectionSection(this, conversation, parentElement, style);
+    public RecommendedStateCollectionSection createStateVocabulariesSection(ICdmFormElement parentElement, int style, Integer maxStates){
+        RecommendedStateCollectionSection section = new RecommendedStateCollectionSection(this, parentElement, style, maxStates);
+        addAndAdaptSection(parentElement, section);
+        return section;
+    }
+    public RecommendedStateDtoCollectionSection createStateVocabulariesDtoSection(ICdmFormElement parentElement, int style){
+        RecommendedStateDtoCollectionSection section = new RecommendedStateDtoCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public RecommendedModifierVocabulariesCollectionSection createRecommendedModifierVocabulariesCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        RecommendedModifierVocabulariesCollectionSection section = new RecommendedModifierVocabulariesCollectionSection(this, conversation, parentElement, style);
+    public RecommendedModifierCollectionsCollectionSection createRecommendedModifierVocabulariesCollectionSection(ICdmFormElement parentElement, int style){
+        RecommendedModifierCollectionsCollectionSection section = new RecommendedModifierCollectionsCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public RecommendedModifierVocabulariesDtoCollectionSection createRecommendedModifierVocabulariesDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        RecommendedModifierVocabulariesDtoCollectionSection section = new RecommendedModifierVocabulariesDtoCollectionSection(this, conversation, parentElement, style);
+    public RecommendedModifierCollectionsDtoCollectionSection createRecommendedModifierVocabulariesDtoCollectionSection(ICdmFormElement parentElement, int style){
+        RecommendedModifierCollectionsDtoCollectionSection section = new RecommendedModifierCollectionsDtoCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MeasurementUnitCollectionSection createMeasurementUnitCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MeasurementUnitCollectionSection section = new MeasurementUnitCollectionSection(this, conversation, parentElement, style);
+    public MeasurementUnitCollectionSection createMeasurementUnitCollectionSection(ICdmFormElement parentElement, int style){
+        MeasurementUnitCollectionSection section = new MeasurementUnitCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MeasurementUnitDtoCollectionSection createMeasurementUnitDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MeasurementUnitDtoCollectionSection section = new MeasurementUnitDtoCollectionSection(this, conversation, parentElement, style);
+    public MeasurementUnitDtoCollectionSection createMeasurementUnitDtoCollectionSection(ICdmFormElement parentElement, int style){
+        MeasurementUnitDtoCollectionSection section = new MeasurementUnitDtoCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
-    public StatisticalMeasureCollectionSection createStatisticalMeasureCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StatisticalMeasureCollectionSection section = new StatisticalMeasureCollectionSection(this, conversation, parentElement, style);
+    public StatisticalMeasureCollectionSection createStatisticalMeasureCollectionSection(ICdmFormElement parentElement, int style){
+        StatisticalMeasureCollectionSection section = new StatisticalMeasureCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public StatisticalMeasureDtoCollectionSection createStatisticalMeasureDtoCollectionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StatisticalMeasureDtoCollectionSection section = new StatisticalMeasureDtoCollectionSection(this, conversation, parentElement, style);
+    public StatisticalMeasureDtoCollectionSection createStatisticalMeasureDtoCollectionSection(ICdmFormElement parentElement, int style){
+        StatisticalMeasureDtoCollectionSection section = new StatisticalMeasureDtoCollectionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style);
+    public CollectingAreasDetailSection createCollectingAreasDetailSection(ICdmFormElement parentElement, int style){
+        CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GeoScopeDetailSection createGeoScopeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        GeoScopeDetailSection section = new GeoScopeDetailSection(this, conversation, parentElement, style);
+    public GeoScopeDetailSection createGeoScopeDetailSection(ICdmFormElement parentElement, int style){
+        GeoScopeDetailSection section = new GeoScopeDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GeoScopePolyKeyDetailSection createGeoScopePolyKeyDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        GeoScopePolyKeyDetailSection section = new GeoScopePolyKeyDetailSection(this, conversation, parentElement, style);
+    public GeoScopePolyKeyDetailSection createGeoScopePolyKeyDetailSection(ICdmFormElement parentElement, int style){
+        GeoScopePolyKeyDetailSection section = new GeoScopePolyKeyDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public IdentifierSection createIdentifierDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        IdentifierSection section = new IdentifierSection(this, conversation, parentElement, style);
+    public IdentifierSection createIdentifierDetailSection(ICdmFormElement parentElement, int style){
+        IdentifierSection section = new IdentifierSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DerivedUnitFacadeIdentifierSection createDerivedUnitFacadeIdentifierSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-       DerivedUnitFacadeIdentifierSection section = new DerivedUnitFacadeIdentifierSection(this, conversation, parentElement, style);
+    public DerivedUnitFacadeIdentifierSection createDerivedUnitFacadeIdentifierSection(ICdmFormElement parentElement, int style){
+       DerivedUnitFacadeIdentifierSection section = new DerivedUnitFacadeIdentifierSection(this, parentElement, style);
        addAndAdaptSection(parentElement, section);
        return section;
     }
 
-    public CurrentSampleDesignationDetailSection createCurrentSampleDesignationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        CurrentSampleDesignationDetailSection section = new CurrentSampleDesignationDetailSection(this, conversation, parentElement, style);
+    public CurrentSampleDesignationDetailSection createCurrentSampleDesignationDetailSection(ICdmFormElement parentElement, int style){
+        CurrentSampleDesignationDetailSection section = new CurrentSampleDesignationDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public CurrentDeterminationDetailSection createCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        CurrentDeterminationDetailSection section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style);
+    public CurrentDeterminationDetailSection createCurrentDeterminationDetailSection(ICdmFormElement parentElement, int style){
+        CurrentDeterminationDetailSection section = new CurrentDeterminationDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PreservedSpecimenCurrentDeterminationDetailSection createPreservedSpecimenCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        PreservedSpecimenCurrentDeterminationDetailSection section = new PreservedSpecimenCurrentDeterminationDetailSection(this, conversation, parentElement, style);
+    public PreservedSpecimenCurrentDeterminationDetailSection createPreservedSpecimenCurrentDeterminationDetailSection(ICdmFormElement parentElement, int style){
+        PreservedSpecimenCurrentDeterminationDetailSection section = new PreservedSpecimenCurrentDeterminationDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SampleDesignationHistoryDetailSection createSampleDesignationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SampleDesignationHistoryDetailSection section = new SampleDesignationHistoryDetailSection(this, conversation, parentElement, style);
+    public SampleDesignationHistoryDetailSection createSampleDesignationHistoryDetailSection(ICdmFormElement parentElement, int style){
+        SampleDesignationHistoryDetailSection section = new SampleDesignationHistoryDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
+    public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ICdmFormElement parentElement, int style){
+        DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style);
+    public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ICdmFormElement parentElement, int style){
+        SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public PreservedSpecimenSourceCollectionDetailSection createPreservedSpecimenSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        PreservedSpecimenSourceCollectionDetailSection section = new PreservedSpecimenSourceCollectionDetailSection(this, conversation, parentElement, style);
+    public PreservedSpecimenSourceCollectionDetailSection createPreservedSpecimenSourceCollectionDetailSection(ICdmFormElement parentElement, int style){
+        PreservedSpecimenSourceCollectionDetailSection section = new PreservedSpecimenSourceCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public SourceCollectionDetailSection createSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        SourceCollectionDetailSection section = new SourceCollectionDetailSection(this, conversation, parentElement, style);
+    public SourceCollectionDetailSection createSourceCollectionDetailSection(ICdmFormElement parentElement, int style){
+        SourceCollectionDetailSection section = new SourceCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public StatusCollectionDetailSection createStatusCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        StatusCollectionDetailSection section = new StatusCollectionDetailSection(this, conversation, parentElement, style);
+    public StatusCollectionDetailSection createStatusCollectionDetailSection(ICdmFormElement parentElement, int style){
+        StatusCollectionDetailSection section = new StatusCollectionDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public ScopeRestrictionSection createScopeRestrictionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        ScopeRestrictionSection section = new ScopeRestrictionSection(this, conversation, parentElement, style);
+    public ScopeRestrictionSection createScopeRestrictionSection(ICdmFormElement parentElement, int style){
+        ScopeRestrictionSection section = new ScopeRestrictionSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public MemberDetailSection createMemberDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        MemberDetailSection section = new MemberDetailSection(this, conversation, parentElement, style);
+    public MemberDetailSection createMemberDetailSection(ICdmFormElement parentElement, int style){
+        MemberDetailSection section = new MemberDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GrantedAuthorityDetailSection createGrantedAuthorityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        GrantedAuthorityDetailSection section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style);
+    public GrantedAuthorityDetailSection createGrantedAuthorityDetailSection(ICdmFormElement parentElement, int style){
+        GrantedAuthorityDetailSection section = new GrantedAuthorityDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public GroupsByUserDetailSection createGroupsByUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        GroupsByUserDetailSection section = new GroupsByUserDetailSection(this, conversation, parentElement, style);
+    public GroupsByUserDetailSection createGroupsByUserDetailSection(ICdmFormElement parentElement, int style){
+        GroupsByUserDetailSection section = new GroupsByUserDetailSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    public TaxonomicScopeSection createTaxonomicScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
-        TaxonomicScopeSection section = new TaxonomicScopeSection(this, conversation, parentElement, style);
+    public TaxonomicScopeSection createTaxonomicScopeSection(ICdmFormElement parentElement, int style){
+        TaxonomicScopeSection section = new TaxonomicScopeSection(this, parentElement, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
@@ -3038,6 +2799,8 @@ public class CdmFormFactory extends FormToolkit {
 
         if (entity instanceof Annotation) {
             element = new AnnotationElement(this, parentElement, (Annotation) entity, removeListener, style);
+        }else if (entity instanceof AnnotationDto) {
+            element = new AnnotationDtoElement(this, parentElement, (AnnotationDto) entity, removeListener, style);
         }else if (entity instanceof Person ) {
             boolean isNomenclatural = false;
             if (parentElement instanceof TeamMemberSection){
@@ -3060,6 +2823,8 @@ public class CdmFormFactory extends FormToolkit {
             element = new ExternalLinksElement(this, parentElement, (ExternalLink) entity, isAdvanced, removeListener, style);
         } else if (entity instanceof Marker) {
             element = new MarkerElement(this, parentElement, (Marker) entity, removeListener, style);
+        } else if (entity instanceof MarkerDto) {
+            element = new MarkerDtoElement(this, parentElement, (MarkerDto) entity, removeListener, style);
         } else if (entity instanceof TaxonNodeAgentRelation) {
             element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity, removeListener, backgroundColor, style);
         }else if (entity instanceof Media) {
@@ -3194,37 +2959,63 @@ public class CdmFormFactory extends FormToolkit {
             else{
                 element = new IdentifierElement(this, parentElement, (Identifier) entity, removeListener, style);
             }
-        } else if (entity instanceof TermVocabulary) {
-            TermVocabulary<?> termVocabulary = (TermVocabulary<?>)entity;
-            switch (termVocabulary.getTermType()) {
+        } else if (entity instanceof TermCollection) {
+            TermCollection<DefinedTermBase,?> termCollection = (TermCollection<DefinedTermBase,?>)entity;
+            switch (termCollection.getTermType()) {
+            case Structure:
             case State:
-                element = new StateVocabularyCollectionElement(this, parentElement, (TermVocabulary<State>) entity, removeListener, backgroundColor, style);
+                element = new RecommendedStateCollectionElement<>(this, parentElement, termCollection, removeListener, backgroundColor, style);
                 break;
             case Modifier:
-                element = new RecommendedModifierVocabulariesElement(this, parentElement, (TermVocabulary<DefinedTerm>) entity, removeListener, backgroundColor, style);
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
+                break;
+            case DeterminationModifier:
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
+                break;
+            case KindOfUnit:
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
+                break;
+            case Scope:
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
+                break;
+            case Sex:
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
+                break;
+            case Stage:
+                element = new RecommendedModifierCollectionsElement(this, parentElement, (TermCollection)termCollection, removeListener, backgroundColor, style);
                 break;
             default:
                 break;
             }
-        }else if (entity instanceof TermVocabularyDto) {
-            TermVocabularyDto termVocabulary = (TermVocabularyDto)entity;
-            switch (termVocabulary.getTermType()) {
+        }else if (entity instanceof TermCollectionDto) {
+            TermCollectionDto termCollectionDto = (TermCollectionDto)entity;
+            TermType type = termCollectionDto.getTermType();    
+            if (type.isKindOf(TermType.Modifier)) {
+                type = TermType.Modifier;
+            }
+            switch (type) {
             case State:
-                element = new StateVocabularyDtoCollectionElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+                element = new RecommendedStateCollectionsDtoElement<>(this, parentElement, termCollectionDto, removeListener, backgroundColor, style);
                 break;
-            case Modifier:
-                element = new RecommendedModifierDtoVocabulariesElement(this, parentElement, termVocabulary, removeListener, backgroundColor, style);
+            case Structure:
+                element = new RecommendedStateCollectionsDtoElement<>(this, parentElement, termCollectionDto, removeListener, backgroundColor, style);
                 break;
+            case Modifier:
+                element = new RecommendedModifierDtoCollectionsElement(this, parentElement, termCollectionDto, removeListener, backgroundColor, style);
+                break;           
             default:
+                
                 break;
             }
         }else if (entity instanceof MeasurementUnit) {
             element = new MeasurementUnitCollectionElement(this, parentElement, (MeasurementUnit) entity, removeListener, backgroundColor, style);
         }else if (entity instanceof TermDto) {
-            if(((TermDto)entity).getTermType().equals(TermType.MeasurementUnit)){
-                element = new MeasurementUnitDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
-            }else if (((TermDto)entity).getTermType().equals(TermType.StatisticalMeasure)){
-                element = new StatisticalMeasureDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+            if (((TermDto)entity).getTermType() != null) {
+                if(((TermDto)entity).getTermType().equals(TermType.MeasurementUnit)){
+                    element = new MeasurementUnitDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+                }else if (((TermDto)entity).getTermType().equals(TermType.StatisticalMeasure)){
+                    element = new StatisticalMeasureDtoCollectionElement(this, parentElement, (TermDto) entity, removeListener, backgroundColor, style);
+                } 
             }
         }else if (entity instanceof StatisticalMeasure) {
             element = new StatisticalMeasureCollectionElement(this, parentElement, (StatisticalMeasure) entity, removeListener, backgroundColor, style);
@@ -3271,7 +3062,7 @@ public class CdmFormFactory extends FormToolkit {
                     this,
                     String.format("Could not generate collection element for entity of class %s."
                             + " Looks like the case is not yet handled. Check implementation.\n"
-                            + "Entity: %s", entity.getClass(), entity.toString()), null);
+                            + "Entity: %s", entity.getClass().getName(), entity.toString()), null);
         }
 
         else{
@@ -3293,29 +3084,13 @@ public class CdmFormFactory extends FormToolkit {
      * <strong>Selection elements not handled by this method:</strong>
      * <ul>
      * <li>{@link TaxonNodeSelectionElement} see
-     * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
+     * {@link #createTaxonNodeSelectionElement(ICdmFormElement, String, TaxonNode, int, int)}
      * </li>
      * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
-     * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
+     * {@link #createNomenclaturalAuthorTeamSelectionElement(ICdmFormElement, String, Team, int, int)}
      * </li>
      * </ul>
      * </p>
-     *
-     * @param clazz
-     *            a {@link Class} object of the type that you want the selection
-     *            element to handle
-     * @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.
-     * @return a {@link EntitySelectionElement} object.
      */
     public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
             ICdmFormElement parentElement, String labelString, T selection, int mode,
@@ -3331,7 +3106,7 @@ public class CdmFormFactory extends FormToolkit {
     public <T extends CdmBase> EntitySelectionElement<T> createSelectionElement(Class<T> clazz,
             ICdmFormElement parentElement, String labelString, T selection, int mode,
             int style, boolean filterElement) {
-        EntitySelectionElement<T> element = new EntitySelectionElement<T>(this, //conversation,
+        EntitySelectionElement<T> element = new EntitySelectionElement<T>(this,
                 parentElement, clazz,
                 labelString, selection, mode, style, filterElement);
         adapt(element);
@@ -3340,7 +3115,6 @@ public class CdmFormFactory extends FormToolkit {
     }
 
     public <T extends CdmBase> 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,
@@ -3350,6 +3124,7 @@ public class CdmFormFactory extends FormToolkit {
         parentElement.addElement(element);
         return element;
     }
+
     public CollectorSelectionElement createCollectorSelectionElement(ICdmFormElement parentElement, String labelString, AgentBase selection, int mode,
           int style) {
        CollectorSelectionElement element = new CollectorSelectionElement(this, parentElement,
@@ -3385,34 +3160,18 @@ public class CdmFormFactory extends FormToolkit {
      * <strong>Selection elements not handled by this method:</strong>
      * <ul>
      * <li>{@link TaxonNodeSelectionElement} see
-     * {@link #createTaxonNodeSelectionElement(ConversationHolder, ICdmFormElement, String, TaxonNode, int, int)}
+     * {@link #createTaxonNodeSelectionElement(ICdmFormElement, String, TaxonNode, int, int)}
      * </li>
      * <li>{@link NomenclaturalAuthorTeamSelectionElement} see
-     * {@link #createNomenclaturalAuthorTeamSelectionElement(ConversationHolder, ICdmFormElement, String, Team, int, int)}
+     * {@link #createNomenclaturalAuthorTeamSelectionElement(ICdmFormElement, String, Team, int, int)}
      * </li>
      * </ul>
      * </p>
-     *
-     * @param clazz
-     *            a {@link Class} object of the type that you want the selection
-     *            element to handle
-     * @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.
-     * @return a {@link EntitySelectionElement} object.
      */
     public <T extends CdmBase> EntitySelectionElementWithAbbreviatedTitle<T> createSelectionElementWithAbbreviatedTitle(
-            Class<T> clazz, ConversationHolder conversation, ICdmFormElement parentElement, String labelString,
+            Class<T> clazz, ICdmFormElement parentElement, String labelString,
             T selection, int mode, int style) {
-        EntitySelectionElementWithAbbreviatedTitle<T> element = new EntitySelectionElementWithAbbreviatedTitle<T>(this, //conversation,
+        EntitySelectionElementWithAbbreviatedTitle<T> element = new EntitySelectionElementWithAbbreviatedTitle<T>(this,
                 parentElement, clazz,
                 labelString, selection, mode, style);
         adapt(element);
@@ -3420,7 +3179,7 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
+    public TaxonNodeSelectionElement createTaxonNodeSelectionElement(
             ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style) {
         TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this,
                 parentElement,
@@ -3429,9 +3188,10 @@ public class CdmFormFactory extends FormToolkit {
         parentElement.addElement(element);
         return element;
     }
-    public TaxonNodeSelectionElement createTaxonNodeSelectionElement(ConversationHolder conversation,
+
+    public TaxonNodeSelectionElement createTaxonNodeSelectionElement(
             ICdmFormElement parentElement, String labelString, TaxonNode selection, int mode, int style, Integer limit) {
-        TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this, //conversation,
+        TaxonNodeSelectionElement element = new TaxonNodeSelectionElement(this,
                 parentElement,
                 labelString, selection, mode, style, limit);
         adapt(element);
@@ -3439,18 +3199,16 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-
 //    public NomenclaturalAuthorTeamSelectionElement createNomenclaturalAuthorTeamSelectionElement(
-//            ConversationHolder conversation, ICdmFormElement parentElement, String labelString, Team selection,
+//            ICdmFormElement parentElement, String labelString, Team selection,
 //            int mode, int style) {
 //        NomenclaturalAuthorTeamSelectionElement element = new NomenclaturalAuthorTeamSelectionElement(this,
-//                conversation, parentElement, labelString, selection, mode, style);
+//                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);
@@ -3458,8 +3216,6 @@ public class CdmFormFactory extends FormToolkit {
         return labelElement;
     }
 
-
-
 //    public DateElementFormElement createDateElementForm(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
 //        Label label = new Label(formElement.getLayoutComposite(), style);
 //        label.setText(labelText+" (yyyy-MM-dd)");
@@ -3479,38 +3235,13 @@ public class CdmFormFactory extends FormToolkit {
          return dateElement;
     }
 
-    /**
-     * <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(
+    public AbstractDetailedDescriptionDetailElement<?> createDetailedDescriptionDetailElement(
             ICdmFormElement parentElement, DescriptionElementBase entity, int style, boolean enabled) {
-        AbstractDetailedDescriptionDetailElement detailedDescriptionElement = null;
+        AbstractDetailedDescriptionDetailElement<?> detailedDescriptionElement = null;
 
         if (entity instanceof CategoricalData) {
             detailedDescriptionElement = new CategoricalDataDetailElement(this, parentElement,
@@ -3544,20 +3275,8 @@ public class CdmFormFactory extends FormToolkit {
         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) {
@@ -3569,26 +3288,19 @@ public class CdmFormFactory extends FormToolkit {
         return text;
     }
 
-    public PreservedSpecimenDetailSection createPreservedSpecimenDetailsSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-        PreservedSpecimenDetailSection section = new PreservedSpecimenDetailSection(this, conversation, parentElement, selectionProvider, style);
+    public PreservedSpecimenDetailSection createPreservedSpecimenDetailsSection(ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+        PreservedSpecimenDetailSection section = new PreservedSpecimenDetailSection(this, parentElement, selectionProvider, style);
         addAndAdaptSection(parentElement, section);
         return section;
     }
 
-    /**
-     * @param formElement
-     * @param conversationHolder
-     * @param style
-     * @return
-     */
     public TaxonNodeAgentRelationCollectionSection createTaxonNodeAgentRelationCollectionSection(
-            ICdmFormElement formElement, ConversationHolder conversationHolder, int style) {
-        TaxonNodeAgentRelationCollectionSection section = new TaxonNodeAgentRelationCollectionSection(this, conversationHolder, formElement, style);
+            ICdmFormElement formElement, int style) {
+        TaxonNodeAgentRelationCollectionSection section = new TaxonNodeAgentRelationCollectionSection(this, formElement, style);
         addAndAdaptSection(formElement, section);
         return section;
     }
 
-
        public TaxonOfRelationshipElement createTaxonOfRelationshipDetailElement(
                        ICdmFormElement parentElement, int style) {
                TaxonOfRelationshipElement section = new TaxonOfRelationshipElement(this, parentElement, style);
@@ -3596,32 +3308,13 @@ public class CdmFormFactory extends FormToolkit {
         return section;
        }
 
-       public TaxonDetailSection createTaxonDetailSection(ConversationHolder conversationHolder,
+       public TaxonDetailSection createTaxonDetailSection(
                        ICdmFormElement formElement, ISelectionProvider selectionProvider, int style) {
-                       TaxonDetailSection section = new TaxonDetailSection(this, conversationHolder, formElement, selectionProvider, style);
+                       TaxonDetailSection section = new TaxonDetailSection(this, formElement, selectionProvider, style);
                addAndAdaptSection(formElement, section);
                return section;
        }
 
-
-    /**
-     * <p>
-     * createTextWithLabelElement
-     * </p>
-     *
-     * @param parentElement
-     *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-     *            object.
-     * @param labelString
-     *            a {@link java.lang.String} object.
-     * @param initialText
-     *            a {@link java.lang.String} object.
-     * @param textLimit maximal number of characters allowed
-     * @param style
-     *            a int.
-     * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement}
-     *         object.
-     */
     public RuleConsideredElement createRuleConsideredElement(ICdmFormElement parentElement, String labelString, boolean isShowCodeEdition, int style) {
         RuleConsideredElement element = new RuleConsideredElement(this, parentElement, labelString, isShowCodeEdition, style);
         adapt(element);
@@ -3629,15 +3322,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * @param class1
-     * @param formElement
-     * @param string
-     * @param area
-     * @param nothing
-     * @param style
-     * @return
-     */
     public EntitySelectionElementWithIdInVocabulary createSelectionElementWithIdInVocabulary(Class<NamedArea> clazz,
             ICdmFormElement formElement, String labelString, NamedArea area, int mode, int style) {
         EntitySelectionElementWithIdInVocabulary element = new EntitySelectionElementWithIdInVocabulary(this,
@@ -3647,11 +3331,6 @@ public class CdmFormFactory extends FormToolkit {
         return element;
     }
 
-    /**
-     * @param extendedTimePeriodElement
-     * @param twistie
-     * @return
-     */
     public ExtendedTimeDetailSection createExtendedTimeDetailSection(
             ExtendedTimePeriodElement parentElement, int style) {
         ExtendedTimeDetailSection section = new ExtendedTimeDetailSection(this, parentElement,  style);
@@ -3659,6 +3338,7 @@ public class CdmFormFactory extends FormToolkit {
         adapt(section);
         return section;
     }
+
     public ExtendedTimePeriodElement createExtendedTimePeriodElement(
             ICdmFormElement parentElement, String labelString, ExtendedTimePeriod timePeriod, int style) {
         ExtendedTimePeriodElement section = new ExtendedTimePeriodElement(this, parentElement, labelString, timePeriod, style);
@@ -3667,8 +3347,6 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
-    
-
 //     public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
 //              RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
 //                              initialText, textHeight, style);
@@ -3676,11 +3354,4 @@ public class CdmFormFactory extends FormToolkit {
 //             parentElement.addElement(element);
 //             return element;
 //     }
-
-
-
-
-
-
-
-}
+}
\ No newline at end of file
index 3612cad884da4bcfd6d11ab3b53096e7884186bd..382d97b9d7256240f5edb5e6311708971d3d2c20 100644 (file)
@@ -14,7 +14,7 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.Section;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 
 /**
  * <p>
@@ -105,5 +105,9 @@ public class GatheringEventUnitElement extends AbstractCdmFormElement implements
        public void setLabel(String string) {
                label.setText(string);
        }
+
+       public void setExpanded(boolean isExpanded) {
+               this.section_minMaxText.setExpanded(isExpanded);
+       }
 }
 
index 81decadefe1a516403ad85303cce6151cb7b2267..88085aaec2ef30380d666385d521d8e80104e3c8 100644 (file)
@@ -6,21 +6,16 @@
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
-
 package eu.etaxonomy.taxeditor.ui.element;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 
 /**
- * <p>
- * MinMaxTextSection class.
- * </p>
  *
  * @author c.mathew
  * @created 23 Jul 2013
- * @version 1.0
  */
 public class MinMaxTextSection extends AbstractFormSection<DerivedUnitFacade> {
 
@@ -74,14 +69,6 @@ public class MinMaxTextSection extends AbstractFormSection<DerivedUnitFacade> {
                formFactory.addPropertyChangeListener(this);
        }
 
-       /**
-        * <p>
-        * Setter for the field <code>timePeriod</code>.
-        * </p>
-        *
-        * @param timePeriod
-        *            a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object.
-        */
        @Override
        public void setEntity(DerivedUnitFacade gatheringEvent) {
                super.setEntity(gatheringEvent);
index d98749970d9c050052983d121dd6dbaf5950712f..707ec3465bfbb597b4147d2e3cbc391a61908139 100644 (file)
@@ -124,7 +124,7 @@ public class MultilanguageTextElement extends AbstractCdmFormElement implements
                combo_language = formFactory.createDefinedTermComboElement(TermType.Language, formElement,
                                                "", null, false, style);
                combo_language.addSelectionListener(this);
-
+               
                button = formFactory.createButton(getLayoutComposite(),
                                "Open In Translation Editor", SWT.PUSH);
                addControl(button);
index f1f880592ec2b3fcd19960b1eb1c978d4664b779..9d58953eb2e44d2252f5809cb221b09509c5c474 100644 (file)
@@ -8,34 +8,22 @@
  */
 package eu.etaxonomy.taxeditor.ui.element;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
  * @author pplitzner
  * @date 17.06.2014
- *
  */
 public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
 
     private TextWithLabelElement textOriginalLabel;
 
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public OriginalLabelDataElement(CdmFormFactory formFactory,
             ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
 
-    /*
-     * (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) {
@@ -43,13 +31,6 @@ public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUn
         textOriginalLabel.setText(entity.getOriginalLabelInfo());
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-     * .lang.Object)
-     */
     @Override
     public void handleEvent(Object eventSource) {
         if(eventSource==textOriginalLabel){
@@ -57,4 +38,8 @@ public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUn
         }
     }
 
-}
+       @Override
+       public void fillFields() {
+               textOriginalLabel.setText(getEntity().getOriginalLabelInfo());
+       }
+}
\ No newline at end of file
index 4fe7d74486ef80769589a6d33ec72712cf13f71b..00397d71bae1a1fad4f968c82d981cbb592ef15d 100644 (file)
@@ -30,7 +30,6 @@ import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.model.term.TermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
-import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -69,7 +68,7 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
             super(formFactory, formElement);
 
             formFactory.addPropertyChangeListener(this);
-
+            setSelectedRepresentation(representation);
             element_Label = this.formFactory.createTextWithLabelElement(formElement, "Label", null, style);
             element_abbrevLabel = this.formFactory.createTextWithLabelElement(formElement, "abbrev. Label", null, style);
             element_plural = this.formFactory.createTextWithLabelElement(formElement, "Plural", null, style);
@@ -79,7 +78,7 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
             }
             setTerm(term, fill);
             //if(representation!=null){
-                setSelectedRepresentation(representation);
+            
            //}
 
         }
@@ -90,13 +89,16 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
             super(formFactory, formElement);
 
             formFactory.addPropertyChangeListener(this);
-
+            if(representation!=null){
+                setSelectedRepresentation(representation);
+            }
             element_Label = this.formFactory.createTextWithLabelElement(formElement, "Label", null, style);
             element_abbrevLabel = this.formFactory.createTextWithLabelElement(formElement, "abbrev. Label", null, style);
             element_plural = this.formFactory.createTextWithLabelElement(formElement, "Plural", null, style);
             element_text = this.formFactory.createMultiLineTextWithLabel(formElement, "Description", textHeight, style);
             if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
                 createRepresentationEditingElements(formElement, style);
+                
             }
             setTermDto(term, fill);
             if(representation!=null){
@@ -115,9 +117,12 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
                removeRepresentation.setToolTipText("Remove representation");
                removeRepresentation.addSelectionListener(new DeleteListener(this));
                addControl(removeRepresentation);
-
+               boolean addNullValue = false;
+               if (this.selectedRepresentation == null) {
+                   addNullValue = true;
+               }
             combo_language = formFactory.createDefinedTermComboElement(TermType.Language, formElement,
-                            "", null, false, style);
+                            "", null, addNullValue, style);
 
        }
 
@@ -172,7 +177,7 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
                 term.addRepresentation(rep);
             }
 
-            if (selectedRepresentation != null) {
+            if (selectedRepresentation != null && combo_language != null) {
                combo_language.setTerms(getLanguages());
 
             } 
@@ -304,7 +309,8 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
                     setEnabledControls(false);
                     removeRepresentation.setEnabled(false);
                 }
-                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
+                //firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
+                firePropertyChangeEvent(event);
             }
         }
 
@@ -313,10 +319,11 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
         }
 
         public void setSelectedRepresentation(Representation selectedRepresentation) {
-            if (selectedRepresentation == null){
-                selectedRepresentation = Representation.NewInstance("", "", "", null);
-            }
+//            if (selectedRepresentation == null){
+//                selectedRepresentation = Representation.NewInstance("", "", "", null);
+//            }
             this.selectedRepresentation = selectedRepresentation;
+            
         }
 
         private class DeleteListener extends SelectionAdapter {
@@ -339,6 +346,13 @@ public class RepresentationElement extends AbstractCdmFormElement implements IEn
                        updateControls();
                }
        }
+
+        /**
+         * @param isEnabled
+         */
+        public void setLanguageComboEnabled(boolean isEnabled) {
+            this.combo_language.setEnabled(isEnabled);            
+        }
     }
 
 
index ee1879e70bf80a34e5c3521f534927cac4c85b36..8f3374d7a7a8f5ad214aa13434776a5ff4ef867f 100644 (file)
@@ -203,12 +203,19 @@ public class TextWithLabelElement
         text.setEditable(editable);
         String symbolicName = editable ? Resources.COLOR_FONT_DEFAULT : Resources.COLOR_TEXT_DISABLED;
         text.setForeground(getColor(symbolicName));
+        if (!editable) {
+               text.setBackground(getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND));
+        }else {
+               text.setBackground(getPersistentBackground());
+        }
     }
 
     @Override
     public void updateCacheRelevance() {
         Color color = cacheRelevance().getColor();
-        text.setBackground(color);
+        if (text.getEditable()) {
+               text.setBackground(color);
+        }
     }
 
     @Override
index 1a5e0335e7284efdff0e1e99a31c09ee73b0fe05..141ca94a000d2ae50d08f414a348207b72980fe7 100644 (file)
@@ -49,5 +49,9 @@ public class TimePeriodElement
     public boolean isEnabled() {
         return isEnabled;
     }
+    
+    public void setExpanded(boolean isExpanded) {
+       this.section_dateDetails.setExpanded(isExpanded);
+    }
 
 }
\ No newline at end of file
index b1addccd54bf4c9f520ed2fb34bb1ebbafce78a2..8ee703ae628534d65f54269920dac56581eb0adb 100644 (file)
@@ -12,6 +12,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.ModifyEvent;
@@ -109,15 +110,16 @@ public class ToggleableTextElement
        public void setText(String text){
                if(text != null){
                        // store current caret position
-                       int caretPosition = text_cache.getCaretPosition();
+                   try {
+                       int caretPosition = text_cache.getCaretPosition();
 
-                       StoreUtil.setTextWithoutModifyListeners(text_cache, text != null? text.trim(): text);
-//                     text_cache.removeModifyListener(this);
-//                     text_cache.setText(text);
-//                     text_cache.addModifyListener(this);
+                       StoreUtil.setTextWithoutModifyListeners(text_cache, text != null? text.trim(): text);
 
-                       // restore caret position
-                       text_cache.setSelection(caretPosition);
+                       // restore caret position
+                       text_cache.setSelection(caretPosition);
+                   }catch(SWTException e) {
+                       //if the text field is deprecated we do not want to set the text, so we can ignore this exception.
+                   }
                }
        }
 
index e617f2c5bc7996b2866c1b0b341bc733f0460057..d808b155844d48abe97cd1b712bbe5a1dfcebbf4 100644 (file)
@@ -6,7 +6,6 @@
 * 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.password;
 
 import org.eclipse.jface.wizard.WizardDialog;
@@ -16,8 +15,6 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Label;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
@@ -32,20 +29,18 @@ import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 /**
  * @author n.hoffmann
  * @created Mar 10, 2011
- * @version 1.0
  */
-public class EditPasswordElement extends AbstractCdmFormElement implements SelectionListener, IConversationEnabled{
+public class EditPasswordElement
+        extends AbstractCdmFormElement
+        implements SelectionListener{
 
        private User user;
        private Button button;
 
-       private ConversationHolder conversation;
-
        public EditPasswordElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement, String labelString, User user, ConversationHolder conversation) {
+                       ICdmFormElement formElement, String labelString, User user) {
                super(formFactory, formElement);
 
-               this.conversation = conversation;
                this.user = user;
 
                Label label = formFactory.createLabel(getLayoutComposite(), null);
@@ -65,7 +60,7 @@ public class EditPasswordElement extends AbstractCdmFormElement implements Selec
                if(!CdmStore.getService(IUserService.class).userExists(user.getUsername())) {
                        MessagingUtils.warningDialog(Messages.EditPasswordElement_USERNAME_DOES_NOT_EXIST, this, String.format(Messages.EditPasswordElement_PLEASE_CREATE_OR_SAVE_USER, user.getUsername()));
                } else {
-                       PasswordWizard wizard = new PasswordWizard(user, conversation);
+                       PasswordWizard wizard = new PasswordWizard(user);
                        WizardDialog dialog = new WizardDialog(getLayoutComposite().getShell(), wizard);
                        dialog.open();
                }
@@ -74,13 +69,5 @@ public class EditPasswordElement extends AbstractCdmFormElement implements Selec
        @Override
        public void widgetDefaultSelected(SelectionEvent e) {}
 
-       @Override
-       public void update(CdmDataChangeMap arg0) {}
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
-
-}
+       
+}
\ No newline at end of file
index 94dc0fb8193d2bc627438802dda8f4602628592e..f56f7eaef9c469b2046234bfaf8895d2bfba2132 100644 (file)
@@ -14,11 +14,8 @@ import org.eclipse.swt.widgets.Display;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.core.AuthenticationException;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.model.permission.User;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -29,19 +26,17 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  * @created Mar 10, 2011
  * @version 1.0
  */
-public class PasswordWizard extends Wizard implements IConversationEnabled{
+public class PasswordWizard extends Wizard {
 
        private PasswordWizardPage passwordPage;
        private final User user;
-       private final ConversationHolder conversation;
-
+       
        /**
         * @param user the user to change the password for
         * @param conversation this optional parameter can be null. Only supply conversation if you
         * need to run this wizard is a nested conversation
         */
-       public PasswordWizard(User user, ConversationHolder conversation){
-               this.conversation = conversation;
+       public PasswordWizard(User user){
                this.user = user;
                setWindowTitle(Messages.PasswordWizardPage_CHANGE_PASSWORD);
        }
@@ -50,16 +45,13 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
        public void addPages() {
                CdmFormFactory formFactory = new CdmFormFactory(Display.getDefault());
 
-               passwordPage = new PasswordWizardPage(formFactory, getConversationHolder(), user);
+               passwordPage = new PasswordWizardPage(formFactory, user);
                addPage(passwordPage);
        }
 
        @Override
        public boolean performFinish() {
 
-               ConversationHolder internalConversation = CdmStore.getCurrentApplicationConfiguration().NewConversation();
-           internalConversation.bind();
-           internalConversation.startTransaction();
                String warningTitle = Messages.PasswordWizard_COULD_NOT_CHANGE_PWD;
         String warningMessage = Messages.PasswordWizard_OLD_PWD_INCORRECT;
         try{
@@ -74,10 +66,7 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                        if (user.equals(CdmStore.getLoginManager().getAuthenticatedUser())){
                                CdmStore.getLoginManager().authenticate(user.getUsername(), passwordPage.getNewPassword());
                        }
-                   internalConversation.commit(false);
-                   internalConversation.unbind();
-                   internalConversation.close();
-                       return true;
+                       return true;
                }catch(AccessDeniedException e){
                        MessagingUtils.warningDialog(warningTitle, this, warningMessage);
                        return false;
@@ -88,20 +77,8 @@ public class PasswordWizard extends Wizard implements IConversationEnabled{
                }catch(Exception e){
                        MessagingUtils.warningDialog(Messages.PasswordWizard_PROBLEM_WITH_CHANGING_PWD, this, Messages.PasswordWizard_PWD_COULD_NOT_BE_CHANGED + e.getMessage());
                        return false;
-               }finally{
-                   if(conversation != null){
-                       conversation.bind();
-                   }
                }
        }
 
-       @Override
-       public void update(CdmDataChangeMap arg0) {
-       }
-
-       @Override
-       public ConversationHolder getConversationHolder() {
-               return conversation;
-       }
-
+       
 }
index ef2f695602e866d9e3f98fa51b56c896ad20ff97..352f7fc43d4edf27cfec05aee69508dbb31425cc 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -40,9 +39,8 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
        private TextWithLabelElement text_passwordRepeat;
        private final PasswordValidator passwordValidator;
 
-       protected PasswordWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, User entity) {
-               super(formFactory, conversation, entity);
+       protected PasswordWizardPage(CdmFormFactory formFactory, User entity) {
+               super(formFactory, entity);
 
                passwordValidator = new PasswordValidator();
 
@@ -58,7 +56,7 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
                setPageComplete(false);
 
                control.setLayout(LayoutConstants.LAYOUT(2, false));
-               WizardPageRootElement rootElement = new WizardPageRootElement(formFactory, control, getConversationHolder());
+               WizardPageRootElement rootElement = new WizardPageRootElement(formFactory, control);
 
                if(isChangingOwnPassword()) {
                    text_oldPassword = formFactory.createTextWithLabelElement(rootElement, Messages.PasswordWizardPage_OLD_PASSWORD, null, SWT.PASSWORD);
@@ -125,6 +123,12 @@ public class PasswordWizardPage extends AbstractCdmEntityWizardPage<User> implem
 
                public String passwordsMatch(String password1, String password2){
 
+                   if (password1 == null || password2 == null) {
+                       //empty passwords not allowed
+                       setPageComplete(false);
+                return NO_MATCH;
+                   }
+
                        if(! password1.equals(password2)){
                                setPageComplete(false);
                                return NO_MATCH;
index 015649846834d8277a83d48988e970cf804ce93b..d7b941465bb201d312cff0ed04d1604532fc3efe 100644 (file)
@@ -18,8 +18,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 
-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.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -87,14 +85,10 @@ public abstract class AbstractCdmDetailElement<T>
 
        public void setEntityWithoutUpdate(T entity){
            this.entity = entity;
-        // the id is always 0 if the entity was not yet saved, so it is new in this case
-        if(getEntity() == null || (getEntity() instanceof CdmBase && StoreUtil.getCdmEntity(getEntity()).getId() == 0)) {
-            // new entity, not yet saved
-            requiredCrud = EnumSet.of(CRUD.CREATE);
-        } else {
-            requiredCrud = EnumSet.of(CRUD.UPDATE);
-        }
+        fillFields();
        }
+       
+       public abstract void fillFields();
 
        @Override
     public T getEntity() {
@@ -244,19 +238,7 @@ public abstract class AbstractCdmDetailElement<T>
                MessagingUtils.error(event.getSource().getClass(), event.getException());
        }
 
-       @Override
-    public ConversationHolder getConversationHolder() {
-               if (getParentElement() instanceof IConversationEnabled) {
-                       return ((IConversationEnabled) getParentElement())
-                                       .getConversationHolder();
-               }
-               throw new IllegalArgumentException(
-                               "Parent element should be IConversationEnabled");
-       }
 
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {
-       }
 
        @Override
     public void update(Observable o, Object arg){
index e6f10e91959f6cd9acb13c713e7083379110ecf8..710d89797306c83083b44bc16b2e7d3748672f5b 100644 (file)
@@ -23,7 +23,6 @@ import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
@@ -59,14 +58,13 @@ public abstract class AbstractCdmDetailSection<ENTITY>
        protected AbstractCdmDetailElement<ENTITY> detailElement;
 
        public AbstractCdmDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-           this(formFactory, null, conversation, parentElement, selectionProvider, style);
+           this(formFactory, null, parentElement, selectionProvider, style);
        }
 
-       //TODO remove conversation
        public AbstractCdmDetailSection(CdmFormFactory formFactory, Class<ENTITY> clazz,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(formFactory, parentElement, selectionProvider,
                                ExpandableComposite.CLIENT_INDENT | style);
@@ -172,6 +170,17 @@ public abstract class AbstractCdmDetailSection<ENTITY>
                setSectionTitle();
                layout();
        }
+       
+       public void setEntityWithoutUpdate(ENTITY entity) {
+
+               if (detailElement != null) {
+                       detailElement.fillFields();
+
+               }
+               super.setEntity(entity);
+               setSectionTitle();
+
+       }
 
        protected void setSectionTitle() {
                String title = "";
index 6dcee17c97fa8f65ff79c200dd79c16ed99c39da..589f5892dab1a7b96abbe481b4204f18f124e3ca 100644 (file)
@@ -18,11 +18,8 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-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.CdmBase;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
@@ -46,8 +43,7 @@ import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
  */
 public abstract class AbstractEntityCollectionElement<ENTITY>
         extends AbstractCdmFormElement
-        implements IEntityElement<ENTITY>, SelectionListener,
-              IConversationEnabled, IEnableableFormElement {
+        implements IEntityElement<ENTITY>, SelectionListener, IEnableableFormElement {
 
        protected ENTITY entity;
 
@@ -213,20 +209,6 @@ public abstract class AbstractEntityCollectionElement<ENTITY>
         return box;
     }
 
-       @Override
-    public ConversationHolder getConversationHolder() {
-               if (getParentElement() instanceof IConversationEnabled) {
-                       return ((IConversationEnabled) getParentElement())
-                                       .getConversationHolder();
-               }
-               throw new IllegalArgumentException(
-                               "Parent element should be IConversationEnabled");
-       }
-
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {
-       }
-
     public void setWarnForReferencedObjects(LabelElement warnForReferencedObjects) {
         this.warnForReferencedObjects = warnForReferencedObjects;
     }
index cec4c1b1b80a5e38e3c82ce8045a58a4840debb2..7b5db176c788f583532ab293a1547c9a916b8b27 100644 (file)
@@ -22,8 +22,6 @@ import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.ToolBarManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -36,13 +34,11 @@ import org.eclipse.ui.forms.events.ExpansionEvent;
 import org.eclipse.ui.forms.events.IExpansionListener;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.permission.CRUD;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
@@ -76,10 +72,10 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
        private String title;
 
     private AbstractEntityCollectionElement<ENTITY> entityCollectionElement;
-    
+
     private boolean isEnabled = true;
 
-       public AbstractEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, String title, int style) {
+       public AbstractEntityCollectionSection(CdmFormFactory formFactory, ICdmFormElement parentElement, String title, int style) {
                super(formFactory, parentElement, ExpandableComposite.CLIENT_INDENT | style);
                this.title = title;
                this.setText(getTitleString());
@@ -88,12 +84,10 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
                addExpansionListener(this);
 
                CdmStore.getLoginManager().addObserver(this);
-               addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
+               addDisposeListener(e-> {
                 CdmStore.getLoginManager().deleteObserver(AbstractEntityCollectionSection.this);
             }
-        });
+        );
        }
 
        protected Control createToolbar() {
@@ -109,6 +103,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
                                    getSection().setExpanded(true);
                                }
                                internalUpdateSection(true);
+
                            }
                        }
                };
@@ -192,7 +187,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
        protected void setSectionTitle() {
            ENTITY entity = getEntity();
                Collection<ELEMENT> collection = getCollection(entity);
-               if(collection != null && collection.size() > 0){
+               if(!CdmUtils.isNullSafeEmpty(collection)){
                        this.setText(getTitleString() + " +");
                }else{
                        this.setText(getTitleString());
@@ -220,6 +215,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
        protected void internalUpdateSection(boolean changed){
            setSectionTitle();
                destroyDynamicContent();
+               updateToolbar();
                if(isExpanded() || expandSectionWhenContentAvailable()) {
             renderContent(isExpanded());
         }
@@ -257,8 +253,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
        /**
         * Creates the widgets for the collection
         */
-       protected void createDynamicContents(Collection<ELEMENT> elements)
-       {
+       protected void createDynamicContents(Collection<ELEMENT> elements){
                int i = 0;
                for(final ELEMENT element : elements){
                        SelectionAdapter removeListener = new SelectionAdapter(){
@@ -346,7 +341,7 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
        }
 
     protected void updateToolbar() {
-        if( !(getEntity() instanceof CdmBase) || (getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), UPDATE)) && isEnabled){
+        if( !(getEntity() instanceof CdmBase) || (getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), getUpdate())) && isEnabled){
             showToolbar();
         } else {
                removeToolbar();
@@ -424,22 +419,28 @@ public abstract class AbstractEntityCollectionSection<ENTITY, ELEMENT>
         * @return String to display when hovering the add button
         */
        protected abstract String getTooltipString();
-       
-       public boolean isEnabled(){
+
+       @Override
+    public boolean isEnabled(){
                return isEnabled;
        }
-       
-       public void setEnabled(boolean enabled){
+
+       @Override
+    public void setEnabled(boolean enabled){
                isEnabled=enabled;
                if (!isEnabled){
                        removeToolbar();
                }
-               
+
                for (ICdmFormElement element: getElements()){
                        if (element instanceof IEnableableFormElement){
                                ((IEnableableFormElement)element).setEnabled(isEnabled);
                        }
                }
-               
+
        }
+
+    public static EnumSet<CRUD> getUpdate() {
+        return UPDATE;
+    }
 }
index 5d31a9c811faa669621cd9636f75d4636e16a288..0b1f2216a87966501e1bca6677acf41f01782d10 100644 (file)
@@ -62,4 +62,12 @@ public abstract class AbstractIdentifiableEntityDetailElement<T extends IIdentif
     protected void registerCacheRelevance(ICacheRelevantFormElement element) {
         registerCacheRelevance(element, toggleable_cache);
     }
+    
+    @Override
+    public void fillFields() {
+       if (!getEntity().getTitleCache().equals(toggleable_cache.getText())) {
+               toggleable_cache.setText(getEntity().getTitleCache());
+               toggleable_cache.setSelected(getEntity().isProtectedTitleCache());
+       }       
+    }
 }
\ No newline at end of file
index b6ade7f2aa776578bea62f3d613bcbc3e7945164..f82a0ff4a71836a4317be57b9e463fc4db461471 100644 (file)
@@ -50,4 +50,9 @@ public class EmptyElement extends AbstractCdmDetailElement{
        public void setEntity(Object entity) {
            // nothing
        }
+
+       @Override
+       public void fillFields() {
+               // do nothing           
+       }
 }
index bdaa815ebf9fd29cd012ad77b24ae0688d0b1cda..e6ded9cb8c5b65cf51ea3efe106172ec0c11d8d9 100644 (file)
@@ -8,7 +8,6 @@
 */
 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;
 
@@ -17,7 +16,7 @@ import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
  * @date 30.07.2013
  */
 public interface ICdmDetailElement<T>
-               extends IEntityElement<T>, IEnableableFormElement, IConversationEnabled{
+               extends IEntityElement<T>, IEnableableFormElement{
 
     public abstract void setEntity(T entity);
 }
\ No newline at end of file
index 69a7ee6b25ed7dedf492d4b273f272d3a8679359..bbac3c2f74bc811f824310163c271fddaa9ddc5a 100644 (file)
@@ -15,6 +15,8 @@ public interface ITaxonBaseDetailSection{
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
         */
        public abstract void setTaxonBase(TaxonBase<?> taxon);
+       
+       public abstract void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon);
 
        public abstract TaxonBase<?> getTaxonBase();
 }
index 0fb16db17bc93a2ec120e6e4a2367fada3016125..e61023bba9431dabdacd694bda145ef69bd8191d 100644 (file)
@@ -6,7 +6,6 @@
  * 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.agent;
 
 import eu.etaxonomy.cdm.model.agent.Institution;
@@ -19,7 +18,6 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author n.hoffmann
  * @created Dec 15, 2010
- * @version 1.0
  */
 public class InstitutionDetailElement extends
                AbstractCdmDetailElement<Institution> {
@@ -32,22 +30,11 @@ public class InstitutionDetailElement extends
 
        private EntitySelectionElement<Institution> selection_partOfInstitution;
 
-       /**
-        * @param formFactory
-        * @param formElement
-        */
        public InstitutionDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-        */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        Institution entity, int style) {
@@ -60,20 +47,12 @@ public class InstitutionDetailElement extends
                // section_institutionTypes
                selection_partOfInstitution = formFactory
                                .createSelectionElement(Institution.class,
-                                               //getConversationHolder(),
                                        formElement, "Is Part Of",
                                                entity.getIsPartOf(),
                                                EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.DELETABLE,
                                                style);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == text_name) {
@@ -85,4 +64,13 @@ public class InstitutionDetailElement extends
                }
        }
 
-}
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       text_name.setText(getEntity().getName());
+                       text_code.setText(getEntity().getCode());
+                       selection_partOfInstitution.setEntity(getEntity().getIsPartOf());
+               }
+               
+       }
+}
\ No newline at end of file
index 5a260c5966c48baa9a40a071f6741035b55b1686..2de9651d7851520b8d1f81738d4adaefa26580c2 100644 (file)
@@ -6,12 +6,10 @@
 * 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.agent;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -21,37 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author n.hoffmann
  * @created Dec 15, 2010
- * @version 1.0
  */
 public class InstitutionDetailSection extends AbstractCdmDetailSection<Institution> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
        public InstitutionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "Institution";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<Institution> createCdmDetailElement(AbstractCdmDetailSection<Institution> parentElement, int style) {
            return formFactory.createInstitutionDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index 1de47180332344d8a3a2fb2720ad04066d679c45..f926dd5b770b5d73a9d73883f81eb64e5897eb3c 100644 (file)
@@ -9,7 +9,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.agent;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -29,9 +28,8 @@ public class InstitutionWizardPage extends
         * @param conversation
         * @param entity
         */
-       public InstitutionWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Institution entity) {
-               super(formFactory, conversation, entity);
+       public InstitutionWizardPage(CdmFormFactory formFactory, Institution entity) {
+               super(formFactory, entity);
        }
 
            /*
index 5d6f4de09887693477a9afdb029b9133a65e3c70..682ed0e2b84c52e960de67c88e95562b27d9cc44 100644 (file)
@@ -13,13 +13,13 @@ public class NomenclaturalTeamMemberElement extends TeamMemberElement {
        public NomenclaturalTeamMemberElement(CdmFormFactory cdmFormFactory, AbstractFormSection section, Person entity,
                        SelectionListener removeListener, int style) {
                super(cdmFormFactory, section, entity, removeListener, style);
-               
+
        }
 
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_person = formFactory
-                               .createSelectionElementWithAbbreviatedTitle(Person.class,getConversationHolder(),
+                               .createSelectionElementWithAbbreviatedTitle(Person.class,
                                        this, "Person", null,
                                                EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE,
                                                style);
index 5a27b25081f2046492d1a813a65626a762d5a063..9ead6a9f71df735f0c04450cd3e6c12361e4bb82 100644 (file)
@@ -8,7 +8,7 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.agent;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.agent.Person;
@@ -161,4 +161,23 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       text_nomenclaturalTitle.setText(getEntity().getNomenclaturalTitle());
+                       toggleable_cache.setText(getEntity().getTitleCache());
+                       toggleable_cache.setCacheEnabled(getEntity().isProtectedTitleCache());
+                       text_collectorTitle.setText(getEntity().getCollectorTitle());
+                       text_firstname.setText(getEntity().getGivenName());
+                       text_lastname.setText(getEntity().getFamilyName());
+                       text_prefix.setText(getEntity().getPrefix());
+                       text_suffix.setText(getEntity().getSuffix());
+                       text_initials.setText(getEntity().getInitials());
+                       time_lifespan.setTimePeriod(getEntity().getLifespan()!= null? getEntity().getLifespan(): null);
+                       text_orcid.setText(getEntity().getOrcid() != null? getEntity().getOrcid().toString(): null);
+                       text_lsid.setText(getEntity().getLsid()!= null? getEntity().getLsid().toString(): null);
+               }
+
+       }
 }
\ No newline at end of file
index 5aebd91e2ce7125e30437291faae08fa1c3ce279..c2475895170641504d253d4297c0a09d1c2c097c 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.agent;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,9 +24,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  */
 public class PersonDetailSection extends AbstractCdmDetailSection<Person>{
 
-       public PersonDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public PersonDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -39,6 +38,4 @@ public class PersonDetailSection extends AbstractCdmDetailSection<Person>{
        protected AbstractCdmDetailElement<Person> createCdmDetailElement(AbstractCdmDetailSection<Person> parentElement, int style) {
            return formFactory.createPersonDetailElement(parentElement, style);
        }
-
-
-}
+}
\ No newline at end of file
index 8852940808a415d5da322bb1cb4a95531ab83c1d..8ae5aa86c88903e13880e0d368adae2c4b11bb44 100644 (file)
@@ -6,14 +6,11 @@
 * 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.agent;
 
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.SWT;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -21,35 +18,18 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>PersonWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
- * @version 1.0
  */
 public class PersonWizardPage extends AbstractCdmEntityWizardPage<Person> {
 
-    PersonDetailElement personElement;
-
+    private PersonDetailElement personElement;
 
-       /**
-        * <p>Constructor for PersonWizardPage.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.agent.Person} object.
-        */
-       public PersonWizardPage(CdmFormFactory formFactory, ConversationHolder conversation,
-                       Person entity) {
-               super(formFactory, conversation, entity);
+    public PersonWizardPage(CdmFormFactory formFactory, Person entity) {
+               super(formFactory, entity);
                setTitle("Person");
        }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.CdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-        */
-       /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Person> createElement(ICdmFormElement rootElement) {
                personElement = formFactory.createPersonDetailElement(rootElement, SWT.NULL);
@@ -59,9 +39,6 @@ public class PersonWizardPage extends AbstractCdmEntityWizardPage<Person> {
 
        @Override
     protected boolean titleCacheIsNotEmpty() {
-        if (getEntity() instanceof AgentBase) {
-            return !StringUtils.isEmpty(entity.getTitleCache());
-        }
-        return true;
+        return !StringUtils.isEmpty(entity.getTitleCache());
     }
-}
+}
\ No newline at end of file
index f7c9e820861ac548dd1e955c7ce3454f1373afcf..a18bb0c95bf32af3944f420290141630ef063af6 100644 (file)
@@ -35,7 +35,7 @@ public class TeamDetailElement
        private TeamMemberSection section_teamMembers;
        private boolean isNomenclaturalTeam;
        private boolean isCollectorTeam;
-       
+
        /**
         * Constructor for TeamDetailElement.
         */
@@ -59,7 +59,7 @@ public class TeamDetailElement
                 "Collector Title", entity.getCollectorTitleCache(), entity.isProtectedCollectorTitleCache(),
                 CacheRelevance.CACHE2, style);
         hasAdditionalMembers = formFactory.createCheckbox(formElement, "Additional Members", entity.isHasMoreMembers(), style);
-        section_teamMembers = formFactory.createTeamMemberSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(TeamMemberSection.class, entity.getClass().getCanonicalName(), true), isNomenclaturalTeam, isCollectorTeam);
+        section_teamMembers = formFactory.createTeamMemberSection(formElement, StoreUtil.getSectionStyle(TeamMemberSection.class, entity.getClass().getCanonicalName(), true), isNomenclaturalTeam, isCollectorTeam);
         section_teamMembers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 
         //cache relevance
@@ -143,4 +143,17 @@ public class TeamDetailElement
     public void setNomenclaturalTeam(boolean isNomenclaturalTeam) {
         this.isNomenclaturalTeam = isNomenclaturalTeam;
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       toggleable_nomenclaturalTitleCache.setText(getEntity().getNomenclaturalTitleCache());
+                       toggleable_collectorTitleCache.setText(getEntity().getCollectorTitleCache());
+                       hasAdditionalMembers.setEnabled(getEntity().isHasMoreMembers());
+       
+                       section_teamMembers.setEntity(getEntity());
+                       
+               }
+               
+       }
 }
\ No newline at end of file
index 37b3e467620d9c2ae05eb3c10d24eec3017c2512..626af949029aa70c78374c231e24aa727256a8c4 100644 (file)
@@ -6,12 +6,10 @@
 * 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.agent;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,38 +21,32 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author n.hoffmann
  * @created Mar 4, 2010
- * @version 1.0
  */
 public class TeamDetailSection extends AbstractCdmDetailSection<Team>{
 
     private boolean isNomenclaturalTeam;
     private boolean isCollectorTeam;
 
-       
+
 
        /**
         * <p>Constructor for TeamDetailSection.</p>
         *
         * @param cdmFormFactory 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 TeamDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public TeamDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Team";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<Team> createCdmDetailElement(AbstractCdmDetailSection<Team> parentElement, int style) {
            return formFactory.createTeamDetailElement(parentElement, style, isNomenclaturalTeam, isCollectorTeam);
@@ -67,7 +59,7 @@ public class TeamDetailSection extends AbstractCdmDetailSection<Team>{
        public void setIsNomenclaturalTeam(boolean isNomenclaturalTeam){
            this.isNomenclaturalTeam = isNomenclaturalTeam;
        }
-       
+
        public boolean isCollectorTeam() {
                return isCollectorTeam;
        }
index 1c439c76028086b2301019ca205ef3b510b03684..13b0bf34a6ffa80bd49876cb9fc0ab56b659eca3 100644 (file)
@@ -14,7 +14,6 @@ import java.util.List;
 
 import org.eclipse.swt.graphics.Color;
 
-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.dialog.selection.CollectorSelectionDialog;
@@ -29,8 +28,6 @@ import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * TeamMemberSection class.
- *
  * @author n.hoffmann
  * @created Apr 30, 2010
  */
@@ -43,16 +40,8 @@ public class TeamMemberSection
 
     private CacheRelevanceHelper cacheRelevanceHelper = new CacheRelevanceHelper();
 
-       /**
-        * <p>Constructor for TeamMemberSection.</p>
-        *
-        * @param cdmFormFactory 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 style a int.
-        */
-       public TeamMemberSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style, boolean isNomenclatural, boolean isCollectorTeam) {
-               super(cdmFormFactory, conversation, parentElement, null, style);
+    public TeamMemberSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style, boolean isNomenclatural, boolean isCollectorTeam) {
+               super(cdmFormFactory, parentElement, null, style);
                isNomenclaturalTeam = isNomenclatural;
                this.isCollectorTeam = isCollectorTeam;
        }
index b5e91320dee097e2c018f7bff78426f0f9b3e8a9..d0ad99b1e3d26922eac0ddc8f243316b672a38af 100644 (file)
@@ -6,12 +6,10 @@
 * 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.agent;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
@@ -26,7 +24,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author n.hoffmann
  * @created Apr 26, 2010
- * @version 1.0
  */
 public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<TeamOrPersonBase> {
 
@@ -34,17 +31,15 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
         * <p>Constructor for TeamOrPersonBaseDetailSection.</p>
         *
         * @param cdmFormFactory 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 TeamOrPersonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
-                       ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+       public TeamOrPersonBaseDetailSection(CdmFormFactory cdmFormFactory,
+               ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                if (getEntity() != null){
@@ -63,4 +58,4 @@ public class TeamOrPersonBaseDetailSection extends AbstractCdmDetailSection<Team
            //TODO DetailElement missing??
            return null;
        }
-}
+}
\ No newline at end of file
index 13e64eae84e8cec23c9bace0341312a9dd0811d9..2b464e076769ab56fd33eb239d2933bc9d2286e0 100644 (file)
@@ -6,12 +6,10 @@
  * 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.agent;
 
 import org.eclipse.swt.SWT;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -19,42 +17,21 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>
- * TeamWizardPage class.
- * </p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
- * @version 1.0
  */
 public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
 
     private boolean isNomenclaturalTeam = false;
     private boolean isCollectorTeam = false;
 
-       /**
-        * <p>
-        * Constructor for TeamWizardPage.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.agent.Team} object.
-        */
-       public TeamWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Team entity, boolean isNomenclaturalTeam, boolean isCollectorTeam) {
-               super(formFactory, conversation, entity);
+       public TeamWizardPage(CdmFormFactory formFactory, Team entity, boolean isNomenclaturalTeam, boolean isCollectorTeam) {
+               super(formFactory, entity);
                setTitle("Team");
                setIsNomenclaturalTeam(isNomenclaturalTeam);
                setIsCollectorTeam(isCollectorTeam);
        }
 
-       /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<Team> createElement(
                        ICdmFormElement rootElement) {
@@ -63,9 +40,6 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
                return teamElement;
        }
 
-    /**
-     * @return the isNomenclaturalTeam
-     */
     public boolean isNomenclaturalTeam() {
         return isNomenclaturalTeam;
     }
@@ -73,7 +47,7 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
     public void setIsNomenclaturalTeam(boolean isNomenclaturalTeam){
         this.isNomenclaturalTeam = isNomenclaturalTeam;
     }
-    
+
     public boolean isCollectorTeam() {
         return isCollectorTeam;
     }
@@ -81,4 +55,4 @@ public class TeamWizardPage extends AbstractCdmEntityWizardPage<Team> {
     public void setIsCollectorTeam(boolean isCollectorTeam){
         this.isCollectorTeam = isCollectorTeam;
     }
-}
+}
\ No newline at end of file
index aff83e4aaa2310d656471eed90db11011a4a2df9..374ef3aa2b5c016e2d699035542d01233b086654 100644 (file)
@@ -18,20 +18,13 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 /**
  * @author k.luther
  * @date 23.03.2016
  *
  */
-public abstract class AbstractEditWizard<T> extends Wizard implements
-INewWizard, IConversationEnabled{
-
-    private ConversationHolder conversation;
+public abstract class AbstractEditWizard<T> extends Wizard implements INewWizard{
 
     protected CdmFormFactory formFactory;
 
@@ -64,9 +57,6 @@ INewWizard, IConversationEnabled{
     @Override
     public boolean performFinish() {
         saveEntity();
-
-        conversation.commit();
-        conversation.close();
         return true;
     }
 
@@ -100,23 +90,7 @@ INewWizard, IConversationEnabled{
     @Override
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         formFactory = new CdmFormFactory(context.get(Shell.class).getDisplay());
-        conversation = CdmStore.createConversation();
     }
-
-
-
-    /**
-     * <p>getConversationHolder</p>
-     *
-     * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-     */
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return conversation;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {}
+    
 
 }
index 86c5fb0a4720beaf2ff7b69a22bb962e87971b5a..c1c8455d892362717620b5b043a52282cc303153 100644 (file)
@@ -6,7 +6,6 @@
  * 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.classification;
 
 import org.eclipse.swt.SWT;
@@ -26,13 +25,8 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * ClassificationDetailElement class.
- * </p>
- *
  * @author n.hoffmann
  * @created Sep 27, 2010
- * @version 1.0
  */
 public class ClassificationDetailElement extends
                AbstractCdmDetailElement<Classification> {
@@ -48,59 +42,27 @@ public class ClassificationDetailElement extends
     private GeoScopeDetailSection section_collectingAreas;
 
 
-
-
-       /**
-        * <p>
-        * Constructor for ClassificationDetailElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
        public ClassificationDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-        * (eu.etaxonomy.taxeditor.forms.ICdmFormElement,
-        * eu.etaxonomy.cdm.model.common.IAnnotatableEntity, int)
-        */
-       /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
                Classification entity, int style) {
            text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getName().getText() : null, SWT.NULL);
-           selection_reference = formFactory.createSelectionElement(Reference.class, //getConversationHolder(),
+           selection_reference = formFactory.createSelectionElement(Reference.class,
                    formElement, "Reference",
                    entity != null ? entity.getReference() : null, EntitySelectionElement.ALL, SWT.NULL);
            text_microReference = formFactory.createTextWithLabelElement(formElement, "Reference Detail",
                    entity != null ? entity.getMicroReference() : null, SWT.NULL);
               element_date = formFactory.createTimePeriodElement(formElement, "Date",
                       entity != null ? entity.getTimeperiod() : null, style);
-              section_collectingAreas = formFactory.createGeoScopeDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(GeoScopeDetailSection.class, entity.getClass().getCanonicalName()));
+              section_collectingAreas = formFactory.createGeoScopeDetailSection(formElement, StoreUtil.getSectionStyle(GeoScopeDetailSection.class, entity.getClass().getCanonicalName()));
            section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            section_collectingAreas.setEntity(entity);
-
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == text_treeLabel) {
@@ -115,4 +77,16 @@ public class ClassificationDetailElement extends
             getEntity().setTimeperiod(element_date.getTimePeriod());
                }
        }
-}
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       text_treeLabel.setText(getEntity().getName().getText());
+                       selection_reference.setEntity(getEntity().getReference());
+                       text_microReference.setText(getEntity().getMicroReference());
+                       element_date.setEntity(getEntity().getTimeperiod()!= null? getEntity().getTimeperiod(): null);;
+                       section_collectingAreas.setEntity(getEntity());
+               }
+               
+       }
+}
\ No newline at end of file
index f4344cec35122f43c2994c09f1f61193527f7847..1a5544db0c37372817b18b7af24207bddc884cd7 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.classification;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,7 +22,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author n.hoffmann
  * @created Sep 27, 2010
- * @version 1.0
  */
 public class ClassificationDetailSection extends AbstractCdmDetailSection<Classification> {
 
@@ -31,40 +29,28 @@ public class ClassificationDetailSection extends AbstractCdmDetailSection<Classi
         * <p>Constructor for ClassificationDetailSection.</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 ClassificationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean)
-        */
-       /** {@inheritDoc} */
        @Override
        public void setEnabled(boolean enabled) {
 
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return null;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<Classification> createCdmDetailElement(AbstractCdmDetailSection<Classification> parentElement, int style) {
            return formFactory.createClassificationDetailElement(parentElement);
        }
-}
+}
\ No newline at end of file
index dc4b7afc49b62776a2b2101d761cbc3fef17fddb..070013b2b3c77ef39c9133552426cb103f870c24 100644 (file)
@@ -6,61 +6,30 @@
  * 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.classification;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 /**
- * <p>
- * ClassificationWizardPage class.
- * </p>
- *
  * @author n.hoffmann
  * @created 23.06.2009
- * @version 1.0
  */
 public class ClassificationWizardPage extends
                AbstractCdmEntityWizardPage<Classification> {
 
-       /**
-        * <p>
-        * Constructor for ClassificationWizardPage.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
-        */
        public ClassificationWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Classification entity) {
-               super(formFactory, conversation, entity);
+                       Classification entity) {
+               super(formFactory, entity);
                setTitle("Classification");
-
        }
 
-           /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement
-     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement)
-     */
-    /** {@inheritDoc} */
     @Override
     public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
         ClassificationDetailElement detailElement = formFactory.createClassificationDetailElement(rootElement);
         detailElement.setEntity(getEntity());
         return detailElement;
     }
-
-}
+}
\ No newline at end of file
index 55e7c2a219d2f22f56f85a347c23a8b31e736393..aa275cc2b85a6810aa019a9b7fc40defdf8f3788 100644 (file)
@@ -6,7 +6,6 @@
 * 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.classification;
 
 import javax.inject.Inject;
@@ -15,26 +14,19 @@ import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.widgets.Shell;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 
 /**
- *
  * @author pplitzner
  * @date Nov 6, 2016
- *
  */
-
 public class CloneClassificationWizard extends Wizard{
 
        private CloneClassificationWizardPage cloneClassificationWizardPage;
 
-    private ConversationHolder conversationHolder;
-
     private CdmFormFactory formFactory;
 
     private String classificationName;
@@ -49,17 +41,14 @@ public class CloneClassificationWizard extends Wizard{
     @Inject
     public CloneClassificationWizard() {
         super();
-        conversationHolder = CdmStore.createConversation();
-
     }
 
     public void init(Classification classification){
         formFactory = new CdmFormFactory(context.get(Shell.class).getDisplay());
-        cloneClassificationWizardPage = new CloneClassificationWizardPage(formFactory, conversationHolder, classification);
+        cloneClassificationWizardPage = new CloneClassificationWizardPage(formFactory, classification);
         addPage(cloneClassificationWizardPage);
     }
 
-
     @Override
     public boolean canFinish() {
         return cloneClassificationWizardPage.getClassificationName()!=null
@@ -75,7 +64,6 @@ public class CloneClassificationWizard extends Wizard{
         return true;
     }
 
-
     public String getClassificationName(){
         return classificationName;
     }
@@ -87,5 +75,4 @@ public class CloneClassificationWizard extends Wizard{
     public Reference getReference(){
         return reference;
     }
-
-}
+}
\ No newline at end of file
index 6019f7dc888ef2cbfd9a07bbbe04b692257bc546..b18df42f65516bad4814ab8b960c4001884b2f19 100644 (file)
@@ -9,7 +9,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.classification;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
@@ -29,9 +28,8 @@ public class CloneClassificationWizardPage extends
 
        private CloneClassificationDetailElement detailElement;
 
-    public CloneClassificationWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Classification entity) {
-               super(formFactory, conversation, entity);
+    public CloneClassificationWizardPage(CdmFormFactory formFactory, Classification entity) {
+               super(formFactory, entity);
                setTitle("Clone Classification");
        }
 
index 550e8d50ebf7dc1d7fa535b66608f0587482c925..ec3b3f9eae78881cf9c1977c9c372a6f43ce1e9d 100644 (file)
@@ -16,6 +16,7 @@ import java.util.Map;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.dto.MergeResult;
+import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.newWizard.IWizardPageListener;
@@ -49,18 +50,19 @@ public class EditTaxonNodeWizard
 
     @Override
     protected void saveEntity() {
-        getConversationHolder().bind();
         TaxonNode node = getEntity();
         if (node.getSource().checkEmpty()){
             node.setSource(null);
         }
         MergeResult result = CdmStore.getService(ITaxonNodeService.class).merge(node, true);
         EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, node.getTaxon().getUuid());
+        EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(node.getParent()));
+        
 
     }
     @Override
     public void addPages() {
-        taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getEntity(), wizardPageListener, false);
+        taxonNodePage = new TaxonNodeWizardPage(formFactory, getEntity(), wizardPageListener, false);
 
         addPage(taxonNodePage);
     }
index 2bac277ff17c4b59decf8d50b07130b0660ef5aa..f87081bb6f3d77cb61a76adeb3bb30e82f2b0f93 100644 (file)
@@ -12,9 +12,9 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -60,7 +60,7 @@ public class TaxonNodeAgentRelationCollectionElement extends AbstractEntityColle
             combo_relationshipType.setSelection(entity.getType());
             selection_toPerson.setEntity(entity.getAgent());
         }
-        
+
     }
 
     @Override
@@ -80,13 +80,11 @@ public class TaxonNodeAgentRelationCollectionElement extends AbstractEntityColle
         if (entity != null){
             selection_toPerson = formFactory
                     .createSelectionElement(TeamOrPersonBase.class,
-                            //getConversationHolder(),
                             element, "Agent", entity.getAgent(),
                             EntitySelectionElement.ALL, style);
         } else{
             selection_toPerson = formFactory
                     .createSelectionElement(TeamOrPersonBase.class,
-                            //getConversationHolder(),
                             element, "Agent", null,
                             EntitySelectionElement.ALL, style);
         }
index 7e6f275e7693ed3e917a0374f5beeec97161a9e6..08fe6d36d64a624fcb87037595fe06becfb12ae9 100644 (file)
@@ -13,7 +13,6 @@ import java.util.Comparator;
 
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -24,16 +23,12 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author k.luther
  * @date 22.03.2016
- *
  */
 public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityCollectionSection<TaxonNode, TaxonNodeAgentRelation> {
 
-
-
-    public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory, ConversationHolder conversation,
+    public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement,  "Related persons or teams", style);
-
+        super(formFactory, parentElement,  "Related persons or teams", style);
     }
 
     @Override
@@ -60,8 +55,6 @@ public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityColle
 
     @Override
     public void addElement(TaxonNodeAgentRelation element) {
-
-
     }
 
     @Override
@@ -82,25 +75,16 @@ public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityColle
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public TaxonNodeAgentRelation addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
 
-    /**
-     * @param i
-     */
     public void setIndent(int i) {
         TableWrapData tableWrapData = (TableWrapData)getLayoutData();
         if (tableWrapData == null){
@@ -108,7 +92,5 @@ public class TaxonNodeAgentRelationCollectionSection extends AbstractEntityColle
         }
         tableWrapData.indent = i;
         setLayoutData(tableWrapData);
-
     }
-
-}
+}
\ No newline at end of file
index 14047a96d92f6c5e968c416a9a31c70d0082a501..eaab161c2e0ae55f2279f98a0607888329304ed0 100644 (file)
@@ -130,19 +130,19 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
             textNewTaxonName.setIndent(10);
 
                selection_reuseExistingTaxon = formFactory
-                    .createSelectionElement(Taxon.class,//getConversationHolder(),
+                    .createSelectionElement(Taxon.class,
                             formElement,
                             REUSE_EXISTING_TAXON, null,
                             EntitySelectionElement.SELECTABLE, style);
                selection_reuseExistingTaxon.setIndent(10);
             selection_reuseExistingName = formFactory
-                    .createSelectionElement(TaxonName.class,//getConversationHolder(),
+                    .createSelectionElement(TaxonName.class,
                             formElement,
                             REUSE_EXISTING_NAME, taxon != null? taxon.getName(): null,
                             EntitySelectionElement.DELETABLE, style);
             selection_reuseExistingName.setIndent(10);
             selection_SecRef = formFactory
-                    .createSelectionElement(Reference.class,//getConversationHolder(),
+                    .createSelectionElement(Reference.class,
                             formElement, SECUNDUM_REFERENCE, taxon != null? taxon.getSec(): null,
                             EntitySelectionElement.DELETABLE, style, 100);
             selection_SecRef.setIndent(10);
@@ -166,7 +166,7 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
 //            nodeTitle.setBold();
 
             selection_parentTaxonNode = formFactory
-                    .createTaxonNodeSelectionElement(getConversationHolder(), formElement, Messages.TaxonNodeWizardPage_PARENT, parentNode,
+                    .createTaxonNodeSelectionElement(formElement, Messages.TaxonNodeWizardPage_PARENT, parentNode,
                             EntitySelectionElement.SELECTABLE, style, 100);
             selection_parentTaxonNode.setIndent(10);
             selection_parentTaxonNode.setEnabled(false);
@@ -256,7 +256,7 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
 
            setSourceLabel(Messages.TaxonNodeWizardPage_PLACEMENT_SOURCE);
 
-               selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), StoreUtil.getSectionStyle(TaxonNodeAgentRelationCollectionSection.class, entity.getClass().getCanonicalName()));
+               selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, StoreUtil.getSectionStyle(TaxonNodeAgentRelationCollectionSection.class, entity.getClass().getCanonicalName()));
                selectionNodeAgentRelation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         selectionNodeAgentRelation.setEntity(entity);
         selectionNodeAgentRelation.setIndent(10);
@@ -331,7 +331,7 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
                            }
                        }
                        if (checkbox_publish != null){
-                           checkbox_publish.setSelected(getTaxon().isPublish());
+                           checkbox_publish.setSelection(getTaxon().isPublish());
                        }
             }else{
                 if (isCreateNew()){
@@ -581,4 +581,31 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
         // TODO Auto-generated method stub
         return null;
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       if (selection_parentTaxonNode!= null) {
+                               selection_parentTaxonNode.setEntity(getEntity().getParent());
+                       }
+                       if (selection_reuseExistingTaxon != null) {
+                               selection_reuseExistingTaxon.setEntity(getEntity().getTaxon());
+                       }
+                       if (selection_reuseExistingName!= null) {
+                               selection_reuseExistingName.setEntity(getEntity().getTaxon() != null?getEntity().getTaxon().getName(): null);
+                       }
+                       if (selection_SecRef != null) {
+                               selection_SecRef.setEntity(getEntity().getTaxon() != null?getEntity().getTaxon().getSec(): null);
+                       }else {
+                               textTaxonSec.setText(getEntity().getTaxon() != null?getEntity().getTaxon().getSec().getTitle():null);
+                       }
+                       microReference.setText(getEntity().getTaxon() != null? getEntity().getTaxon().getSecMicroReference(): null);
+                       textNewTaxonName.setText(getEntity().getTaxon() != null? getEntity().getTaxon().getName().getTitleCache():null);
+                       selectionNodeAgentRelation.setEntity(getEntity());
+                       combo_status.setSelection(getEntity().getStatus());
+                       this.set_publish(taxon.isPublish());
+                       multiLanguageTextPlacementNotes.setMultilanguageText(getEntity().getStatusNote());
+               }
+               
+       }
 }
index 5b91134c49b6bc00b730788fbb6d501434d1ce03..ce4d4fa1017e1e3b35fbe04079b35dd87e6d038e 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.classification;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -31,21 +30,16 @@ public class TaxonNodeDetailSection extends AbstractCdmDetailSection<TaxonNode>
         * <p>Constructor for TaxonNodeDetailSection.</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 TaxonNodeDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return null;
index d1e6dcfa5a1b935f7488199879f8c41f41f4953d..45b3e198757abd9e3e63d1327ded512151fb4498 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.dto.CreateTaxonDTO;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -38,8 +37,8 @@ public class TaxonNodeWizardPage extends AbstractCdmEntityWizardPage<TaxonNode>
     private final boolean isCreateNew;
 
        public TaxonNodeWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, TaxonNode entity, IWizardPageListener closeOnEnterListener, boolean isCreateNew) {
-               super(formFactory, conversation, entity);
+                       TaxonNode entity, IWizardPageListener closeOnEnterListener, boolean isCreateNew) {
+               super(formFactory, entity);
                this.wizardPageListener = closeOnEnterListener;
 
                if (isCreateNew){
index e012e48c55187f26fa3eb4313ee18805718ee9d7..e2746bf3f27eae5eb3219754ef9918ce7e5ca486 100755 (executable)
@@ -13,7 +13,6 @@ import java.util.Comparator;
 
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.model.media.ExternalLink;
 import eu.etaxonomy.cdm.model.media.ExternalLinkType;
@@ -32,13 +31,13 @@ public class ExternalLinksSection extends AbstractEntityCollectionSection<Origin
 
     private boolean isShowDescription = true;
 
-    public ExternalLinksSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(cdmFormFactory, conversation, parentElement, "External Links", style);
+    public ExternalLinksSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+        super(cdmFormFactory, parentElement, "External Links", style);
     }
 
-    public ExternalLinksSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+    public ExternalLinksSection(CdmFormFactory cdmFormFactory,
             ICdmFormElement parentElement, boolean isAdvanced, String string, int style) {
-        super(cdmFormFactory, conversation, parentElement, string, style);
+        super(cdmFormFactory, parentElement, string, style);
         this.isShowDescription = isAdvanced;
     }
 
index 3bd579b14067a1ca63fb8d0231acdd84747880d4..ce28c85e2785a3b62415f1d19d3b19f0f3f98247 100644 (file)
@@ -34,7 +34,7 @@ public class ReferenceEntityDetailElement extends AbstractCdmDetailElement<Singl
        protected void createControls(ICdmFormElement formElement,
                        SingleSourcedEntityBase entity, int style) {
                selection_reference = formFactory
-                               .createSelectionElement(Reference.class,//getConversationHolder(),
+                               .createSelectionElement(Reference.class,
                                                 formElement, "Reference",
                                                entity.getCitation(),
                                                EntitySelectionElement.ALL, style);
@@ -53,4 +53,11 @@ public class ReferenceEntityDetailElement extends AbstractCdmDetailElement<Singl
                }
        }
 
+       @Override
+       public void fillFields() {
+               selection_reference.setEntity(getEntity().getCitation());
+               text_referenceDetail.setText(getEntity().getCitationMicroReference());
+               
+       }
+
 }
index 801af183d2350ff5b8fe021f7292ff9e63a5a81b..6c4c9a25fc9358ae7915fb39e8cc34a717b1414e 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.common;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,9 +23,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class ReferencedEntityDetailSection extends AbstractCdmDetailSection<SingleSourcedEntityBase>{
 
        public ReferencedEntityDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
index cad5a2fbf8654658e30f187a817d1ed39dbe2bc8..57a6fb0a149581dbeddae0626c980b5a5a1ef18d 100644 (file)
@@ -70,7 +70,7 @@ public class DerivedUnitElement extends
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_derivedUnit = formFactory.createSelectionElement(
-                               DerivedUnit.class, //getConversationHolder(),
+                               DerivedUnit.class,
                                element, "Specimen", null,
                                EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE,
                                style);
index 3000986c6e119c80bd48192f8d3ea4e6d70e758c..eb9102b65403a19e4f7be26f1a5a5efac7072ace 100644 (file)
@@ -6,7 +6,6 @@
 * 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;
 
 import java.util.ArrayList;
@@ -14,7 +13,6 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
@@ -25,29 +23,17 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>DescribedSpecimenSection class.</p>
- *
  * @author n.hoffmann
  * @created Sep 16, 2010
- * @version 1.0
  */
 public class DescribedSpecimenSection extends AbstractEntityCollectionSection<TaxonDescription, SpecimenOrObservationBase> {
 
-       /**
-        * <p>Constructor for DescribedSpecimenSection.</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 style a int.
-        */
        public DescribedSpecimenSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Described Specimen", style);
+               super(formFactory, parentElement, "Described Specimen", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<SpecimenOrObservationBase> getCollection(
                        TaxonDescription entity) {
@@ -65,51 +51,40 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
         return new DefaultCdmBaseComparator<>();
     }
 
-       /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createNewElement() {
-               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(), //getConversationHolder(),
+               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(),
                        null);
                return selection;
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(SpecimenOrObservationBase element) {
                getEntity().setDescribedSpecimenOrObservation(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(SpecimenOrObservationBase element) {
                getEntity().setDescribedSpecimenOrObservation(null);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No described specimen yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a described specimen.";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public SpecimenOrObservationBase addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 6073a1a1d5a9657a9dede065a2f3bd7419b57df0..c0025bddf7205a01ca74f6a646a0164b7c782095 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionType;
 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.TextWithLabelElement;
@@ -32,6 +33,7 @@ public class DescriptionDetailElement
 
 //     private EntitySelectionElement<FeatureTree> selection_featureTree;
     private TextWithLabelElement txtDescriptionTypes;
+    private CheckboxElement isPublish;
 
        public DescriptionDetailElement(CdmFormFactory cdmFormFactory,
                        ICdmFormElement formElement, int style) {
@@ -48,14 +50,15 @@ public class DescriptionDetailElement
                // Since descriptiveSystem is a Set of Features that are present or allowed for the current description,
                // it is similar to a FeatureTree (you can get this information from a feature tree) but not the same.
                // Please correct this once it is clear what descriptive system will be used for in CDM
-//             selection_featureTree = formFactory.createSelectionElement(FeatureTree.class, getConversationHolder(), formElement, "Feature Tree", null, EntitySelectionElement.ALL, style);
+//             selection_featureTree = formFactory.createSelectionElement(FeatureTree.class, formElement, "Feature Tree", null, EntitySelectionElement.ALL, style);
 
         Object typesString = entity.getTypes().stream().filter(type->type instanceof DescriptionType)
                        .map(type->((DescriptionType)type).getLabel())
                        .collect(Collectors.joining(","));
         txtDescriptionTypes = formFactory.createTextWithLabelElement(formElement, "Types", typesString, style);
         txtDescriptionTypes.setEnabled(false);
-
+        isPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style);
+       
        }
 
        @Override
@@ -95,6 +98,10 @@ public class DescriptionDetailElement
             getEntity().setTitleCache(toggleable_cache.getText(), toggleable_cache.getState());
             updateCacheRelevance();
         }
+        if (eventSource == isPublish) {
+            getEntity().setPublish(isPublish.getSelection());
+        }
+       
        }
 
 
index dd4d708976137f1cd69bfac8250666f9e87e48a8..36a0a115f47b5d7f0a8e04dd8b02dd8e7ed562a3 100644 (file)
@@ -6,12 +6,10 @@
 * 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;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -20,26 +18,14 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- * <p>DescriptionDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 5, 2010
  */
 public class DescriptionDetailSection extends AbstractCdmDetailSection<DescriptionBase<?>> {
 
-       /**
-        * <p>Constructor for DescriptionDetailSection.</p>
-        *
-        * @param cdmFormFactory 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 DescriptionDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public DescriptionDetailSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
-
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -61,4 +47,4 @@ public class DescriptionDetailSection extends AbstractCdmDetailSection<Descripti
                this.getDetailElement().setEnabled(false);
            }
        }
-}
+}
\ No newline at end of file
index 9a044ea82655010d0b39d73cd07cedaf991f4ebe..0d99764aa1cf61f7fbbfa8f8b5ac7567d38c39f1 100644 (file)
@@ -73,4 +73,10 @@ public class DescriptionElementDetailElement extends
         }
         setEnabled(enabled, except);
     }
+
+       @Override
+       public void fillFields() {
+               // TODO actually not used
+               
+       }
 }
index db066148025bcd3b9e0489eac564a7a3dcd6ed3e..502189a1434d4e88a305e219f381af6b63db99a5 100644 (file)
@@ -6,7 +6,6 @@
 * 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;
 
 import org.eclipse.e4.ui.di.UISynchronize;
@@ -18,7 +17,6 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.TextData;
@@ -29,10 +27,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.section.description.operation.ChangeDescriptionElementType;
 import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
 
@@ -41,28 +37,16 @@ import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4;
  *
  * @author n.hoffmann
  * @created Mar 5, 2010
- * @version 1.0
  */
 public class DescriptionElementDetailSection extends
                AbstractCdmDetailSection<DescriptionElementBase> {
 
 
-
-       /**
-        * <p>Constructor for DescriptionElementDetailSection.</p>
-        *
-        * @param cdmFormFactory 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 DescriptionElementDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public DescriptionElementDetailSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
-
        @Override
     protected Control createToolbar() {
 
@@ -73,9 +57,7 @@ public class DescriptionElementDetailSection extends
                final String label = "Change to " + destinationString;
 
                Action addAction = new Action("Change Type", IAction.AS_PUSH_BUTTON) {
-                       /* (non-Javadoc)
-                        * @see org.eclipse.jface.action.Action#run()
-                        */
+
                        @Override
                        public void run() {
                                boolean confirmed = MessagingUtils.confirmDialog("Confirmation", "Do you really want to change to "
@@ -105,13 +87,11 @@ public class DescriptionElementDetailSection extends
                return toolBarManager.createControl(this);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Description Element";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void setSectionTitle() {
                this.setText(getHeading() + ": " + getEntity().getFeature().getPreferredRepresentation(CdmStore.getDefaultLanguage()));
@@ -136,9 +116,6 @@ public class DescriptionElementDetailSection extends
            return count > 1;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<DescriptionElementBase> createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {
            return formFactory.createDescriptionElementDetailElement(parentElement, style);
@@ -151,8 +128,5 @@ public class DescriptionElementDetailSection extends
             isEnabled = false;
         }
         setEnabled(isEnabled);
-
     }
-
-
-}
+}
\ No newline at end of file
index 6ec488c7900598ece58f241752869cfed0865fb5..4ed2ce151c1c5206e55af58c9513fe79115e73cc 100644 (file)
@@ -6,13 +6,11 @@
 * 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;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.media.Media;
@@ -23,21 +21,17 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>DescriptionElementMediaSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 18, 2010
- * @version 1.0
  */
 public class DescriptionElementMediaSection extends
                AbstractEntityCollectionSection<DescriptionElementBase, Media> {
 
-       public DescriptionElementMediaSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public DescriptionElementMediaSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Media", style);
+               super(cdmFormFactory, parentElement, "Media", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void setEntity(DescriptionElementBase entity) {
                if(entity.getFeature().equals(Feature.IMAGE())){
@@ -49,19 +43,16 @@ public class DescriptionElementMediaSection extends
                }
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(Media element) {
                getEntity().addMedia(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Media createNewElement() {
                return Media.NewInstance();
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<Media> getCollection(DescriptionElementBase entity) {
                return entity.getMedia();
@@ -72,39 +63,28 @@ public class DescriptionElementMediaSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No media yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create new media";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(Media element) {
                getEntity().removeMedia(element);
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Media addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-
-}
+}
\ No newline at end of file
index 29c949c7a6b8d50da86064525f1f76f1c972283a..28b5060a80bedf7529f70a3f66d7b229b56499d1 100644 (file)
@@ -8,20 +8,27 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.description;
 
+import java.util.Iterator;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 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.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
 import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.OriginalSourceElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
@@ -50,8 +57,8 @@ public class DescriptionElementSourceElement extends
                                .createSelectionElement(TaxonName.class,
                                        formElement, "Name in Source",
                                                null, EntitySelectionElement.ALL, SWT.NULL);
-
-               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+               
+               externalLinks = formFactory.createExternalLinksSection(formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         if (getEntity() != null){
                setEntity(entity);
@@ -61,7 +68,7 @@ public class DescriptionElementSourceElement extends
        @Override
        public void setEntity(DescriptionElementSource entity) {
                super.setEntity(entity);
-               if (selection_reference != null){
+               if (selection_reference != null ){
                        if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
                            text_idInSource.setText(entity.getIdInSource());
                        }
@@ -73,9 +80,14 @@ public class DescriptionElementSourceElement extends
                        text_referenceDetail.setText(entity.getCitationMicroReference());
                        text_originalInfo.setText(entity.getOriginalInfo());
                        selection_name.setEntity(entity.getNameUsedInSource());
+                       
                        combo_origsourcetype.setSelection(entity.getType());
                        externalLinks.setEntity(entity);
                }
+               if (selection_specimen != null) {
+                       selection_specimen.setEnabled(selection_reference.getEntity()== null);
+                       selection_reference.setEnabled(selection_specimen.getEntity()== null);
+               }
        }
 
        @Override
@@ -86,6 +98,15 @@ public class DescriptionElementSourceElement extends
            super.handleEvent(eventSource);
         if (eventSource == selection_name) {
             getEntity().setNameUsedInSource(selection_name.getSelection());
+           
+        }
+        if (eventSource == selection_specimen) {
+            getEntity().setSpecimen(selection_specimen.getSelection());
+            this.selection_reference.setEnabled(selection_specimen.getSelection() == null);
+        }
+        if (eventSource == selection_reference) {
+
+            this.selection_specimen.setEnabled(selection_reference.getSelection() == null);
         }
        }
 
@@ -93,5 +114,10 @@ public class DescriptionElementSourceElement extends
        public void setEnabled(boolean enabled) {
                super.setEnabled(enabled);
                externalLinks.setEnabled(isEnabled);
+               if (selection_specimen != null) {
+                       selection_specimen.setEnabled(selection_reference.getEntity()== null);
+                       selection_reference.setEnabled(selection_specimen.getEntity()== null);
+               }
        }
+        
 }
\ No newline at end of file
index fbc7aa7d0f88a7f8c04d68ad8c4620f3a60dae96..ebaad77f58f7fc16a871eb66f72b36d55aa95fe7 100644 (file)
@@ -15,13 +15,9 @@ import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 
-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 eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
@@ -34,8 +30,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * DescriptionElementSourceSection class.
- *
  * @author n.hoffmann
  * @created Nov 17, 2009
  */
@@ -44,14 +38,14 @@ public class DescriptionElementSourceSection extends
 
     private Reference defaultSource;
 
-    public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+    public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory,
             ICdmFormElement parentElement, int style) {
-        super(cdmFormFactory, conversation, parentElement, "Sources", style);
+        super(cdmFormFactory, parentElement, "Sources", style);
     }
 
-    public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+    public DescriptionElementSourceSection(CdmFormFactory cdmFormFactory,
             ICdmFormElement parentElement, Reference defaultSource, int style) {
-        super(cdmFormFactory, conversation, parentElement, "Sources", style);
+        super(cdmFormFactory, parentElement, "Sources", style);
         this.defaultSource = defaultSource;
     }
 
@@ -79,7 +73,7 @@ public class DescriptionElementSourceSection extends
        }
     @Override
     protected void renderContent(boolean forceExpansion){
-       
+
                Collection<OriginalSourceBase> collectionElement = getCollectionElement(getEntity());
                Collection<OriginalSourceBase> collectionDescription = getCollectionDescription(getEntity());
 
@@ -94,14 +88,14 @@ public class DescriptionElementSourceSection extends
                }
 
                this.setExpanded(forceExpansion);
-               
 
-               
-               
+
+
+
                if(collectionDescription != null && !collectionDescription.isEmpty()){
                        List<OriginalSourceBase> elements = new ArrayList<>(collectionDescription);
                    Collections.sort(elements, getComparator());
-                   createDynamicContentsDisabled(elements);                    
+                   createDynamicContentsDisabled(elements);
                        forceExpansion = true;
                }
 
@@ -121,7 +115,9 @@ public class DescriptionElementSourceSection extends
     }
     public Collection<OriginalSourceBase> getCollectionElement(DescriptionElementBase entity) {
         Collection<OriginalSourceBase> sources = new HashSet<>();
-        sources.addAll(entity.getSources());
+        if (entity != null) {
+            sources.addAll(entity.getSources());
+        }
 //        sources.addAll(entity.getInDescription().getSources());
 
         return sources;
@@ -172,10 +168,10 @@ public class DescriptionElementSourceSection extends
            sources.addAll(entity.getSources());
            sources.addAll(entity.getInDescription().getSources());
            return sources;
-           
+
        }
-       
-       
+
+
        private void createDynamicContentsDisabled(Collection<OriginalSourceBase> elements)
        {
                int i = 0;
index 94ee45fd026387b84b3420c675658fe263b9f713..cabb22af50a3eb9c2e129b65aed3ce10ac8fef73 100644 (file)
@@ -6,61 +6,42 @@
 * 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;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
-import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
+import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 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.DefaultCdmBaseComparator;
 
 /**
- * <p>DescriptionSourceSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 18, 2010
- * @version 1.0
  */
 public class DescriptionSourceSection extends
                AbstractEntityCollectionSection<DescriptionBase, IdentifiableSource>{
 
-       /**
-        * <p>Constructor for DescriptionSourceSection.</p>
-        *
-        * @param cdmFormFactory 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 style a int.
-        */
-       public DescriptionSourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public DescriptionSourceSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Sources", style);
+               super(cdmFormFactory, parentElement, "Sources", style);
        }
 
-
-
-       /** {@inheritDoc} */
        @Override
        public void addElement(IdentifiableSource element) {
                getEntity().addSource(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public IdentifiableSource createNewElement() {
                OriginalSourceType ost = OriginalSourceType.PrimaryTaxonomicSource;
                return IdentifiableSource.NewInstance(ost);
-
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<IdentifiableSource> getCollection(DescriptionBase entity) {
                return entity.getSources();
@@ -71,41 +52,28 @@ public class DescriptionSourceSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No description sources yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a reference as source for this description";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(IdentifiableSource element) {
                getEntity().removeSource(element);
        }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public IdentifiableSource addExisting() {
         return null;
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 60533aade97f84a17ebc2098aa1f6548158f6b60..93da40ad4929dfc83db13145fc96b27cb7cec1a6 100644 (file)
@@ -6,13 +6,11 @@
 * 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;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -21,28 +19,16 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>GeoScopeSection class.</p>
- *
  * @author n.hoffmann
  * @created Sep 17, 2010
- * @version 1.0
  */
 public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescription, NamedArea> {
 
-       /**
-        * <p>Constructor for GeoScopeSection.</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 style a int.
-        */
        public GeoScopeSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Geo Scope", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Geo Scope", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<NamedArea> getCollection(TaxonDescription entity) {
                return entity.getGeoScopes();
@@ -53,49 +39,38 @@ public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescri
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public NamedArea createNewElement() {
                return NamedArea.NewInstance();
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(NamedArea element) {
                getEntity().addGeoScope(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(NamedArea element) {
                getEntity().removeGeoScope(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No geo scopes yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a new geo scope.";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public NamedArea addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 4b699512a8320298d9e0fb471dbed4b3214dad22..e27cd8625e05870f477c2025703ff7ae112eae32 100644 (file)
@@ -14,7 +14,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,8 +23,6 @@ import eu.etaxonomy.taxeditor.ui.section.media.MediaMetaElement;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaViewSwitch;
 
 /**
- * MediaDetailsSection class.
- *
  * @author n.hoffmann
  * @created Jun 15, 2010
  */
@@ -33,10 +30,10 @@ public class MediaDetailsSection extends AbstractCdmDetailSection<Media> {
 
     private MediaMetaElement mediaMetaElement;
 
-       public MediaDetailsSection(CdmFormFactory formFactory, ConversationHolder conversation,
+       public MediaDetailsSection(CdmFormFactory formFactory,
                        ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
index 5c0abf299f34100089822122215c22935f6bfaa7..81902239145e531af861a34addaf7610e27febc2 100644 (file)
@@ -9,18 +9,22 @@
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
 import org.eclipse.swt.events.SelectionListener;
 
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IModifiable;
 import eu.etaxonomy.cdm.model.description.StateData;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.taxeditor.model.DefaultTermComparator;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -55,39 +59,40 @@ public class ModifierElement extends AbstractEntityCollectionElement<DefinedTerm
        @Override
        public void setEntity(DefinedTerm entity) {
                this.entity = entity;
-               if (combo_modifier != null){
-                       if(getParentElement() instanceof ModifierSection){
-                           ModifierSection parentSection = (ModifierSection) getParentElement();
-                           List<DefinedTerm> modifierTerms = new ArrayList<DefinedTerm>();
-                   Set<TermVocabulary<DefinedTerm>> recommendedModifierEnumeration = new HashSet<TermVocabulary<DefinedTerm>>();
-                           if(parentSection.getEntity() instanceof StateData){
-                               StateData stateData = (StateData) parentSection.getEntity();
-                               recommendedModifierEnumeration = stateData.getCategoricalData().getFeature().getRecommendedModifierEnumeration();
-                           }else if(parentSection.getEntity() instanceof StatisticalMeasurementValue){
-                               StatisticalMeasurementValue statisticalMeasurementValue = (StatisticalMeasurementValue)parentSection.getEntity();
-                               recommendedModifierEnumeration = statisticalMeasurementValue.getQuantitativeData().getFeature().getRecommendedModifierEnumeration();
-                           }
-                           if (!(parentSection.getParentElement() instanceof DescriptionElementBase) && parentSection.getEntity() instanceof DescriptionElementBase){
-                               DescriptionElementBase element = (DescriptionElementBase) parentSection.getEntity();
-                       recommendedModifierEnumeration = element.getFeature().getRecommendedModifierEnumeration();
-       
-                           }
-       
-                           for (TermVocabulary<DefinedTerm> termVocabulary : recommendedModifierEnumeration) {
-                               modifierTerms.addAll(termVocabulary.getTerms());
-                           }
-                           combo_modifier.setTerms(modifierTerms);
-                       }
-               if(entity!=null && entity.getId()>0){
-                   combo_modifier.setSelection(entity);
-                   combo_modifier.removeEmptyElement();
-               }
-               }
        }
 
        @Override
        public void createControls(ICdmFormElement element, int style) {
-               combo_modifier = formFactory.createDefinedTermComboElement(TermType.Modifier, element, "Modifier", getEntity(), style);
+           ICdmFormElement parent = getParentElement();
+           Set<TermCollection<DefinedTerm, ?>> recommendedModifiers = null;
+           if (parent instanceof ModifierSection){
+               IModifiable modifiableEntity = ((ModifierSection)parent).getEntity();
+               if (modifiableEntity.isInstanceOf(StateData.class)){
+                   StateData stateData = CdmBase.deproxy(modifiableEntity, StateData.class);
+                   recommendedModifiers = stateData.getCategoricalData().getFeature().getRecommendedModifierEnumeration();
+               }
+           }
+           String labelString = "Modifier";
+           if (recommendedModifiers != null){
+               //TODO is there already a method somewhere that creates such a list
+               Set<DefinedTerm> terms = new HashSet<>();
+               for (TermCollection<DefinedTerm, ?> collection: recommendedModifiers){
+                   terms.addAll(collection.getDistinctTerms());
+               }
+               List<DefinedTerm> termList = new ArrayList<>(terms);
+               Collections.sort(termList, new DefaultTermComparator<>());
+               if (getEntity() == null) {
+                   combo_modifier = formFactory.createDefinedTermComboElement(termList, element, labelString, getEntity(), true, style);
+               }else {
+                   combo_modifier = formFactory.createDefinedTermComboElement(termList, element, labelString, getEntity(), false, style);
+               }
+           }else{
+               if (getEntity() == null) {
+                   combo_modifier = formFactory.createDefinedTermComboElement(TermType.Modifier, element, labelString, getEntity(), true, style);
+               }else {
+                   combo_modifier = formFactory.createDefinedTermComboElement(TermType.Modifier, element, labelString, getEntity(), false, style);
+               }
+           }
        }
 
        @Override
index 9a28dafa192e4dd4df97052eacdebb541e90d4c3..dd98795e8bcf15628166fc82f8aa5ccd838c915b 100644 (file)
@@ -6,76 +6,55 @@
 * 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;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.description.IModifiable;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
 
 /**
- * <p>ModifierSection class.</p>
- *
  * @author n.hoffmann
  * @created Sep 15, 2010
- * @version 1.0
  */
 public class ModifierSection extends AbstractUnboundEntityCollectionSection<IModifiable, DefinedTerm> {
 
-       /**
-        * <p>Constructor for ModifierSection.</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 style a int.
-        */
        public ModifierSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Modifiers", style);
+               super(formFactory, parentElement, "Modifiers", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public DefinedTerm createNewElement() {
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(DefinedTerm element) {
                getEntity().addModifier(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(DefinedTerm element) {
                getEntity().removeModifier(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No modifiers yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a modifier.";
        }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
     @Override
     protected Collection<DefinedTerm> getEntityCollection(IModifiable entity) {
         return entity.getModifiers();
@@ -86,19 +65,13 @@ public class ModifierSection extends AbstractUnboundEntityCollectionSection<IMod
         return new DefaultCdmBaseComparator<>();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DefinedTerm addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 183063936ed9de47bb5b2d14de337dc912921b5e..a3ca50ababb47bf81778d53a766e1141458410be 100644 (file)
@@ -12,7 +12,6 @@ import java.util.List;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
-
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -33,14 +32,12 @@ import eu.etaxonomy.taxeditor.ui.element.LabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>NaturalLanguageDetailElement class.</p>
- *
  * @author n.hoffmann
  * @created Sep 16, 2010
  */
 public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<TaxonDescription> {
 
-       private static final Logger logger = LogManager.getLogger(NaturalLanguageDetailElement.class);
+       private static final Logger logger = LogManager.getLogger();
 
        private LabelElement label;
 
@@ -69,10 +66,6 @@ public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<Taxon
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
                // nothing gets edited, nothing gets updated
@@ -95,7 +88,6 @@ public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<Taxon
                        String text = "";
 
                        if(featureTree != null){
-                               CdmStore.createConversation();
                                try{
                                        List<TextData> naturalLanguageDescription = generator.generateNaturalLanguageDescription(featureTree, entity, CdmStore.getDefaultLanguage());
 
@@ -128,4 +120,15 @@ public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<Taxon
                }
 
        }
+
+       @Override
+       public void fillFields() {
+               if(getEntity().hasStructuredData()){
+                       FetchNaturalLanguageDescriptionJob job = new FetchNaturalLanguageDescriptionJob("Retrieving Natural Language Description", getEntity());
+                       job.schedule();
+               }else{
+                       label.setText("Taxon Description does not contain structured data.");
+               }
+               
+       }
 }
index 978a79a263ea1a548ac8e85a99eaf121d7665a39..7315685aed0b0fda38f347d6c87ca13d376b2ad6 100644 (file)
@@ -6,12 +6,10 @@
 * 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;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -19,11 +17,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- * <p>NaturalLanguageSection class.</p>
- *
  * @author n.hoffmann
  * @created Sep 16, 2010
- * @version 1.0
  */
 public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescription> {
 
@@ -31,31 +26,23 @@ public class NaturalLanguageSection extends AbstractCdmDetailSection<TaxonDescri
         * <p>Constructor for NaturalLanguageSection.</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 NaturalLanguageSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Natural Language Description";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<TaxonDescription> createCdmDetailElement(AbstractCdmDetailSection<TaxonDescription> parentElement, int style) {
            return formFactory.createNaturalLanguageDetailElement(parentElement);
        }
-}
+}
\ No newline at end of file
index ad9a31dd2061bbe522cb9412918b6aa628ce9b37..310a44b8915b6360d53a09f686f3e9c74b82b03e 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.description;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -20,24 +19,13 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
 
 /**
- * <p>ScopeSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 18, 2010
- * @version 1.0
  */
 public class ScopeSection extends AbstractUnboundEntityCollectionSection<TaxonDescription, DefinedTerm> {
 
-       /**
-        * <p>Constructor for ScopeSection.</p>
-        *
-        * @param cdmFormFactory 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 style a int.
-        */
-       public ScopeSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Scope", style);
+       public ScopeSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Scope", style);
        }
 
        @Override
@@ -45,7 +33,6 @@ public class ScopeSection extends AbstractUnboundEntityCollectionSection<TaxonDe
                getEntity().addScope(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public DefinedTerm createNewElement() {
                return null;
index eefc698991ea61cc1ec5fb688456275b74dd33ac..da354f008dceddeb50d4a1912fc9cf3ed9e2620f 100644 (file)
@@ -41,7 +41,6 @@ public class SourceComparator  <T extends OriginalSourceBase> implements Compara
         if (o2.isInstanceOf(DescriptionElementSource.class)){
             isDescriptionElementSource2 = true;
         }
-
         if (isDescriptionElementSource1 != isDescriptionElementSource2){
             if (isDescriptionElementSource1){
                 return -1;
@@ -51,9 +50,9 @@ public class SourceComparator  <T extends OriginalSourceBase> implements Compara
         }
 
         // the newly created should always be on top
-        if (!o1.isPersited() && o2.isPersited()) {
+        if (!o1.isPersisted() && o2.isPersisted()) {
             return -1;
-        } else if(o1.isPersited() && !o2.isPersited()){
+        } else if(o1.isPersisted() && !o2.isPersisted()){
             return 1;
         }
 
index 857ab0a6626c0c6032bfff74689669a65a16945b..edaad6d1f7577294581a3dbb861f1628cb3caedd 100644 (file)
@@ -12,14 +12,16 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.description.State;
 import eu.etaxonomy.cdm.model.description.StateData;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -37,83 +39,109 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
  */
 public class StateDataElement extends AbstractEntityCollectionElement<StateData> {
 
-       private TermComboElement<State> combo_state;
-       private ModifierSection section_modifiers;
-       private TextWithLabelElement text_modifyingText;
+    private TermComboElement<DefinedTermBase<?>> combo_state;
+    private ModifierSection section_modifiers;
+    private TextWithLabelElement text_modifyingText;
 
-       public StateDataElement(CdmFormFactory formFactory,
-                       AbstractFormSection section, StateData entity,
-                       SelectionListener removeListener, int style) {
-               super(formFactory, section, entity, removeListener, null, style);
-       }
+    public StateDataElement(CdmFormFactory formFactory, AbstractFormSection<?> section, StateData entity,
+            SelectionListener removeListener, int style) {
+        super(formFactory, section, entity, removeListener, null, style);
+    }
 
-       @Override
-       public void setEntity(StateData entity) {
-               this.entity = entity;
-               if (combo_state != null){
-                       
-                       combo_state.setSelection(entity.getState());
-                       if (section_modifiers != null){
-                       section_modifiers.setEntity(entity);
-                       section_modifiers.setExpanded(!entity.getModifiers().isEmpty());
-                       }
-                       if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null && text_modifyingText != null) {
-                   text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
-               }
-                       if(getEntity().getId()>0){
-                           combo_state.removeEmptyElement();
-                       }
-               }
-       }
+    @Override
+    public void setEntity(StateData entity) {
+        this.entity = entity;
+        if (combo_state != null) {
 
-       @Override
-       public void createControls(ICdmFormElement element, int style) {
-               if (getEntity() != null){
-                       List<State> stateTerms = new ArrayList<>();
-                       Set<TermVocabulary<State>> stateVocabularies = getEntity().getCategoricalData().getFeature().getSupportedCategoricalEnumerations();
-                       for (TermVocabulary<State> termVocabulary : stateVocabularies) {
-                           stateTerms.addAll(termVocabulary.getTerms());
-               }
-                       combo_state = formFactory.createDefinedTermComboElement(stateTerms, element, "State", null, style);
-               }else{
-                       combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style);
-               }
-//             combo_state.setTermComparator(new DefaultTermComparator<State>());
-               if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifier.getKey())){
-                   section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, StoreUtil.getSectionStyle(ModifierSection.class, StateData.class.getCanonicalName(), true));
-                   section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               }
-               if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifierFreeText.getKey())){
-                   text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
-               }
-               if (entity != null){
-                       setEntity(entity);
-               }
+            combo_state.setSelection(entity.getState());
+            if (section_modifiers != null) {
+                section_modifiers.setEntity(entity);
+                section_modifiers.setExpanded(!entity.getModifiers().isEmpty());
+            }
+            if (getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null
+                    && text_modifyingText != null) {
+                text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+            }
+            if (getEntity().getId() > 0) {
+                combo_state.removeEmptyElement();
+            }
+        }
+    }
 
-       }
+    @Override
+    public void createControls(ICdmFormElement element, int style) {
+        if (getEntity() != null) {
+            List<DefinedTermBase<?>> stateTerms = new ArrayList<>();
+            Set<TermCollection<?, ?>> recommendedStateCollections = getEntity().getCategoricalData().getFeature()
+                    .getSupportedCategoricalEnumerations();
+            for (TermCollection<?, ?> stateCollection : recommendedStateCollections) {
+                stateTerms.addAll((Set) stateCollection.getDistinctTerms());
+            }
+            // stateTerms.add(null)
+            combo_state = formFactory.createDefinedTermComboElement(stateTerms, element, "State", null, style);
+        } else {
+            combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style);
+        }
+        // combo_state.setTermComparator(new DefaultTermComparator<State>());
 
-       @Override
-       public void handleEvent(Object eventSource) {
-               if(eventSource == combo_state){
-                       getEntity().setState(combo_state.getSelection());
-                       combo_state.removeEmptyElement();
-               }
-               if(eventSource == text_modifyingText){
-                       getEntity().putModifyingText(LanguageString.NewInstance(text_modifyingText.getText(), CdmStore.getDefaultLanguage()));
-               }
-       }
+        if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifier.getKey()) && (!CdmUtils.isNullSafeEmpty(entity.getCategoricalData().getFeature().getRecommendedModifierEnumeration()))) {
+            section_modifiers = formFactory.createModifierSection(element,
+                    StoreUtil.getSectionStyle(ModifierSection.class, StateData.class.getCanonicalName(), true));
+            section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        }else if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifier.getKey()) && CdmUtils.isNullSafeEmpty(entity.getCategoricalData().getFeature().getRecommendedModifierEnumeration()) && !CdmUtils.isNullSafeEmpty(entity.getModifiers())) {
+            List<DefinedTermBase> terms = new ArrayList<>();
+            terms.addAll(entity.getModifiers());
+            for(DefinedTermBase term: terms) {
+                List<DefinedTermBase> termList = new ArrayList<>();
+                termList.add(term);
+                TermComboElement<DefinedTermBase> combo_modifier= formFactory.createDefinedTermComboElement(termList, element, "Modifier", term, style);
+                combo_modifier.addSelectionListener(new SelectionListener() {
 
-       @Override
-    public void setEnabled(boolean enable){
-               if (combo_state != null){
-                       combo_state.setEnabled(enable);
-               }
-           if (section_modifiers != null){
-               section_modifiers.setEnabled(enable);
-           }
-           if (text_modifyingText != null){
-               text_modifyingText.setEnabled(enable);
-           }
-           super.setEnabled(enable);
-       }
+                    @Override
+                    public void widgetSelected(SelectionEvent e) {
+                        if (combo_modifier.getSelection() == null) {
+                            getEntity().getModifiers().remove(term);
+                        }
+                    }
+
+                    @Override
+                    public void widgetDefaultSelected(SelectionEvent e) {
+                    }
+                });
+            }
+        }
+        if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifierFreeText.getKey())) {
+            text_modifyingText = formFactory.createTextWithLabelElement(element, "Modifying Text", null, style);
+        }
+        if (entity != null) {
+            setEntity(entity);
+        }
+
+    }
+
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == combo_state) {
+            getEntity().setState(combo_state.getSelection());
+            combo_state.removeEmptyElement();
+        }
+        if (eventSource == text_modifyingText) {
+            getEntity().putModifyingText(
+                    LanguageString.NewInstance(text_modifyingText.getText(), CdmStore.getDefaultLanguage()));
+        }
+    }
+
+    @Override
+    public void setEnabled(boolean enable) {
+        if (combo_state != null) {
+            combo_state.setEnabled(enable);
+        }
+        if (section_modifiers != null) {
+            section_modifiers.setEnabled(enable);
+        }
+        if (text_modifyingText != null) {
+            text_modifyingText.setEnabled(enable);
+        }
+        super.setEnabled(enable);
+    }
 }
index 898f56d742bf09a476e8516c95df6658866d8ca4..1775bf9caac49dac4bea66fbca1042416879f922 100644 (file)
@@ -11,9 +11,11 @@ package eu.etaxonomy.taxeditor.ui.section.description;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.StateData;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
@@ -27,9 +29,9 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 public class StateDataSection extends AbstractEntityCollectionSection<CategoricalData, StateData> implements IEnableableFormElement {
 
        public StateDataSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "State Data", style);
+               super(formFactory, parentElement, "State Data", style);
        }
 
        @Override
@@ -76,4 +78,14 @@ public class StateDataSection extends AbstractEntityCollectionSection<Categorica
     public boolean allowAddExisting() {
         return false;
     }
+    @Override
+    protected void updateToolbar() {
+
+        if( !(getEntity() instanceof CdmBase) || (getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), getUpdate())) && isEnabled()
+                && (this.getEntity().getFeature().getMaxStates() == null || this.getEntity().getFeature().getMaxStates() > this.getEntity().getStateData().size())){
+            showToolbar();
+        } else {
+            removeToolbar();
+        }
+    }
 }
\ No newline at end of file
index aa5a13019965b3e686e5487b0148104b343a2d71..f2ad9598a69a0636302e7ab97c339ddb89f86782 100644 (file)
@@ -15,6 +15,7 @@ import java.util.Set;
 
 import org.eclipse.swt.events.SelectionListener;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
 import eu.etaxonomy.cdm.model.term.TermType;
@@ -24,7 +25,6 @@ import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.BigDecimalWithLabelElement;
 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.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 
@@ -64,7 +64,9 @@ public class StatisticalMeasurementValueElement extends
                combo_type.setTerms(new ArrayList<StatisticalMeasure>(statisiticalMeasures));
                        combo_type.setSelection(entity.getType());
                        number_value.setNumber(entity.getValue());
-                       section_modifiers.setEntity(entity);
+                       if (section_modifiers != null) {
+                           section_modifiers.setEntity(entity);
+                       }
                }
        }
 
@@ -72,8 +74,10 @@ public class StatisticalMeasurementValueElement extends
        public void createControls(ICdmFormElement element, int style) {
                number_value = formFactory.createBigDecimalTextWithLabelElement(element, "Value", 0, style);
                combo_type = formFactory.createDefinedTermComboElement(TermType.StatisticalMeasure, element, "Statistical Measure", null, style);
-               section_modifiers = formFactory.createModifierSection(getConversationHolder(), element, StoreUtil.getSectionStyle(ModifierSection.class, StatisticalMeasurementValue.class.getCanonicalName()));
-               section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               if (!CdmUtils.isNullSafeEmpty(entity.getQuantitativeData().getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
+                   section_modifiers = formFactory.createModifierSection(element, StoreUtil.getSectionStyle(ModifierSection.class, StatisticalMeasurementValue.class.getCanonicalName()));
+                   section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               }
                if (entity != null){
                        setEntity(entity);
                }
@@ -104,7 +108,7 @@ public class StatisticalMeasurementValueElement extends
 //     }
 //
 //     @Override
-//     public boolean isEnabled() {            
+//     public boolean isEnabled() {
 //             return combo_type.isEnabled();
 //     }
 }
index 1d6566dd5ef7d4004e215afb62390bd074327433..a3ac8d28bda0b57b8c4c8208b73b643de487ef53 100644 (file)
@@ -6,13 +6,11 @@
 * 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;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -26,26 +24,16 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  *
  * @author n.hoffmann
  * @created Sep 15, 2010
- * @version 1.0
  */
 public class StatisticalMeasurementValueSection extends
                AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> implements IEnableableFormElement{
 
-       /**
-        * <p>Constructor for StatisticalMeasurementValueSection.</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 style a int.
-        */
        public StatisticalMeasurementValueSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
+               super(formFactory, parentElement, "Statistical Measurement Value", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<StatisticalMeasurementValue> getCollection(
                        QuantitativeData entity) {
@@ -57,49 +45,38 @@ public class StatisticalMeasurementValueSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public StatisticalMeasurementValue createNewElement() {
                return StatisticalMeasurementValue.NewInstance();
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(StatisticalMeasurementValue element) {
                getEntity().addStatisticalValue(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(StatisticalMeasurementValue element) {
                getEntity().removeStatisticalValue(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No statistical values yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create new statistical value";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public StatisticalMeasurementValue addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 44790206e9c4d403555f5bbf6cdeedffa65c1907..c99f7a01eefcfd0d75db09b4746b71101e383848 100644 (file)
@@ -32,9 +32,9 @@ import eu.etaxonomy.taxeditor.ui.section.description.ModifierSection;
  */
 public abstract class AbstractDetailedDescriptionDetailElement<T extends DescriptionElementBase> extends AbstractCdmDetailElement<T>{
 
-    TimePeriodElement timePeriod;
-    ModifierSection section_modifiers;
-    TextWithLabelElement text_modifyingText;
+    private TimePeriodElement timePeriod;
+    private ModifierSection section_modifiers;
+    private TextWithLabelElement text_modifyingText;
 
        /**
         * <p>Constructor for AbstractDetailedDescriptionDetailElement.</p>
@@ -55,9 +55,8 @@ public abstract class AbstractDetailedDescriptionDetailElement<T extends Descrip
                        ICdmFormElement formElement, T entity, int style) {
                super(formFactory, formElement);
                setEntity(entity);
-               
-       }
 
+       }
 
     protected void createTimePeriod(ICdmFormElement formElement, DescriptionElementBase entity,
             int style) {
@@ -69,7 +68,7 @@ public abstract class AbstractDetailedDescriptionDetailElement<T extends Descrip
             int style) {
 
         if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowModifier.getKey())){
-            section_modifiers = formFactory.createModifierSection(getConversationHolder(), this, StoreUtil.getSectionStyle(ModifierSection.class, entity.getClass().getCanonicalName(), true));
+            section_modifiers = formFactory.createModifierSection(this, StoreUtil.getSectionStyle(ModifierSection.class, entity.getClass().getCanonicalName(), true));
             section_modifiers.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_modifiers.setEntity(entity);
             section_modifiers.setEnabled(enabled);
@@ -104,4 +103,20 @@ public abstract class AbstractDetailedDescriptionDetailElement<T extends Descrip
         }
 
     }
+
+    @Override
+    public void fillFields() {
+       timePeriod.setEntity(getEntity().getTimeperiod());
+        if (section_modifiers != null) {
+               section_modifiers.setEntity(getEntity());
+        }
+        if (text_modifyingText!= null) {
+               if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
+                text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+            }
+        }
+    }
+
+
+
 }
\ No newline at end of file
index 2492acc6a58c9fc16e474bf7ea27faedda6e0310..e386944fc80804ca1cf1521d4917e84303a02b82 100644 (file)
@@ -3,8 +3,14 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
+import java.util.Comparator;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.description.CategoricalData;
+import eu.etaxonomy.cdm.model.description.NoDescriptiveDataStatus;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -21,6 +27,8 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
        private CheckboxElement checkbox_orderRelevant;
        private StateDataSection section_stateData;
 
+       private EnumComboElement<NoDescriptiveDataStatus> noDataStatusCombo;
+        private CategoricalData tempData;
        /**
         * <p>Constructor for CategoricalDataDetailElement.</p>
         *
@@ -32,20 +40,29 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
        public CategoricalDataDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, CategoricalData entity, boolean enabled, int style) {
                super(formFactory, formElement, entity, enabled, style);
-               
+
        }
 
        @Override
        protected void createControls(ICdmFormElement formElement,
                        CategoricalData entity, int style) {
+           Comparator<NoDescriptiveDataStatus> comp = new Comparator<NoDescriptiveDataStatus>() {
+
+            @Override
+            public int compare(NoDescriptiveDataStatus o1, NoDescriptiveDataStatus o2) {
+                return o1.getLabel(PreferencesUtil.getGlobalLanguage()).compareTo(o2.getLabel(PreferencesUtil.getGlobalLanguage()));
+            }
+        };
+           noDataStatusCombo = formFactory.createEnumComboElement(NoDescriptiveDataStatus.class, formElement, comp, style, true);
+        noDataStatusCombo.setSelection(entity.getNoDataStatus());
 
                checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style);
-               section_stateData = formFactory.createStateDataSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(StateDataSection.class, entity.getClass().getCanonicalName(), true));
+               section_stateData = formFactory.createStateDataSection(formElement, StoreUtil.getSectionStyle(StateDataSection.class, entity.getClass().getCanonicalName(), true));
                section_stateData.setEntity(entity);
                section_stateData.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_stateData.setEnabled(enabled);
                createTimePeriod(formElement, entity, style);
-               if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+               if (!CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
                    createModifier(formElement, entity, style);
                }else{
                    createFreetextModifier(formElement, entity, style);
@@ -57,6 +74,31 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
            super.handleEvent(eventSource);
                if(eventSource == checkbox_orderRelevant){
                        getEntity().setOrderRelevant(checkbox_orderRelevant.getSelection());
+               } else if (eventSource == noDataStatusCombo) {
+            getEntity().setNoDataStatus(noDataStatusCombo.getSelection());
+            if (noDataStatusCombo.getSelection() != null) {
+                this.setEnabled(false);
+                if (!this.getEntity().getStateData().isEmpty()) {
+                    tempData = this.getEntity().clone();
+                }
+                this.getEntity().getStateData().clear();
+            } else {
+                if (tempData != null) {
+                    this.getEntity().getStateData().addAll(tempData.getStateData());
+                }
+                this.setEnabled(true);
+            }
+            noDataStatusCombo.setEnabled(true);
+        }
+       }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       checkbox_orderRelevant.setEnabled(getEntity().getOrderRelevant());
+                       section_stateData.setEntity(getEntity());
+                       noDataStatusCombo.setSelection(getEntity().getNoDataStatus());
                }
        }
 }
index 805ad92ad9f4cfc0898226eb658e7964c6a3bcd9..d0dfac0124c0983eb9e6a9a41486895f9833f62d 100644 (file)
@@ -6,7 +6,6 @@
 * 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 java.util.List;
@@ -14,6 +13,7 @@ import java.util.UUID;
 
 import org.eclipse.swt.SWT;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
 import eu.etaxonomy.cdm.model.location.NamedArea;
@@ -28,38 +28,30 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>CommonNameDetailElement class.</p>
- *
  * @author n.hoffmann
  * @created Jun 10, 2010
- * @version 1.0
  */
 public class CommonNameDetailElement extends AbstractDetailedDescriptionDetailElement<CommonTaxonName> {
 
        private TermComboElement<Language> combo_language;
        private EntitySelectionElement<NamedArea> selection_namedArea;
        private TextWithLabelElement commonName;
-
+       private TextWithLabelElement transliteration;
 
        /**
         * <p>Constructor for CommonNameDetailElement.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.description.CommonTaxonName} object.
-        * @param style a int.
         */
        public CommonNameDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, CommonTaxonName entity, boolean enabled, int style) {
                super(formFactory, formElement, entity, enabled, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        CommonTaxonName entity, int style) {
 
                commonName = formFactory.createTextWithLabelElement(this, "Common Name", entity.getName(), SWT.WRAP);
+               transliteration = formFactory.createTextWithLabelElement(this, "Transliteration", entity.getTransliteration(), SWT.WRAP);
 
 //             combo_language = formFactory.createDefinedTermComboElement(TermType.Language, this, "Language", entity.getLanguage(), style);
                List<UUID> uuidList = PreferencesUtil.createUUIDListFromStringPref(PreferencePredicate.CommonNameLanguages.getKey(), false);
@@ -68,22 +60,18 @@ public class CommonNameDetailElement extends AbstractDetailedDescriptionDetailEl
         combo_language = formFactory.createDefinedTermComboElement(TermType.Language, this, "Language", entity.getLanguage(), style);
         combo_language.setTerms(languages);
         combo_language.setSelection(entity.getLanguage());
-               selection_namedArea = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
+               selection_namedArea = formFactory.createSelectionElement(NamedArea.class,
                                formElement, "Area",
                                entity.getArea(), EntitySelectionElement.NOTHING, style);
 
                createTimePeriod(formElement, entity, style);
-               if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+               if (!(CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration())) && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
             createModifier(formElement, entity, style);
         }else{
             createFreetextModifier(formElement, entity, style);
         }
-
        }
 
-
-
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
            super.handleEvent(eventSource);
@@ -93,7 +81,19 @@ public class CommonNameDetailElement extends AbstractDetailedDescriptionDetailEl
                        getEntity().setArea(selection_namedArea.getEntity());
                }else if(eventSource == commonName){
                        getEntity().setName(commonName.getText());
-               }
+               }else if(eventSource == transliteration){
+            getEntity().setTransliteration(transliteration.getText());
+        }
        }
 
-}
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       combo_language.setSelection(getEntity().getLanguage());
+                       selection_namedArea.setEntity(getEntity().getArea());
+                       commonName.setText(getEntity().getName());
+                       transliteration.setText(getEntity().getTransliteration());
+               }
+       }
+}
\ No newline at end of file
index 566d97975b77a68a3afef99c4614f2656d941cb3..c833aa865752efeef64ccc9efb7503366c5e4e68 100644 (file)
@@ -14,6 +14,7 @@ import java.util.UUID;
 
 import org.apache.commons.lang3.StringUtils;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
 import eu.etaxonomy.cdm.model.location.NamedArea;
@@ -48,7 +49,7 @@ public class DistributionDetailElement extends
        public DistributionDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, Distribution entity, boolean enabled, int style) {
                super(formFactory, formElement, entity, enabled, style);
-               
+
        }
 
        @Override
@@ -77,7 +78,7 @@ public class DistributionDetailElement extends
                List<DefinedTermBase> inputList = getStatusListForArea(area);
         combo_presenceAbsence = formFactory.createDefinedTermComboElement(inputList, this, "Distribution Status", entity.getStatus(), style);
         createTimePeriod(formElement, entity, style);
-        if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+        if (!CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
             createModifier(formElement, entity, style);
         }else{
             createFreetextModifier(formElement, entity, style);
@@ -137,4 +138,16 @@ public class DistributionDetailElement extends
        public void setName(String nameCache){
            taxonOfDistribtion.setText(nameCache);
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       selection_namedArea.setEntity(getEntity().getArea());
+                       combo_presenceAbsence.setSelection(getEntity().getStatus());
+                       String nameCache = null;
+                       nameCache = ((IDistributionEditorPart)AbstractUtility.getActivePart()).getEditor().getActualNameCache();
+                       taxonOfDistribtion.setText(nameCache);
+               }
+       }
 }
\ No newline at end of file
index c5d19a73ffb8de0b84ef58b5acded8fc5fc28140..692f48eb6ba3c3e468ed9008afae0bca85dbf548 100644 (file)
@@ -6,11 +6,11 @@
  * 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 java.util.Map;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
@@ -25,7 +25,6 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author n.hoffmann
  * @created Jun 10, 2010
- * @version 1.0
  */
 public class IndividualsAssociationDetailElement extends
                AbstractDetailedDescriptionDetailElement<IndividualsAssociation> {
@@ -34,19 +33,17 @@ public class IndividualsAssociationDetailElement extends
        private EntitySelectionElement<SpecimenOrObservationBase> selection_derivedUnit;
 
        public IndividualsAssociationDetailElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement, IndividualsAssociation entity, boolean enabled, 
+                       ICdmFormElement formElement, IndividualsAssociation entity, boolean enabled,
                        int style) {
                super(formFactory, formElement, entity, enabled, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        IndividualsAssociation entity, int style) {
 
                selection_derivedUnit = formFactory
                                .createSelectionElement(SpecimenOrObservationBase.class,
-                                               //getConversationHolder(),
                                        formElement, "Occurrence/Unit",
                                                CdmBase.deproxy(entity.getAssociatedSpecimenOrObservation(),SpecimenOrObservationBase.class),
                                                EntitySelectionElement.ALL, style);
@@ -61,14 +58,13 @@ public class IndividualsAssociationDetailElement extends
                }
 
                createTimePeriod(formElement, entity, style);
-               if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+               if (!CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
             createModifier(formElement, entity, style);
         }else{
             createFreetextModifier(formElement, entity, style);
         }
        }
 
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
            super.handleEvent(eventSource);
@@ -78,6 +74,18 @@ public class IndividualsAssociationDetailElement extends
                } else if (eventSource == text_description) {
                        getEntity().putDescription(CdmStore.getDefaultLanguage(), text_description.getText());
                }
+       }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       if (getEntity().getDescription() != null && getEntity().getDescription().get(CdmStore.getDefaultLanguage()) != null) {
+                               text_description.setText(getEntity().getDescription().get(
+                                               CdmStore.getDefaultLanguage()).getText());
+                       }
+                       selection_derivedUnit.setEntity(getEntity().getAssociatedSpecimenOrObservation());
+               }
 
        }
-}
+}
\ No newline at end of file
index 5033828574f5b41819009857d88e963fcde91fc2..ec667bc919a2b43e5090e9a1863212c9fc698db7 100644 (file)
@@ -4,14 +4,21 @@
 package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
+import eu.etaxonomy.cdm.model.description.NoDescriptiveDataStatus;
 import eu.etaxonomy.cdm.model.description.QuantitativeData;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 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.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.section.description.StatisticalMeasurementValueSection;
 
@@ -23,8 +30,10 @@ import eu.etaxonomy.taxeditor.ui.section.description.StatisticalMeasurementValue
 public class QuantitativeDataDetailElement extends
                AbstractDetailedDescriptionDetailElement<QuantitativeData> {
 
-       private TermComboElement<MeasurementUnit> comboMeasurementUnit;
-       private StatisticalMeasurementValueSection section_statisticalMeasurementValues;
+    private TermComboElement<MeasurementUnit> comboMeasurementUnit;
+    private StatisticalMeasurementValueSection section_statisticalMeasurementValues;
+    private EnumComboElement<NoDescriptiveDataStatus> noDataStatusCombo;
+    private QuantitativeData tempData;
 
        /**
         * <p>Constructor for QuantitativeDataDetailElement.</p>
@@ -37,31 +46,98 @@ public class QuantitativeDataDetailElement extends
        public QuantitativeDataDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement, QuantitativeData entity, boolean enabled, int style) {
                super(formFactory, formElement, entity, enabled, style);
+               updateControlStates();
        }
 
        @Override
        protected void createControls(ICdmFormElement formElement,
                        QuantitativeData entity, int style) {
-               comboMeasurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, formElement, "Measurement Unit", null, style);
+           Comparator<NoDescriptiveDataStatus> comp = new Comparator<NoDescriptiveDataStatus>() {
+
+            @Override
+            public int compare(NoDescriptiveDataStatus o1, NoDescriptiveDataStatus o2) {
+
+                return o1.getLabel(PreferencesUtil.getGlobalLanguage()).compareTo(o2.getLabel(PreferencesUtil.getGlobalLanguage()));
+            }
+        };
+           noDataStatusCombo = formFactory.createEnumComboElement(NoDescriptiveDataStatus.class, formElement,comp, style, true);
+        noDataStatusCombo.setSelection(entity.getNoDataStatus());
+           comboMeasurementUnit = formFactory.createDefinedTermComboElement(TermType.MeasurementUnit, formElement, "Measurement Unit", null, style);
         comboMeasurementUnit.setTerms(new ArrayList<MeasurementUnit>(entity.getFeature().getRecommendedMeasurementUnits()));
         comboMeasurementUnit.setSelection(entity.getUnit());
-               section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(StatisticalMeasurementValueSection.class, entity.getClass().getCanonicalName(), true));
+               section_statisticalMeasurementValues = formFactory.createStatisticalMeasurementValueSection(formElement, StoreUtil.getSectionStyle(StatisticalMeasurementValueSection.class, entity.getClass().getCanonicalName(), true));
                section_statisticalMeasurementValues.setEntity(entity);
                section_statisticalMeasurementValues.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+               if (!CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
             createModifier(formElement, entity, style);
         }else{
             createFreetextModifier(formElement, entity, style);
         }
        }
 
-       @Override
-       public void handleEvent(Object eventSource) {
-               if(eventSource == comboMeasurementUnit){
-                       getEntity().setUnit(comboMeasurementUnit.getSelection());
-                       comboMeasurementUnit.removeEmptyElement();
-               }else if (eventSource == section_statisticalMeasurementValues){
-                       // FIXME
-               }
-       }
+    @Override
+    public void handleEvent(Object eventSource) {
+        super.handleEvent(eventSource);
+        if (eventSource == comboMeasurementUnit) {
+            getEntity().setUnit(comboMeasurementUnit.getSelection());
+            comboMeasurementUnit.removeEmptyElement();
+        } else if (eventSource == section_statisticalMeasurementValues) {
+            // FIXME
+        } else if (eventSource == noDataStatusCombo) {
+            getEntity().setNoDataStatus(noDataStatusCombo.getSelection());
+            if (noDataStatusCombo.getSelection() != null) {
+                this.setEnabled(false);
+                if (!this.getEntity().getStatisticalValues().isEmpty()) {
+                    tempData = this.getEntity().clone();
+                }
+                this.getEntity().getStatisticalValues().clear();
+            } else {
+                if (tempData != null) {
+                    this.getEntity().getStatisticalValues().addAll(tempData.getStatisticalValues());
+                }
+                this.setEnabled(true);
+            }
+            noDataStatusCombo.setEnabled(true);
+        }
+    }
+
+    @Override
+    public void fillFields() {
+        if (getEntity() != null) {
+            super.fillFields();
+
+            comboMeasurementUnit.setSelection(getEntity().getUnit());
+            section_statisticalMeasurementValues.setEntity(getEntity());
+            noDataStatusCombo.setSelection(getEntity().getNoDataStatus());
+            if (getEntity().getNoDataStatus() != null) {
+                this.setEnabled(false);
+                noDataStatusCombo.setEnabled(true);
+            }
+
+        }
+
+    }
+
+    @Override
+    public void updateControlStates() {
+        Collection<Object> except = new ArrayList<Object>();
+        for (ICdmFormElement formElement : getElements()) {
+            if (formElement instanceof IEnableableFormElement && !((IEnableableFormElement) formElement).isEnabled()) {
+                except.add(formElement);
+            }
+        }
+
+        if ((getEntity().getInDescription() != null
+                && (getEntity().getInDescription().isComputed() || getEntity().getInDescription().isCloneForSource())
+                && PreferencesUtil.isComputedDesciptionHandlingDisabled())) {
+            enabled = false;
+        } else if (getEntity().getNoDataStatus() != null) {
+            enabled = false;
+            except.add(noDataStatusCombo);
+        } else {
+            enabled = true;
+        }
+        setEnabled(enabled, except);
+
+    }
 }
index 7989ac4956205499d0c2d443495b3b0e86f568b8..8438cc8734961a0047b1553d515de3b5d7d92bc0 100644 (file)
@@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
 import java.util.Map;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.LanguageString;
@@ -65,7 +66,7 @@ public class TaxonInteractionDetailElement extends
                        TaxonInteraction entity, int style) {
 
            taxonSelection = formFactory
-                .createSelectionElement(Taxon.class,//getConversationHolder(),
+                .createSelectionElement(Taxon.class,
                         formElement, "Taxon",
                         CdmBase.deproxy(entity.getTaxon2(),Taxon.class),
                         EntitySelectionElement.ALL, style);
@@ -79,7 +80,7 @@ public class TaxonInteractionDetailElement extends
                     CdmStore.getDefaultLanguage()).getText());
         }
         createTimePeriod(formElement, entity, style);
-        if (entity.getFeature().getRecommendedModifierEnumeration() != null && !entity.getFeature().getRecommendedModifierEnumeration().isEmpty()){
+        if (!CdmUtils.isNullSafeEmpty(entity.getFeature().getRecommendedModifierEnumeration()) || !CdmUtils.isNullSafeEmpty(entity.getModifiers())){
             createModifier(formElement, entity, style);
         }else{
             createFreetextModifier(formElement, entity, style);
@@ -96,4 +97,15 @@ public class TaxonInteractionDetailElement extends
                        getEntity().putDescription(CdmStore.getDefaultLanguage(), interactionDescription.getText());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       taxonSelection.setEntity(getEntity().getTaxon2());
+                       interactionDescription.setText(getEntity().getDescription(CdmStore.getDefaultLanguage()));
+
+               }
+
+       }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 28c85f7..269abad
@@ -46,4 +46,13 @@ public class TemporalDataDetailElement extends AbstractDetailedDescriptionDetail
 
     }
 
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       timePeriod.setTimePeriod(getEntity().getPeriod());
+               }
+               
+       }
+
 }
index e20132c16aed5f15a82bfc5d3b9a91bf3a98d5f5..65df6d439c3f9b4dafe9183e4428dda59fe081b2 100644 (file)
@@ -14,6 +14,7 @@ import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.model.description.TextData;
 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.MultilanguageTextElement;
 
@@ -58,6 +59,7 @@ public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElem
        public void handleEvent(Object eventSource) {
            super.handleEvent(eventSource);
                if(eventSource == multilanguageTextElement){
+                       firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
 //                     getEntity().setMultiLanguageText(multilanguageTextElement.getMultilanguageText());
                }
        }
@@ -73,4 +75,13 @@ public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElem
            }
            super.propertyChange(event);
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       multilanguageTextElement.setMultilanguageText(getEntity().getMultilanguageText());
+               }
+               
+       }
 }
index 1d6f48b0a4240e8bad7a21d18ea10143e0dbc084..b679e90e86ae82de9b666c22a5885098a248725c 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureState;
-import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -27,14 +27,13 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author pplitzner
  * @since Aug 16, 2019
- *
  */
 public abstract class AbstractApplicableElement extends AbstractEntityCollectionElement<FeatureState> {
 
-    private TermComboElement<State> comboState;
+    private TermComboElement<DefinedTermBase<?>> comboState;
     private EntitySelectionElement<Feature> selectFeature;
 
-    public AbstractApplicableElement(CdmFormFactory formFactory, AbstractFormSection section, FeatureState entity,
+    public AbstractApplicableElement(CdmFormFactory formFactory, AbstractFormSection<?> section, FeatureState entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
 
@@ -46,7 +45,7 @@ public abstract class AbstractApplicableElement extends AbstractEntityCollection
         comboState = formFactory.createDefinedTermComboElement(Collections.EMPTY_LIST, element, getComboLabel(), null, style);
         comboState.setEnabled(false);
         selectFeature.setEnabled(false);
-        
+
         selectFeature.setEntity(entity.getFeature());
         comboState.setSelection(entity.getState());
     }
index 698497c0211fac7cbc3a0259690b14d4d7bf93ae..2d7d153639f12fa9bb0f3d8b8130294d37905cf2 100644 (file)
@@ -19,14 +19,10 @@ import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.FeatureState;
-import eu.etaxonomy.cdm.model.description.State;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.TermManager;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -37,18 +33,15 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author pplitzner
  * @since Aug 16, 2019
- *
  */
 public abstract class AbstractApplicableElementForDto extends AbstractEntityCollectionElement<FeatureStateDto> {
 
-    protected TermComboElement<State> comboState;
+    protected TermComboElement<DefinedTermBase> comboState;
     protected EntitySelectionElement<Feature> selectFeature;
-    
 
     public AbstractApplicableElementForDto(CdmFormFactory formFactory, AbstractFormSection section, FeatureStateDto entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
-
     }
 
     @Override
@@ -63,11 +56,11 @@ public abstract class AbstractApplicableElementForDto extends AbstractEntityColl
                selectFeature.setEntity(feature);
                List<UUID> termList = new ArrayList<>();
                termList.add(entity.getState().getUuid());
-               List<State> terms =  CdmStore.getTermManager().getTerms(termList, TermType.State);
+               //FIXME 10196
+               List<DefinedTermBase> terms = CdmStore.getTermManager().getTerms(termList, TermType.State);
                if (terms.size() == 1){
                        comboState.setSelection(terms.get(0));
                }
-        
        }
 
     protected abstract String getComboLabel();
@@ -83,11 +76,11 @@ public abstract class AbstractApplicableElementForDto extends AbstractEntityColl
     @Override
     public void handleEvent(Object eventSource) {
     }
-    
+
     @Override
     public void setEnabled(boolean enabled){
        super.setEnabled(enabled);
        this.comboState.setEnabled(false);
        this.selectFeature.setEnabled(false);
     }
-}
+}
\ No newline at end of file
index 610915ec2152320bcd96e69299176b7460143159..4610a06910c0c18fce4b2aa174ef0d9bf221053e 100644 (file)
@@ -14,15 +14,12 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.Character;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.Representation;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.model.ColorResources;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -32,40 +29,35 @@ import eu.etaxonomy.taxeditor.ui.element.RemovableTextElement;
 import eu.etaxonomy.taxeditor.ui.element.RepresentationElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class CharacterDetailElement extends AbstractCdmDetailElement<Character> {
 
     private ICdmFormElement parentFormElement;
 
-    protected RepresentationElement element_Representation;
-
-    private TermComboElement<DefinedTerm> comboStructuralModifier;
+    private RepresentationElement element_Representation;
 
     private CheckboxElement supportsQuantitativeData;
 
     private CheckboxElement supportsCategoricalData;
-    
+
     private CheckboxElement availableForTaxon;
     private CheckboxElement availableForTaxonName;
     private CheckboxElement availableForSpecimenOrObservation;
 
-
-    private StateVocabularyCollectionSection sectionStateVocabularies;
+    private RecommendedStateCollectionSection sectionStateVocabularies;
 
     private MeasurementUnitCollectionSection sectionMeasurementUnits;
 
     private StatisticalMeasureCollectionSection sectionStatisticalMeasures;
 
-    private RecommendedModifierVocabulariesCollectionSection sectionModifierVocabularies;
+    private RecommendedModifierCollectionsCollectionSection sectionModifierVocabularies;
     private Label labelText_structure;
     private Text text_structure;
 
@@ -73,100 +65,89 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
     private Text text_property;
 
     private RemovableTextElement ratioTo;
-//    private Label labelText_ratioTo;
-//    private Text text_ratioTo;
-//    private Button button_remove;
-
-
-//    private TextWithLabelElement text_structure;
-//    private TextWithLabelElement text_property;
-
-
-       public CharacterDetailElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement) {
-               super(formFactory, formElement);
-       }
-
-       @Override
-       protected void createControls(ICdmFormElement formElement, Character entity, int style) {
-           this.parentFormElement = formElement;
-           element_Representation = formFactory.createTranslatableRepresentationElement(formElement,  entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
-           if (labelText_property != null){
-               labelText_structure.dispose();
-           }
-           labelText_structure = new Label(formElement.getLayoutComposite(), SWT.NONE);
-           labelText_structure.setText("Structure");
-           if (text_structure != null){
-               text_structure.dispose();
-           }
-           text_structure = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-        text_structure.setText( CharacterNodeDetailElement.getStructureText(entity));
+
+    public CharacterDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+        super(formFactory, formElement);
+    }
+
+    @Override
+    protected void createControls(ICdmFormElement formElement, Character entity, int style) {
+        this.parentFormElement = formElement;
+        element_Representation = formFactory.createTranslatableRepresentationElement(formElement,
+                entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()), entity, 100, style, true);
+        if (labelText_property != null) {
+            labelText_structure.dispose();
+        }
+        labelText_structure = new Label(formElement.getLayoutComposite(), SWT.NONE);
+        labelText_structure.setText("Structure");
+        if (text_structure != null) {
+            text_structure.dispose();
+        }
+        text_structure = new Text(formElement.getLayoutComposite(), SWT.WRAP);
+        text_structure.setText(CharacterNodeDetailElement.getStructureText(entity));
         text_structure.setEditable(false);
         text_structure.setLayoutData(LayoutConstants.FILL());
         text_structure.setForeground(ColorResources.getColor(Resources.BLACK));
-        if (labelText_property != null){
+        if (labelText_property != null) {
             labelText_property.dispose();
         }
-        labelText_property =  new Label(formElement.getLayoutComposite(), SWT.NONE);
-           labelText_property.setText("Property");
-           if (text_property != null){
-               text_property.dispose();
-           }
-           text_property = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-           text_property.setEditable(false);
-           text_property.setText( CharacterNodeDetailElement.getPropertyText(entity));
-           text_property.setLayoutData(LayoutConstants.FILL());
-           text_property.setForeground(ColorResources.getColor(Resources.BLACK));
-
-        comboStructuralModifier = formFactory.createDefinedTermComboElement(TermType.StructureModifier, formElement, "Structural Modifier", entity.getStructureModifier(), style);
+        labelText_property = new Label(formElement.getLayoutComposite(), SWT.NONE);
+        labelText_property.setText("Property");
+        if (text_property != null) {
+            text_property.dispose();
+        }
+        text_property = new Text(formElement.getLayoutComposite(), SWT.WRAP);
+        text_property.setEditable(false);
+        text_property.setText(CharacterNodeDetailElement.getPropertyText(entity));
+        text_property.setLayoutData(LayoutConstants.FILL());
+        text_property.setForeground(ColorResources.getColor(Resources.BLACK));
 
-        ratioTo = formFactory.createRemovableTextField(formElement, "Ratio to", CharacterNodeDetailElement.getRatioToText(entity), style);
+        ratioTo = formFactory.createRemovableTextField(formElement, "Ratio to",
+                CharacterNodeDetailElement.getRatioToText(entity), style);
 
-           supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.isSupportsQuantitativeData(), style);
-           supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.isSupportsCategoricalData(), style);
+        supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data",
+                entity.isSupportsQuantitativeData(), style);
+        supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data",
+                entity.isSupportsCategoricalData(), style);
 
-           LabelElement availableLabel = formFactory.createLabel(formElement, "Available for");
+        LabelElement availableLabel = formFactory.createLabel(formElement, "Available for");
         availableLabel.setBold();
 
         availableForTaxon = formFactory.createCheckbox(formElement, "Taxon", entity.isAvailableForTaxon(), style);
-        availableForTaxonName = formFactory.createCheckbox(formElement, "Taxon Name", entity.isAvailableForTaxonName(), style);
-        availableForSpecimenOrObservation = formFactory.createCheckbox(formElement, "Occurrence", entity.isAvailableForOccurrence(), style);
-           
+        availableForTaxonName = formFactory.createCheckbox(formElement, "Taxon Name", entity.isAvailableForTaxonName(),
+                style);
+        availableForSpecimenOrObservation = formFactory.createCheckbox(formElement, "Occurrence",
+                entity.isAvailableForOccurrence(), style);
+
         if (supportsCategoricalData.getSelection()) {
-            sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionStateVocabularies = formFactory.createStateVocabulariesSection(parentFormElement,
+                    StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStateVocabularies.setEntity(entity);
         }
         if (supportsQuantitativeData.getSelection()) {
-            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(parentFormElement,
+                    StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionMeasurementUnits.setEntity(entity);
 
-            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(parentFormElement,
+                    StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStatisticalMeasures.setEntity(entity);
         }
         if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {
             sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, entity.getClass().getCanonicalName(), true));
+                    parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionModifierVocabularies.setEntity(entity);
         }
 
-
     }
-//     public void createText(ICdmFormElement formElement, String label, String path) {
-//         labelText = new Label(formElement.getLayoutComposite(), SWT.NONE);
-//        labelText.setText(label);
-//        Text text = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-//        text.setText(path);
-//        text.setEditable(false);
-//        text.setLayoutData(LayoutConstants.FILL());
-//        text.setForeground(ColorResources.getColor(Resources.BLACK));
-//    }
 
     @Override
     public void setEntity(Character entity) {
@@ -174,126 +155,142 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
         setEnabled(TermBasePropertyTester.isModifiable(entity));
     }
 
-       @Override
-       public void handleEvent(Object eventSource) {
-           if(eventSource == comboStructuralModifier){
-               getEntity().setStructureModifier(comboStructuralModifier.getSelection());
-           }
-           if(eventSource == ratioTo){
-               if (!ratioTo.isState()){
-                   getEntity().setRatioToStructure(null);
-               }
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == ratioTo) {
+            if (!ratioTo.isState()) {
+                getEntity().setRatioToStructure(null);
+                this.getEntity().getTitleCache();
+                System.err.println(this.getEntity().getTitleCache());
+            }
         }
 
-//         if(eventSource == supportsQuantitativeData || eventSource == supportsCategoricalData){
-//             //if any type is selected disable supportsTextData
-//             getEntity().setSupportsTextData(false);
-//         }
-           if(eventSource == supportsQuantitativeData){
-               getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
-               if(supportsQuantitativeData.getSelection()){
-                   activateQuantitativeWidgets();
-               }
-               else{
-                   removeQuantitativeWidgets();
-               }
+        if (eventSource == supportsQuantitativeData) {
+            getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
+            if (supportsQuantitativeData.getSelection()) {
+                activateQuantitativeWidgets();
+            } else {
+                removeQuantitativeWidgets();
+            }
             StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-           }
-           else if(eventSource == supportsCategoricalData){
-               getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
+        } else if (eventSource == supportsCategoricalData) {
+            getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
             if (supportsCategoricalData.getSelection()) {
                 activateCategoricalWidgets();
+            } else {
+                removeCategoricalWidgets();
             }
-               else{
-                   removeCategoricalWidgets();
-               }
             StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-           }
-           else if (eventSource == element_Representation) {
+        } else if (eventSource == element_Representation) {
             Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
-            if(selectedRepresentation!=null){
+            if (selectedRepresentation != null) {
                 Language representationLanguage = selectedRepresentation.getLanguage();
-                if(representationLanguage==null){
+                if (representationLanguage == null) {
                     representationLanguage = Language.getDefaultLanguage();
                 }
-                getEntity().setLabel(selectedRepresentation.getLabel(),  representationLanguage);
-                getEntity().getRepresentation(representationLanguage).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
+                getEntity().setLabel(selectedRepresentation.getLabel(), representationLanguage);
+                getEntity().getRepresentation(representationLanguage)
+                        .setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
                 getEntity().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
             }
             getEntity().setTitleCache(null);
-        } 
-           else if(eventSource == availableForSpecimenOrObservation){
+        } else if (eventSource == availableForSpecimenOrObservation) {
             getEntity().setAvailableForOccurrence(availableForSpecimenOrObservation.getSelection());
-            
-        }
-           else if(eventSource == availableForTaxon){
+
+        } else if (eventSource == availableForTaxon) {
             getEntity().setAvailableForTaxon(availableForTaxon.getSelection());
-            
-        }
-           else if(eventSource == availableForTaxonName){
+
+        } else if (eventSource == availableForTaxonName) {
             getEntity().setAvailableForTaxonName(availableForTaxonName.getSelection());
-            
+
         }
 
-       }
-
-       private void activateQuantitativeWidgets(){
-           //disable categorical widgets
-           supportsCategoricalData.setSelection(false);
-           getEntity().setSupportsCategoricalData(false);
-           removeCategoricalWidgets();
-
-           //measurement units
-           sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-                   parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionMeasurementUnits.setEntity(getEntity());
-
-           //statistical measures
-           sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionStatisticalMeasures.setEntity(getEntity());
-
-           //modifiers
-           sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionModifierVocabularies.setEntity(getEntity());
-       }
-
-       private void removeQuantitativeWidgets(){
-           if(sectionMeasurementUnits!=null){
-               removeElementsAndControls(sectionMeasurementUnits);
-               removeElementsAndControls(sectionStatisticalMeasures);
-               removeElementsAndControls(sectionModifierVocabularies);
-           }
-       }
-
-       private void activateCategoricalWidgets(){
-           //disable quantitative widgeets
-           supportsQuantitativeData.setSelection(false);
-           getEntity().setSupportsQuantitativeData(false);
-           removeQuantitativeWidgets();
-
-           //states
-           sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+    }
+
+    private void activateQuantitativeWidgets() {
+        // disable categorical widgets
+        supportsCategoricalData.setSelection(false);
+        getEntity().setSupportsCategoricalData(false);
+        removeCategoricalWidgets();
+
+        // measurement units
+        sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(parentFormElement,
+                StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionMeasurementUnits.setEntity(getEntity());
+
+        // statistical measures
+        sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(parentFormElement,
+                StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionStatisticalMeasures.setEntity(getEntity());
+
+        // modifiers
+        sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionModifierVocabularies.setEntity(getEntity());
+    }
+
+    private void removeQuantitativeWidgets() {
+        if (sectionMeasurementUnits != null) {
+            removeElementsAndControls(sectionMeasurementUnits);
+            removeElementsAndControls(sectionStatisticalMeasures);
+            removeElementsAndControls(sectionModifierVocabularies);
+        }
+    }
+
+    private void activateCategoricalWidgets() {
+        // disable quantitative widgeets
+        supportsQuantitativeData.setSelection(false);
+        getEntity().setSupportsQuantitativeData(false);
+        removeQuantitativeWidgets();
+
+        // states
+        sectionStateVocabularies = formFactory.createStateVocabulariesSection(parentFormElement,
+                StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
         sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionStateVocabularies.setEntity(getEntity());
 
-        //modifiers
+        // modifiers
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionModifierVocabularies.setEntity(getEntity());
-       }
-
-       private void removeCategoricalWidgets(){
-           if(sectionStateVocabularies!=null){
-               removeElementsAndControls(sectionStateVocabularies);
-               removeElementsAndControls(sectionModifierVocabularies);
-           }
-       }
+    }
+
+    private void removeCategoricalWidgets() {
+        if (sectionStateVocabularies != null) {
+            removeElementsAndControls(sectionStateVocabularies);
+            removeElementsAndControls(sectionModifierVocabularies);
+        }
+    }
+
+    @Override
+    public void fillFields() {
+        if (getEntity() != null) {
+            element_Representation.setTerm(getEntity(), isEnabled());
+            supportsQuantitativeData.setSelection(getEntity().isSupportsQuantitativeData());
+            supportsCategoricalData.setSelection(getEntity().isSupportsCategoricalData());
+            ;
+            availableForTaxon.setSelection(getEntity().isAvailableForTaxon());
+            availableForTaxonName.setSelection(getEntity().isAvailableForTaxonName());
+            availableForSpecimenOrObservation.setSelection(getEntity().isAvailableForOccurrence());
+            sectionStateVocabularies.setEntity(getEntity());
+            sectionMeasurementUnits.setEntity(getEntity());
+            sectionStatisticalMeasures.setEntity(getEntity());
+            sectionModifierVocabularies.setEntity(getEntity());
+
+            text_structure.setText(CharacterNodeDetailElement.getStructureText(getEntity()));
+            text_property.setText(CharacterNodeDtoDetailElement.getPropertyText(getEntity()));
+            ratioTo.setText(CharacterNodeDetailElement.getRatioToText(getEntity()));
+        }
+
+    }
 
 }
index 941e49da17bcffc731d25ed87c7042cb5e8e119a..40e4d677fb33372aa70995231814a8b1819624f4 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Character;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -18,17 +17,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class CharacterDetailSection extends AbstractCdmDetailSection<Character> {
 
        public CharacterDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -36,13 +33,9 @@ public class CharacterDetailSection extends AbstractCdmDetailSection<Character>
                return "Character";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<Character> createCdmDetailElement(AbstractCdmDetailSection<Character> parentElement,
             int style) {
         return formFactory.createCharacterDetailElement(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 4055e16..9f079bd
@@ -15,12 +15,9 @@ import org.eclipse.swt.widgets.Text;
 
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.Character;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.Representation;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.persistence.dto.CharacterDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
-import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -28,7 +25,6 @@ import eu.etaxonomy.taxeditor.model.ColorResources;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -39,18 +35,16 @@ import eu.etaxonomy.taxeditor.ui.element.RepresentationElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.MeasurementUnitDtoCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierVocabulariesDtoCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.StateVocabularyDtoCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedModifierCollectionsDtoCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.RecommendedStateDtoCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.vocabulary.StatisticalMeasureDtoCollectionSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class CharacterDtoDetailElement extends AbstractCdmDetailElement<CharacterDto> {
 
@@ -58,23 +52,21 @@ public class CharacterDtoDetailElement extends AbstractCdmDetailElement<Characte
 
     protected RepresentationElement element_Representation;
 
-    private TermComboElement<DefinedTerm> comboStructuralModifier;
-
     private CheckboxElement supportsQuantitativeData;
 
     private CheckboxElement supportsCategoricalData;
-    
+
     private CheckboxElement availableForTaxon;
     private CheckboxElement availableForTaxonName;
     private CheckboxElement availableForSpecimenOrObservation;
 
-    private StateVocabularyDtoCollectionSection sectionStateVocabularies;
+    private RecommendedStateDtoCollectionSection sectionStateVocabularies;
 
     private MeasurementUnitDtoCollectionSection sectionMeasurementUnits;
 
     private StatisticalMeasureDtoCollectionSection sectionStatisticalMeasures;
 
-    private RecommendedModifierVocabulariesDtoCollectionSection sectionModifierVocabularies;
+    private RecommendedModifierCollectionsDtoCollectionSection sectionModifierVocabularies;
     private Label labelText_structure;
     private Text text_structure;
 
@@ -83,116 +75,93 @@ public class CharacterDtoDetailElement extends AbstractCdmDetailElement<Characte
 
     private RemovableTextElement ratioTo;
 
-//    private TextWithLabelElement text_structure;
-//    private TextWithLabelElement text_property;
-
-
-       public CharacterDtoDetailElement(CdmFormFactory formFactory,
-                       ICdmFormElement formElement) {
-               super(formFactory, formElement);
-       }
-
-       @Override
-       protected void createControls(ICdmFormElement formElement, CharacterDto entity, int style) {
-           this.parentFormElement = formElement;
-
-           element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement,  entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
-           if (labelText_property != null){
-               labelText_structure.dispose();
-           }
-           labelText_structure = new Label(formElement.getLayoutComposite(), SWT.NONE);
-           labelText_structure.setText("Structure");
-           if (text_structure != null){
-               text_structure.dispose();
-           }
-           text_structure = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-        text_structure.setText( entity.getStructure().getPath());
+    public CharacterDtoDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+        super(formFactory, formElement);
+    }
+
+    @Override
+    protected void createControls(ICdmFormElement formElement, CharacterDto entity, int style) {
+        this.parentFormElement = formElement;
+
+        element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement,
+                entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()), entity, 100, style, true);
+        if (labelText_property != null) {
+            labelText_structure.dispose();
+        }
+        labelText_structure = new Label(formElement.getLayoutComposite(), SWT.NONE);
+        labelText_structure.setText("Structure");
+        if (text_structure != null) {
+            text_structure.dispose();
+        }
+        text_structure = new Text(formElement.getLayoutComposite(), SWT.WRAP);
+        text_structure.setText(entity.getStructure().getPath());
         text_structure.setEditable(false);
         text_structure.setLayoutData(LayoutConstants.FILL());
         text_structure.setForeground(ColorResources.getColor(Resources.BLACK));
-        if (labelText_property != null){
+        if (labelText_property != null) {
             labelText_property.dispose();
         }
-        labelText_property =  new Label(formElement.getLayoutComposite(), SWT.NONE);
-           labelText_property.setText("Property");
-           if (text_property != null){
-               text_property.dispose();
-           }
-           text_property = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-           text_property.setEditable(false);
-           text_property.setText(entity.getProperty().getPath());
-           text_property.setLayoutData(LayoutConstants.FILL());
-           text_property.setForeground(ColorResources.getColor(Resources.BLACK));
-
-        comboStructuralModifier = formFactory.createDefinedTermComboElementDto(TermType.StructureModifier, formElement, "Structural Modifier", entity.getStructureModifier(), style);
-
-//        if (labelText_ratioTo != null){
-//            labelText_ratioTo.dispose();
-//        }
-//        labelText_ratioTo =  new Label(formElement.getLayoutComposite(), SWT.NONE);
-//        labelText_ratioTo.setText("Ratio to");
-//        if (text_ratioTo != null){
-//            text_ratioTo.dispose();
-//        }
-//        text_ratioTo = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-//        text_ratioTo.setEditable(false);
-//        if (entity.getRatioTo() != null){
-//            text_ratioTo.setText(entity.getRatioTo().getPath());
-//        }
-//        text_ratioTo.setLayoutData(LayoutConstants.FILL());
-//        text_ratioTo.setForeground(ColorResources.getColor(Resources.BLACK));
-
-        ratioTo = formFactory.createRemovableTextField(formElement, "Ratio to", entity.getRatioTo() != null? entity.getRatioTo().getPath():null, style);
-
-           supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", ((FeatureDto) entity).isSupportsQuantitativeData(), style);
-           supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", ((FeatureDto) entity).isSupportsCategoricalData(), style);
-           LabelElement availableLabel = formFactory.createLabel(formElement, "Available for");
+        labelText_property = new Label(formElement.getLayoutComposite(), SWT.NONE);
+        labelText_property.setText("Property");
+        if (text_property != null) {
+            text_property.dispose();
+        }
+        text_property = new Text(formElement.getLayoutComposite(), SWT.WRAP);
+        text_property.setEditable(false);
+        text_property.setText(entity.getProperty().getPath());
+        text_property.setLayoutData(LayoutConstants.FILL());
+        text_property.setForeground(ColorResources.getColor(Resources.BLACK));
+        ratioTo = formFactory.createRemovableTextField(formElement, "Ratio to",
+                entity.getRatioTo() != null ? entity.getRatioTo().getPath() : null, style);
+
+        supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data",
+                ((FeatureDto) entity).isSupportsQuantitativeData(), style);
+        supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data",
+                ((FeatureDto) entity).isSupportsCategoricalData(), style);
+        LabelElement availableLabel = formFactory.createLabel(formElement, "Available for");
         availableLabel.setBold();
-           availableForTaxon = formFactory.createCheckbox(formElement, "Taxon", entity.isAvailableForTaxon(), style);
-        availableForTaxonName = formFactory.createCheckbox(formElement, "Taxon Name", entity.isAvailableForTaxonName(), style);
-        availableForSpecimenOrObservation = formFactory.createCheckbox(formElement, "Occurrence", entity.isAvailableForOccurrence(), style);
+        availableForTaxon = formFactory.createCheckbox(formElement, "Taxon", entity.isAvailableForTaxon(), style);
+        availableForTaxonName = formFactory.createCheckbox(formElement, "Taxon Name", entity.isAvailableForTaxonName(),
+                style);
+        availableForSpecimenOrObservation = formFactory.createCheckbox(formElement, "Occurrence",
+                entity.isAvailableForOccurrence(), style);
         if (supportsCategoricalData.getSelection()) {
-            sectionStateVocabularies = formFactory.createStateVocabulariesDtoSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionStateVocabularies = formFactory.createStateVocabulariesDtoSection(parentFormElement,
+                    StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStateVocabularies.setEntity((entity));
         }
         if (supportsQuantitativeData.getSelection()) {
-            sectionMeasurementUnits = formFactory.createMeasurementUnitDtoCollectionSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionMeasurementUnits = formFactory.createMeasurementUnitDtoCollectionSection(parentFormElement,
+                    StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionMeasurementUnits.setEntity((entity));
 
-            sectionStatisticalMeasures = formFactory.createStatisticalMeasureDtoCollectionSection(getConversationHolder(),
-                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, entity.getClass().getCanonicalName(), true));
+            sectionStatisticalMeasures = formFactory.createStatisticalMeasureDtoCollectionSection(parentFormElement,
+                    StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionStatisticalMeasures.setEntity((entity));
         }
         if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {
             sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesDtoCollectionSection(
-                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, entity.getClass().getCanonicalName(), true));
+                    parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                            entity.getClass().getCanonicalName(), true));
             sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             sectionModifierVocabularies.setEntity((entity));
         }
 
     }
 
-       public String getPropertyText() {
-        return getEntity().getProperty()!=null?getEntity().getProperty().getPath():"[no property]";
+    public String getPropertyText() {
+        return getEntity().getProperty() != null ? getEntity().getProperty().getPath() : "[no property]";
     }
 
     public String getStructureText(Character entity) {
-        return entity.getStructure()!=null?entity.getStructure().getPath():"[no structure]";
+        return entity.getStructure() != null ? entity.getStructure().getPath() : "[no structure]";
     }
-//     public void createText(ICdmFormElement formElement, String label, String path) {
-//         labelText = new Label(formElement.getLayoutComposite(), SWT.NONE);
-//        labelText.setText(label);
-//        Text text = new Text(formElement.getLayoutComposite(), SWT.WRAP);
-//        text.setText(path);
-//        text.setEditable(false);
-//        text.setLayoutData(LayoutConstants.FILL());
-//        text.setForeground(ColorResources.getColor(Resources.BLACK));
-//    }
 
     @Override
     public void setEntity(CharacterDto entity) {
@@ -200,136 +169,142 @@ public class CharacterDtoDetailElement extends AbstractCdmDetailElement<Characte
         setEnabled(TermBasePropertyTester.isModifiable(entity));
     }
 
-       @Override
-       public void handleEvent(Object eventSource) {
-           if(eventSource == comboStructuralModifier){
-               getEntity().setStructureModifier(TermDto.fromTerm(comboStructuralModifier.getSelection()));
-           }
-           if(eventSource == ratioTo){
-               if (!ratioTo.isState()){
-                   getEntity().setRatioTo(null);
-               }
+    @Override
+    public void handleEvent(Object eventSource) {
+        if (eventSource == ratioTo) {
+            if (!ratioTo.isState()) {
+                getEntity().setRatioTo(null);
+                element_Representation.setTermDto(getEntity(), enabled);
+            }
         }
 
-//         if(eventSource == supportsQuantitativeData || eventSource == supportsCategoricalData){
-//             //if any type is selected disable supportsTextData
-//             getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
-//             getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
-//         }
-           if(eventSource == supportsQuantitativeData){
-               getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
-               getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
-               if(supportsQuantitativeData.getSelection()){
-                   activateQuantitativeWidgets();
-               }
-               else{
-                   removeQuantitativeWidgets();
-               }
+        if (eventSource == supportsQuantitativeData) {
+            getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
+            getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
+            if (supportsQuantitativeData.getSelection()) {
+                activateQuantitativeWidgets();
+            } else {
+                removeQuantitativeWidgets();
+            }
             StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-           }
-           else if(eventSource == supportsCategoricalData){
-               getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
-               getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
+        } else if (eventSource == supportsCategoricalData) {
+            getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
+            getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
             if (supportsCategoricalData.getSelection()) {
                 activateCategoricalWidgets();
+            } else {
+                removeCategoricalWidgets();
             }
-               else{
-                   removeCategoricalWidgets();
-               }
             StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-           }
-           else if (eventSource == element_Representation) {
+        } else if (eventSource == element_Representation) {
             Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
-            if(selectedRepresentation!=null){
+            if (selectedRepresentation != null) {
                 Language representationLanguage = selectedRepresentation.getLanguage();
-                if(representationLanguage==null){
+                if (representationLanguage == null) {
                     representationLanguage = Language.getDefaultLanguage();
                 }
-//                TODO:handle representations correctly
-//                getEntity().setLabel(selectedRepresentation.getLabel(),  representationLanguage);
-//                getEntity().getRepresentation(representationLanguage).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
-//                getEntity().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
             }
-//            getEntity().setTitleCache(null);
-        } 
-           else if(eventSource == availableForSpecimenOrObservation){
+        } else if (eventSource == availableForSpecimenOrObservation) {
             getEntity().setAvailableForOccurrence(availableForSpecimenOrObservation.getSelection());
-            
-        }
-           else if(eventSource == availableForTaxon){
+
+        } else if (eventSource == availableForTaxon) {
             getEntity().setAvailableForTaxon(availableForTaxon.getSelection());
-            
-        }
-           else if(eventSource == availableForTaxonName){
+
+        } else if (eventSource == availableForTaxonName) {
             getEntity().setAvailableForTaxonName(availableForTaxonName.getSelection());
-            
+
+        }
+    }
+
+    private void activateQuantitativeWidgets() {
+        // disable categorical widgets
+        supportsCategoricalData.setSelection(false);
+        getEntity().setSupportsCategoricalData(false);
+        removeCategoricalWidgets();
+
+        // measurement units
+        sectionMeasurementUnits = formFactory.createMeasurementUnitDtoCollectionSection(parentFormElement,
+                StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionMeasurementUnits.setEntity((getEntity()));
+
+        // statistical measures
+        sectionStatisticalMeasures = formFactory.createStatisticalMeasureDtoCollectionSection(parentFormElement,
+                StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionStatisticalMeasures.setEntity((getEntity()));
+
+        // modifiers
+        sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesDtoCollectionSection(
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
+        sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+        sectionModifierVocabularies.setEntity((getEntity()));
+    }
+
+    private void removeQuantitativeWidgets() {
+        if (sectionMeasurementUnits != null) {
+            removeElementsAndControls(sectionMeasurementUnits);
+            removeElementsAndControls(sectionStatisticalMeasures);
+            removeElementsAndControls(sectionModifierVocabularies);
         }
-       }
-
-       private void activateQuantitativeWidgets(){
-           //disable categorical widgets
-           supportsCategoricalData.setSelection(false);
-           getEntity().setSupportsCategoricalData(false);
-           removeCategoricalWidgets();
-
-           //measurement units
-           sectionMeasurementUnits = formFactory.createMeasurementUnitDtoCollectionSection(getConversationHolder(),
-                   parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionMeasurementUnits.setEntity((getEntity()));
-
-           //statistical measures
-           sectionStatisticalMeasures = formFactory.createStatisticalMeasureDtoCollectionSection(
-                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionStatisticalMeasures.setEntity((getEntity()));
-
-           //modifiers
-           sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesDtoCollectionSection(
-                   getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-           sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionModifierVocabularies.setEntity((getEntity()));
-       }
-
-       private void removeQuantitativeWidgets(){
-           if(sectionMeasurementUnits!=null){
-               removeElementsAndControls(sectionMeasurementUnits);
-               removeElementsAndControls(sectionStatisticalMeasures);
-               removeElementsAndControls(sectionModifierVocabularies);
-           }
-       }
-
-       private void activateCategoricalWidgets(){
-           //disable quantitative widgeets
-           supportsQuantitativeData.setSelection(false);
-           getEntity().setSupportsQuantitativeData(false);
-           removeQuantitativeWidgets();
-
-           //states
-           sectionStateVocabularies = formFactory.createStateVocabulariesDtoSection(getConversationHolder(),
-                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+    }
+
+    private void activateCategoricalWidgets() {
+        // disable quantitative widgeets
+        supportsQuantitativeData.setSelection(false);
+        getEntity().setSupportsQuantitativeData(false);
+        removeQuantitativeWidgets();
+
+        // states
+        sectionStateVocabularies = formFactory.createStateVocabulariesDtoSection(parentFormElement,
+                StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
         sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionStateVocabularies.setEntity((getEntity()));
 
-        //modifiers
+        // modifiers
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesDtoCollectionSection(
-                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class,
+                        getEntity().getClass().getCanonicalName(), true));
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionModifierVocabularies.setEntity((getEntity()));
-       }
+    }
 
-       private void removeCategoricalWidgets(){
-           if(sectionStateVocabularies!=null){
-               removeElementsAndControls(sectionStateVocabularies);
-               removeElementsAndControls(sectionModifierVocabularies);
-           }
-       }
+    private void removeCategoricalWidgets() {
+        if (sectionStateVocabularies != null) {
+            removeElementsAndControls(sectionStateVocabularies);
+            removeElementsAndControls(sectionModifierVocabularies);
+        }
+    }
 
-       @Override
+    @Override
     public void propertyChange(PropertyChangeEvent event) {
-           EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
-           super.propertyChange(event);
+        EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity().getUuid());
+        super.propertyChange(event);
+
+    }
 
-       }
+    @Override
+    public void fillFields() {
+        if (getEntity() != null) {
+            element_Representation.setTermDto(getEntity(), true);
+            supportsQuantitativeData.setSelection(getEntity().isSupportsQuantitativeData());
+            supportsCategoricalData.setSelection(getEntity().isSupportsCategoricalData());
+            availableForTaxon.setSelection(getEntity().isAvailableForTaxon());
+            availableForTaxonName.setSelection(getEntity().isAvailableForTaxonName());
+            availableForSpecimenOrObservation.setSelection(getEntity().isAvailableForOccurrence());
+            sectionStateVocabularies.setEntity(getEntity());
+            sectionMeasurementUnits.setEntity(getEntity());
+            sectionStatisticalMeasures.setEntity(getEntity());
+            sectionModifierVocabularies.setEntity(getEntity());
+            text_structure.setText(getEntity().getStructure().getPath());
+            text_property.setText(getEntity().getProperty().getPath());
+            ratioTo.setText(getEntity().getRatioTo() != null ? getEntity().getRatioTo().getPath() : null);
+        }
+
+    }
 
 }
old mode 100755 (executable)
new mode 100644 (file)
index e98985c..f911dea
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.persistence.dto.CharacterDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -18,17 +17,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class CharacterDtoDetailSection extends AbstractCdmDetailSection<CharacterDto> {
 
        public CharacterDtoDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -36,13 +33,9 @@ public class CharacterDtoDetailSection extends AbstractCdmDetailSection<Characte
                return "Character";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<CharacterDto> createCdmDetailElement(AbstractCdmDetailSection<CharacterDto> parentElement,
             int style) {
         return formFactory.createCharacterDtoDetailElement(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
index 1161bb0d47f354666546f59daa31839082a53d23..e49d37c9e0555e89f3d854f62cc513217e86fc63 100644 (file)
@@ -27,23 +27,6 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
     private CharacterDetailSection characterDetails;
 
     private ICdmFormElement parentFormElement;
-//
-//    protected RepresentationElement element_Representation;
-//
-//    private TermComboElement<DefinedTerm> comboStructuralModifier;
-//
-//    private CheckboxElement supportsQuantitativeData;
-//
-//    private CheckboxElement supportsCategoricalData;
-//
-//    private StateVocabularyCollectionSection sectionStateVocabularies;
-//
-//    private MeasurementUnitCollectionSection sectionMeasurementUnits;
-//
-//    private StatisticalMeasureCollectionSection sectionStatisticalMeasures;
-//
-//    private RecommendedModifierVocabulariesCollectionSection sectionModifierVocabularies;
-
     private InapplicableIfEntityCollectionSectionForNode sectionInapplicableIf;
     private OnlyApplicableIfEntityCollectionSectionForNode sectionOnlyApplicableIf;
 
@@ -56,59 +39,22 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
        protected void createControls(ICdmFormElement formElement, TermNode<Character> entity, int style) {
            this.parentFormElement = formElement;
 //         characterDetails = formFactory.createCharacterDetailElement(formElement, style);
-           characterDetails = formFactory.createCharacterDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(CharacterDetailSection.class, entity.getClass().getCanonicalName(), true));
+           characterDetails = formFactory.createCharacterDetailSection(formElement, null, StoreUtil.getSectionStyle(CharacterDetailSection.class, entity.getClass().getCanonicalName(), true));
            characterDetails.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addElement(characterDetails);
            addControl(characterDetails);
            characterDetails.setEntity(entity.getTerm());
-//         element_Representation = formFactory.createTranslatableRepresentationElement(formElement,  entity.getTerm().getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity.getTerm(), 100, style, true);
-//
-//         createText(formElement, "Structure", getStructureText(entity.getTerm()));
-//         createText(formElement, "Property", getPropertyText(entity.getTerm()));
-//
-//        comboStructuralModifier = formFactory.createDefinedTermComboElement(TermType.StructureModifier, formElement, "Structural Modifier", entity.getTerm().getStructureModifier(), style);
-//
-//         supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.getTerm().isSupportsQuantitativeData(), style);
-//         supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.getTerm().isSupportsCategoricalData(), style);
-//
-//        if (supportsCategoricalData.getSelection()) {
-//            sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-//                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionStateVocabularies.setEntity(entity.getTerm());
-//        }
-//        if (supportsQuantitativeData.getSelection()) {
-//            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-//                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionMeasurementUnits.setEntity(entity.getTerm());
-//
-//            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(),
-//                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionStatisticalMeasures.setEntity(entity.getTerm());
-//        }
-//        if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {
-//            sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionModifierVocabularies.setEntity(entity.getTerm());
-//        }
-
         // applicability
-        sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSectionForNode(getConversationHolder(),
+        sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSectionForNode(
                 formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
         sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionInapplicableIf.setEntity(getEntity());
-        sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSectionForNode(getConversationHolder(),
-                formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
+        sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSectionForNode(formElement,
+                StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
         sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionOnlyApplicableIf.setEntity(entity);
-        
     }
 
-
-
     public static String getPropertyText(Character entity) {
         return entity.getProperty()!=null?StoreUtil.getPath(entity.getProperty()):"[no property]";
     }
@@ -126,115 +72,19 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
         super.setEntity(entity);
         characterDetails.setEntity(entity.getTerm());
         setEnabled(TermBasePropertyTester.isModifiable(entity));
-        
     }
-    
-    
 
        @Override
        public void handleEvent(Object eventSource) {
 
-//         if(eventSource == characterDetails){
-//             getEntity().getTerm().setStructureModifier(comboStructuralModifier.getSelection());
-//         }
-//         if(eventSource == supportsQuantitativeData || eventSource == supportsCategoricalData){
-//             //if any type is selected disable supportsTextData
-//             getEntity().getTerm().setSupportsTextData(false);
-//         }
-//         if(eventSource == supportsQuantitativeData){
-//             getEntity().getTerm().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
-//             if(supportsQuantitativeData.getSelection()){
-//                 activateQuantitativeWidgets();
-//             }
-//             else{
-//                 removeQuantitativeWidgets();
-//             }
-//            StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-//         }
-//         else if(eventSource == supportsCategoricalData){
-//             getEntity().getTerm().setSupportsCategoricalData(supportsCategoricalData.getSelection());
-//            if (supportsCategoricalData.getSelection()) {
-//                activateCategoricalWidgets();
-//            }
-//             else{
-//                 removeCategoricalWidgets();
-//             }
-//            StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-//         }
-//         else if (eventSource == element_Representation) {
-//            Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
-//            if(selectedRepresentation!=null){
-//                Language representationLanguage = selectedRepresentation.getLanguage();
-//                if(representationLanguage==null){
-//                    representationLanguage = Language.getDefaultLanguage();
-//                }
-//                getEntity().getTerm().setLabel(selectedRepresentation.getLabel(),  representationLanguage);
-//                getEntity().getTerm().getRepresentation(representationLanguage).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
-//                getEntity().getTerm().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
-//            }
-//            getEntity().getTerm().setTitleCache(null);
-//        }
-       }
-
-
 
-//     private void activateQuantitativeWidgets(){
-//         //disable categorical widgets
-//         supportsCategoricalData.setSelection(false);
-//         getEntity().getTerm().setSupportsCategoricalData(false);
-//         removeCategoricalWidgets();
-//
-//         //measurement units
-//         sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-//                 parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionMeasurementUnits.setEntity(getEntity().getTerm());
-//
-//         //statistical measures
-//         sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-//                 getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionStatisticalMeasures.setEntity(getEntity().getTerm());
-//
-//         //modifiers
-//         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                 getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionModifierVocabularies.setEntity(getEntity().getTerm());
-//     }
-//
-//     private void removeQuantitativeWidgets(){
-//         if(sectionMeasurementUnits!=null){
-//             removeElementsAndControls(sectionMeasurementUnits);
-//             removeElementsAndControls(sectionStatisticalMeasures);
-//             removeElementsAndControls(sectionModifierVocabularies);
-//         }
-//     }
-//
-//     private void activateCategoricalWidgets(){
-//         //disable quantitative widgeets
-//         supportsQuantitativeData.setSelection(false);
-//         getEntity().getTerm().setSupportsQuantitativeData(false);
-//         removeQuantitativeWidgets();
-//
-//         //states
-//         sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-//                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//        sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//        sectionStateVocabularies.setEntity(getEntity().getTerm());
-//
-//        //modifiers
-//        sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//        sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//        sectionModifierVocabularies.setEntity(getEntity().getTerm());
-//     }
-//
-//     private void removeCategoricalWidgets(){
-//         if(sectionStateVocabularies!=null){
-//             removeElementsAndControls(sectionStateVocabularies);
-//             removeElementsAndControls(sectionModifierVocabularies);
-//         }
-//     }
+       }
 
-}
+       @Override
+       public void fillFields() {
+               characterDetails.setEntity(getEntity().getTerm());
+               sectionInapplicableIf.setEntity(getEntity());
+           sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
+}
\ No newline at end of file
index 48eb49b7287fea16f2713c0a78faf879d30d1fc4..e6f5775052d60ef7122b83d06d20782fb6530faa 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Character;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -22,14 +21,13 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author pplitzner
  * @since Aug 19, 2019
- *
  */
 public class CharacterNodeDetailSection extends AbstractCdmDetailSection<TermNode<Character>> {
 
        public CharacterNodeDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -37,13 +35,9 @@ public class CharacterNodeDetailSection extends AbstractCdmDetailSection<TermNod
                return "Character Node";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<TermNode<Character>> createCdmDetailElement(AbstractCdmDetailSection<TermNode<Character>> parentElement,
             int style) {
         return formFactory.createCharacterNodeDetailElement(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 4e1da7a..0f8de04
@@ -45,18 +45,18 @@ public class CharacterNodeDtoDetailElement extends AbstractCdmDetailElement<Term
        protected void createControls(ICdmFormElement formElement, TermNodeDto entity, int style) {
            this.parentFormElement = formElement;
 //         characterDetails = formFactory.createCharacterDetailElement(formElement, style);
-           characterDetails = formFactory.createCharacterDtoDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(CharacterDetailSection.class, entity.getClass().getCanonicalName(), true));
+           characterDetails = formFactory.createCharacterDtoDetailSection(formElement, null, StoreUtil.getSectionStyle(CharacterDetailSection.class, entity.getClass().getCanonicalName(), true));
            characterDetails.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addElement(characterDetails);
            addControl(characterDetails);
            characterDetails.setEntity((CharacterDto)entity.getTerm());
 
         // applicability
-        sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(getConversationHolder(),
+        sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(
                 formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
         sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionInapplicableIf.setEntity(getEntity());
-        sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(getConversationHolder(),
+        sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(
                 formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
         sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionOnlyApplicableIf.setEntity(entity);
@@ -131,6 +131,14 @@ public class CharacterNodeDtoDetailElement extends AbstractCdmDetailElement<Term
 //        }
        }
 
+       @Override
+       public void fillFields() {
+               characterDetails.setEntity((CharacterDto)getEntity().getTerm());
+               sectionInapplicableIf.setEntity(getEntity());
+               sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
+
 //     private void activateQuantitativeWidgets(){
 //         //disable categorical widgets
 //         supportsCategoricalData.setSelection(false);
@@ -138,20 +146,20 @@ public class CharacterNodeDtoDetailElement extends AbstractCdmDetailElement<Term
 //         removeCategoricalWidgets();
 //
 //         //measurement units
-//         sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
+//         sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(
 //                 parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
 //         sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //         sectionMeasurementUnits.setEntity(getEntity().getTerm());
 //
 //         //statistical measures
 //         sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-//                 getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+//                 parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
 //         sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //         sectionStatisticalMeasures.setEntity(getEntity().getTerm());
 //
 //         //modifiers
 //         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                 getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+//                 parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
 //         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //         sectionModifierVocabularies.setEntity(getEntity().getTerm());
 //     }
@@ -171,14 +179,14 @@ public class CharacterNodeDtoDetailElement extends AbstractCdmDetailElement<Term
 //         removeQuantitativeWidgets();
 //
 //         //states
-//         sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
+//         sectionStateVocabularies = formFactory.createStateVocabulariesSection(
 //                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
 //        sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //        sectionStateVocabularies.setEntity(getEntity().getTerm());
 //
 //        //modifiers
 //        sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
+//                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
 //        sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //        sectionModifierVocabularies.setEntity(getEntity().getTerm());
 //     }
old mode 100755 (executable)
new mode 100644 (file)
index 36c3135..171bba5
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,9 +22,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class CharacterNodeDtoDetailSection extends AbstractCdmDetailSection<TermNodeDto> {
 
        public CharacterNodeDtoDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
index 131689f6bbfa2dea0371701324423b4a017cd46a..fb351bc409279e35e993c722a1be2c85bb10eccd 100644 (file)
@@ -17,10 +17,9 @@ import java.util.Map;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Label;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.service.geo.IDistributionService;
 import eu.etaxonomy.cdm.common.URI;
 import eu.etaxonomy.cdm.common.UriUtils;
-import eu.etaxonomy.cdm.ext.geo.IEditGeoService;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
@@ -98,17 +97,19 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                // FIXME due to a bug in the rest map service we have to ensure that width will always be an even number
                // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 :
                int width = image.calculateWidth();
-                IEditGeoService editGeoService;
-               List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
-               editGeoService = ((CdmApplicationRemoteController)CdmStore.getCurrentApplicationConfiguration()).getEditGeoService();
 
-               String parameter = editGeoService.getDistributionServiceRequestParameterString(
+               List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
+               IDistributionService distributionService = CdmStore.getCurrentApplicationConfiguration().getDistributionService();
+               boolean includeUnpublished = true;
+               
+               String parameter = distributionService.getDistributionServiceRequestParameterString(
                                getTaxonDescriptions(),
                 false,
                 false,
                 null,
                 presenceAbsenceTermColors,
-                languages);
+                languages,
+                includeUnpublished);
 
                String mapUriString = String.format("%s?%s&ms=1000&bbox=-180,-90,180,90&l=earth", accessPoint, parameter);
                return mapUriString;
@@ -127,4 +128,31 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
            return false;
        }
 
+       @Override
+       public void fillFields() {
+               String serviceUriString = PreferencesUtil.getStringValue(PreferencePredicate.EditMapServiceAccessPoint.getKey());
+               String message = null;
+               try {
+                       URI serviceUri = new URI(serviceUriString);
+                       if(UriUtils.isServiceAvailable(serviceUri, 500)){
+//                             image = formFactory.createBrowserElement(formElement, null, style);
+                               // FIXME : This is a temporary workaround which ic
+                               //         waiting for #5357 to be fixed
+                               if(!isUnsavedDistribution(getEntity())) {
+                                   String mapUriString = getMapUriString(getEntity());
+                                   image.setImageUriString(mapUriString);
+                                   message = mapUriString;
+                               }
+                               getParentElement().getLayoutComposite().layout();
+
+                               return;
+                       } else {
+                               message = String.format("The service is not available: %s", serviceUriString);
+                       }
+               } catch (URISyntaxException e) {
+                       message = String.format("The URI has problems: %s", serviceUriString);
+               }
+
+       }
+
 }
index 2276eaa4e4f878f525a0a6ff66bde43ef5f6463b..d3608d09220beb583469933a820d362e641f0e4b 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,40 +22,23 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author n.hoffmann
  * @created Sep 23, 2010
- * @version 1.0
  */
 public class FeatureDistributionDetailSection extends AbstractCdmDetailSection<Feature> {
 
-       /**
-        * <p>Constructor for FeatureDistributionDetailSection.</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 FeatureDistributionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Distribution Map";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<Feature> parentElement, int style) {
            //FIXME generic
            return formFactory.createFeatureDistributionDetailElement(parentElement);
        }
-}
+}
\ No newline at end of file
index 44cb4e2f2bbcf3672a79aafa1b8441bf183ddc5c..cc4898fb8db6d3fe13c82c675df4be0d67951486 100644 (file)
@@ -31,10 +31,9 @@ import org.eclipse.swt.widgets.Text;
 import eu.etaxonomy.cdm.api.service.ITermNodeService;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.FeatureState;
-import eu.etaxonomy.cdm.model.description.State;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermNode;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
@@ -51,7 +50,6 @@ import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 /**
  * @author pplitzner
  * @since Aug 16, 2019
- *
  */
 public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizardPage {
 
@@ -59,7 +57,7 @@ public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizar
     private Button btnSelectState;
 
     private TermNodeDto termNode;
-    private State selectedState = null;
+    private DefinedTermBase<?> selectedState = null;
     private List<TermVocabularyDto> stateVocabulariesDtos = new ArrayList<>();
     private Text text;
 
@@ -74,7 +72,8 @@ public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizar
     public void createControl(Composite parent) {
         super.createControl(parent);
 
-        comboFeature = formFactory.createDefinedTermComboElement(Collections.EMPTY_LIST, rootElement, "Parent Feature", null, SWT.NONE);
+        comboFeature = formFactory.createDefinedTermComboElement(Collections.EMPTY_LIST, rootElement, "Parent Feature",
+                null, SWT.NONE);
 
         Label label = new Label(rootElement.getLayoutComposite(), SWT.NONE);
         label.setText("State");
@@ -96,8 +95,8 @@ public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizar
 
                 if (dialog.open() == IStatus.OK) {
                     Collection<DefinedTermBase> additionalTerms = wizard.getAdditionalFeatures();
-                    if(additionalTerms.size()==1){
-                        selectedState = (State) additionalTerms.iterator().next();
+                    if (additionalTerms.size() == 1) {
+                        selectedState = additionalTerms.iterator().next();
                         text.setText(selectedState.getLabel());
                         FeatureStateWizardPage.this.getWizard().getContainer().updateButtons();
                     }
@@ -110,29 +109,31 @@ public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizar
         updateFeatureCombo();
     }
 
-    FeatureStateDto getFeatureStateDto(){
-        return new FeatureStateDto(null, FeatureDto.fromFeature(comboFeature.getSelection()), TermDto.fromTerm(selectedState));
+    FeatureStateDto getFeatureStateDto() {
+        return new FeatureStateDto(null, FeatureDto.fromFeature(comboFeature.getSelection()),
+                TermDto.fromTerm(selectedState));
     }
-    FeatureState getFeatureState(){
+
+    FeatureState getFeatureState() {
         return FeatureState.NewInstance(comboFeature.getSelection(), selectedState);
     }
-    private void updateFeatureCombo(){
+
+    private void updateFeatureCombo() {
         List<Feature> features = new ArrayList<>();
         UUID parentUuid = termNode.getParentUuid();
-        if (parentUuid != null){
+        if (parentUuid != null) {
             TermNode<? extends Feature> parent = CdmStore.getService(ITermNodeService.class).load(parentUuid);
-            while(parent!=null){
+            while (parent != null) {
                 Feature parentTerm = parent.getTerm();
-                if(parentTerm!=null
-                        && parentTerm.isSupportsCategoricalData()
-                        && !parentTerm.getSupportedCategoricalEnumerations().isEmpty()){
+                if (parentTerm != null && parentTerm.isSupportsCategoricalData()
+                        && !parentTerm.getSupportedCategoricalEnumerations().isEmpty()) {
                     features.add(parentTerm);
                 }
                 parent = parent.getParent();
             }
         }
         comboFeature.setTerms(features);
-        if(features.size()==1){
+        if (features.size() == 1) {
             Feature feature = features.get(0);
             comboFeature.setSelection(feature);
             updateStateCombo(feature);
@@ -140,31 +141,34 @@ public class FeatureStateWizardPage extends AbstractEntityCollectionElementWizar
         }
     }
 
-    private void updateStateCombo(Feature feature){
+    private void updateStateCombo(Feature feature) {
         stateVocabulariesDtos.clear();
         text.setText("");
         selectedState = null;
-        if(feature!=null){
-            Set<TermVocabulary<State>> stateVocabularies = feature.getSupportedCategoricalEnumerations();
-            for (TermVocabulary<State> termVocabulary : stateVocabularies) {
-                stateVocabulariesDtos.add(new TermVocabularyDto(termVocabulary.getUuid(), termVocabulary.getRepresentations(), termVocabulary.getTermType(), termVocabulary.getTitleCache(), termVocabulary.isAllowDuplicates(), termVocabulary.isOrderRelevant(), termVocabulary.isFlat()));
+        if (feature != null) {
+            Set<TermCollection<? extends DefinedTermBase, ?>> stateVocabularies = feature
+                    .getSupportedCategoricalEnumerations();
+            for (TermCollection<? extends DefinedTermBase, ?> termVocabulary : stateVocabularies) {
+                stateVocabulariesDtos.add(new TermVocabularyDto(termVocabulary.getUuid(),
+                        termVocabulary.getRepresentations(), termVocabulary.getTermType(),
+                        termVocabulary.getTitleCache(), termVocabulary.isAllowDuplicates(),
+                        termVocabulary.isOrderRelevant(), termVocabulary.isFlat()));
             }
         }
     }
 
     @Override
     public boolean isPageComplete() {
-        return comboFeature.getSelection()!=null && selectedState!=null;
+        return comboFeature.getSelection() != null && selectedState != null;
     }
 
     @Override
     public void propertyChange(PropertyChangeEvent event) {
-        if(event.getSource()==comboFeature){
+        if (event.getSource() == comboFeature) {
             Feature feature = comboFeature.getSelection();
             updateStateCombo(feature);
             comboFeature.removeEmptyElement();
         }
         getWizard().getContainer().updateButtons();
     }
-
-}
+}
\ No newline at end of file
index 230b9727a22d171a75ab2ebe1b611be76b1aa5e4..efe6b60f6c490bf0d203cee62ef4f56671bccb26 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2018 EDIT
 * European Distributed Institute of Taxonomy
@@ -14,7 +13,7 @@ import java.util.Comparator;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.WizardDialog;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDtoComparator;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
@@ -22,40 +21,27 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
-
 /**
  * @author pplitzner
  * @date 06.03.2018
- *
  */
 public class InapplicableIfEntityCollectionSection extends AbstractEntityCollectionSection<TermNodeDto, FeatureStateDto>{
 
-    public InapplicableIfEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public InapplicableIfEntityCollectionSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Inapplicable If", style);
-        
+        super(formFactory, parentElement, "Inapplicable If", style);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Collection<FeatureStateDto> getCollection(TermNodeDto entity) {
         return entity.getInapplicableIf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Comparator<FeatureStateDto> getComparator() {
        return new FeatureStateDtoComparator();
     }
 
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureStateDto createNewElement() {
         FeatureStateWizard wizard = new FeatureStateWizard(getEntity(), formFactory);
@@ -67,48 +53,33 @@ public class InapplicableIfEntityCollectionSection extends AbstractEntityCollect
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void addElement(FeatureStateDto element) {
         getEntity().getInapplicableIf().add(element);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureStateDto addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void removeElement(FeatureStateDto element) {
         getEntity().getInapplicableIf().remove(element);
     }
 
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No feature state added yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a feature state";
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 4ab5fd4..a8857ec
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2018 EDIT
 * European Distributed Institute of Taxonomy
@@ -15,10 +14,8 @@ import java.util.Comparator;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.FeatureState;
 import eu.etaxonomy.cdm.model.term.TermNode;
-import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -28,35 +25,24 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date 06.03.2018
- *
  */
 public class InapplicableIfEntityCollectionSectionForNode extends AbstractEntityCollectionSection<TermNode, FeatureState>{
 
-    public InapplicableIfEntityCollectionSectionForNode(CdmFormFactory formFactory, ConversationHolder conversation,
+    public InapplicableIfEntityCollectionSectionForNode(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Inapplicable If", style);
+        super(formFactory, parentElement, "Inapplicable If", style);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Collection<FeatureState> getCollection(TermNode entity) {
         return entity.getInapplicableIf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Comparator<FeatureState> getComparator() {
         return new DefaultCdmBaseComparator<>();
     }
 
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureState createNewElement() {
         FeatureStateWizard wizard = new FeatureStateWizard(TermNodeDto.fromNode(getEntity(), null), formFactory);
@@ -68,48 +54,33 @@ public class InapplicableIfEntityCollectionSectionForNode extends AbstractEntity
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void addElement(FeatureState element) {
         getEntity().getInapplicableIf().add(element);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureState addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void removeElement(FeatureState element) {
         getEntity().getInapplicableIf().remove(element);
     }
 
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No feature state added yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a feature state";
     }
-
-}
+}
\ No newline at end of file
index 4001c3ce183dd07955043d852981522e0ce6d041..a4dc877566e4f5138e1592622d143ca19aa3479a 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2018 EDIT
 * European Distributed Institute of Taxonomy
@@ -15,11 +14,9 @@ import java.util.Comparator;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDto;
-import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.FeatureStateDtoComparator;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
@@ -28,35 +25,24 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 /**
  * @author pplitzner
  * @date 06.03.2018
- *
  */
 public class OnlyApplicableIfEntityCollectionSection extends AbstractEntityCollectionSection<TermNodeDto, FeatureStateDto>{
 
-    public OnlyApplicableIfEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public OnlyApplicableIfEntityCollectionSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Only applicable if", style);
+        super(formFactory, parentElement, "Only applicable if", style);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Collection<FeatureStateDto> getCollection(TermNodeDto entity) {
         return entity.getOnlyApplicableIf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Comparator<FeatureStateDto> getComparator() {
         return new FeatureStateDtoComparator();
-             
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureStateDto createNewElement() {
         FeatureStateWizard wizard = new FeatureStateWizard(getEntity(), formFactory);
@@ -68,48 +54,33 @@ public class OnlyApplicableIfEntityCollectionSection extends AbstractEntityColle
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void addElement(FeatureStateDto element) {
         getEntity().getOnlyApplicableIf().add(element);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureStateDto addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void removeElement(FeatureStateDto element) {
         getEntity().getOnlyApplicableIf().remove(element);
     }
 
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No feature state added yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a feature state";
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 5b442e0..6e54b1c
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2018 EDIT
 * European Distributed Institute of Taxonomy
@@ -15,7 +14,6 @@ import java.util.Comparator;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.FeatureState;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
@@ -27,34 +25,24 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date 06.03.2018
- *
  */
 public class OnlyApplicableIfEntityCollectionSectionForNode extends AbstractEntityCollectionSection<TermNode, FeatureState>{
 
-    public OnlyApplicableIfEntityCollectionSectionForNode(CdmFormFactory formFactory, ConversationHolder conversation,
+    public OnlyApplicableIfEntityCollectionSectionForNode(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Only applicable if", style);
+        super(formFactory, parentElement, "Only applicable if", style);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Collection<FeatureState> getCollection(TermNode entity) {
         return entity.getOnlyApplicableIf();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Comparator<FeatureState> getComparator() {
         return new DefaultCdmBaseComparator<>();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureState createNewElement() {
         FeatureStateWizard wizard = new FeatureStateWizard(TermNodeDto.fromNode(getEntity(), null), formFactory);
@@ -66,48 +54,33 @@ public class OnlyApplicableIfEntityCollectionSectionForNode extends AbstractEnti
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void addElement(FeatureState element) {
         getEntity().getOnlyApplicableIf().add(element);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public FeatureState addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void removeElement(FeatureState element) {
         getEntity().getOnlyApplicableIf().remove(element);
     }
 
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No feature state added yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a feature state";
     }
-
-}
+}
\ No newline at end of file
index eca45b8a6c78d18f72cb0dcb3c945f06f0316447..827d606c7c211f4fce0966073f0ca4a4c1183af7 100644 (file)
@@ -10,7 +10,10 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -38,22 +41,25 @@ public class TermNodeDetailElement extends AbstractCdmDetailElement<TermNodeDto>
 
        @Override
        protected void createControls(ICdmFormElement formElement, TermNodeDto entity, int style) {
-
-
-           sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(getConversationHolder(),
-                    formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
-           sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionInapplicableIf.setEntity(getEntity());
-           sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(getConversationHolder(),
-                   formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
-           sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-           sectionOnlyApplicableIf.setEntity(getEntity());
-
+               
+               if (entity.getType().equals(TermType.Feature)) {
+                   sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(
+                           formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
+                   sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+                   sectionInapplicableIf.setEntity(getEntity());
+                   sectionOnlyApplicableIf = formFactory.createOnlyApplicableIfEntityCollectionSection(
+                           formElement, StoreUtil.getSectionStyle(OnlyApplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
+                   sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+                   sectionOnlyApplicableIf.setEntity(getEntity());
+               }
 
            DefinedTermBase term = CdmStore.getService(ITermService.class).load(getEntity().getTerm().getUuid());
            AbstractCdmDetailElement termDetailElement = formFactory.createDefinedTermDetailElement(term.getClass(), formElement, style);
            termDetailElement.setEntity(term);
            termDetailElement.setEnabled(false);
+           if (!TermBasePropertyTester.isModifiable(entity)) {
+               this.setEnabled(false);
+           }
 
     }
 
@@ -62,6 +68,13 @@ public class TermNodeDetailElement extends AbstractCdmDetailElement<TermNodeDto>
            EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity().getUuid());
        }
 
+       @Override
+       public void fillFields() {
+               sectionInapplicableIf.setEntity(getEntity());
+           sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
+
 
 
 }
index 2d819d113a6cb220db43f96edadcd7ca7eb9a6e7..c6ec36cddab0dc65e421e24390e9f2b8a755d340 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.term.TermNode;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -20,17 +19,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class TermNodeDetailSection extends AbstractCdmDetailSection<TermNodeDto> {
 
        public TermNodeDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -40,13 +37,9 @@ public class TermNodeDetailSection extends AbstractCdmDetailSection<TermNodeDto>
                return header;
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<TermNodeDto> createCdmDetailElement(AbstractCdmDetailSection<TermNodeDto> parentElement,
             int style) {
         return formFactory.createFeatureNodeDetailElement(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
index eac9ab0a1d35076b9537c4eead69548864cf700e..d185b02c1137224375ff37655e8fd90f16dc0b94 100644 (file)
@@ -13,11 +13,11 @@ import org.eclipse.swt.widgets.Label;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.term.Representation;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.ColorResources;
 import eu.etaxonomy.taxeditor.preference.Resources;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -35,7 +35,7 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
     private CheckboxElement orderRelevant;
     private CheckboxElement isFlat;
 
-    //private TextWithLabelElement titleCacheText;
+    private TextWithLabelElement titleCacheText;
     protected RepresentationElement element_Representation;
 
        public TermTreeDetailElement(CdmFormFactory formFactory,
@@ -51,9 +51,9 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
            lblStructureText.setText(entity.getTermType().getLabel());
            lblStructureText.setForeground(ColorResources.getColor(Resources.BLACK));
 
-//         titleCacheText = formFactory.createTextWithLabelElement(
-//                formElement, "Title Cache", entity.getTitleCache(), style);
-           element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement,  entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
+           titleCacheText = formFactory.createTextWithLabelElement(
+                formElement, "Title Cache", entity.getTitleCache(), style);
+           //element_Representation = formFactory.createTranslatableRepresentationElementDto(formElement,  entity.getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity, 100, style, true);
            allowDuplicates = formFactory.createCheckbox(formElement, "Allow duplicates", entity.isAllowDuplicate(), style);
            if (entity.isContainsDuplicates() && entity.isAllowDuplicate()){
                allowDuplicates.setEnabled(false);
@@ -64,15 +64,21 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
            if (entity.containsSubtrees()){
                isFlat.setEnabled(false);
            }
+           if (!TermBasePropertyTester.isModifiable(entity)) {
+               this.setEnabled(false);
+           }
        }
 
        @Override
-       protected void updateControlStates() {
+       public void updateControlStates() {
            super.updateControlStates();
        }
 
        @Override
        public void handleEvent(Object eventSource) {
+           if (eventSource == titleCacheText) {
+               getEntity().setTitleCache(titleCacheText.getText());
+           }
            if (eventSource == element_Representation) {
 //                 getEntity().setTitleCache(titleCacheText.getText());
                Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
@@ -92,7 +98,7 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
                        getEntity().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
                 }
             }
-            getEntity().setTitleCache(null);
+            //getEntity().setTitleCache(null);
         }
            else
            if (eventSource == allowDuplicates) {
@@ -106,4 +112,14 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
            }
            EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
        }
+
+       @Override
+       public void fillFields() {
+
+           allowDuplicates.setSelection(getEntity().isAllowDuplicate());
+           orderRelevant.setSelection(getEntity().isOrderRelevant());
+           isFlat.setSelection(getEntity().isFlat());
+           element_Representation.setTermDto(getEntity(), enabled);
+
+       }
 }
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index a83c0b1..19c0db0
@@ -22,7 +22,6 @@ 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.RepresentationElement;
-import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
@@ -70,7 +69,7 @@ public class TermTreeDetailElementForNode extends AbstractCdmDetailElement<TermT
     }
 
        @Override
-       protected void updateControlStates() {
+       public void updateControlStates() {
            super.updateControlStates();
 //         toggleable_cache.setEnabled(getEntity().isProtectedTitleCache());
        }
@@ -102,4 +101,13 @@ public class TermTreeDetailElementForNode extends AbstractCdmDetailElement<TermT
            }
        }
 
+
+       @Override
+       public void fillFields() {
+                allowDuplicates.setSelection(getEntity().isAllowDuplicates());
+                orderRelevant.setSelection(getEntity().isOrderRelevant());
+                isFlat.setSelection(getEntity().isFlat());
+               
+       }
+
 }
index ff38af08d653716537046546f0525a25e4429f08..01b6e6961e6078095f5e1d2cdcc4d7fbb66342b0 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -19,17 +18,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class TermTreeDetailSection extends AbstractCdmDetailSection<TermTreeDto> {
 
        public TermTreeDetailSection(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -37,13 +34,9 @@ public class TermTreeDetailSection extends AbstractCdmDetailSection<TermTreeDto>
                return TermTree.class.getSimpleName();
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<TermTreeDto> createCdmDetailElement(AbstractCdmDetailSection<TermTreeDto> parentElement,
             int style) {
         return formFactory.createFeatureTreeDetailElement(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index ff2dffb..79fc157
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.feature;
 import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.term.TermTree;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -19,17 +18,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- *
  * @author pplitzner
  * @since Dec 21, 2017
- *
  */
 public class TermTreeDetailSectionForNode extends AbstractCdmDetailSection<TermTree> {
 
        public TermTreeDetailSectionForNode(CdmFormFactory formFactory,
-               ConversationHolder conversation, ICdmFormElement parentElement,
+               ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -39,13 +36,9 @@ public class TermTreeDetailSectionForNode extends AbstractCdmDetailSection<TermT
         return header;
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     protected AbstractCdmDetailElement<TermTree> createCdmDetailElement(AbstractCdmDetailSection<TermTree> parentElement,
             int style) {
         return formFactory.createFeatureTreeDetailElementForTree(parentElement, style);
     }
-
-}
+}
\ No newline at end of file
index 2d2d016621e0021866603292c60df4d14f2e792d..9b8711d52bbff0f9df9fe9bc63c37b3e29ea1583 100644 (file)
@@ -53,7 +53,7 @@ public class GrantedAuthorityCollectionElement extends AbstractEntityCollectionE
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_authority = formFactory.createSelectionElement(
-                                       GrantedAuthorityImpl.class, //getConversationHolder(),
+                                       GrantedAuthorityImpl.class,
                                        element, "", getEntity(), EntitySelectionElement.SELECTABLE, style);
        }
 
index a75270ef3efa602f93295ccfa57215f6073aff45..3d7f3029bb6d39a9b4f1177a124baa8345209417 100644 (file)
@@ -54,6 +54,12 @@ public class GrantedAuthorityDetailElement extends AbstractCdmDetailElement<Gran
 
        }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 
 
 }
index 896f65df9c9f593bb99a0a350a7b0f4d2c68734e..0e13e55b6142b7836493f83c993bda1c1f833cc0 100644 (file)
@@ -6,7 +6,6 @@
  * 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.grantedAuthority;
 
 import java.util.Collection;
@@ -14,7 +13,6 @@ import java.util.Comparator;
 
 import org.springframework.security.core.GrantedAuthority;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.GrantedAuthoritySelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -24,31 +22,17 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 /**
  * @author n.hoffmann
  * @created Mar 9, 2011
- * @version 1.0
  */
 public class GrantedAuthorityDetailSection extends
                AbstractEntityCollectionSection<Group, GrantedAuthority> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public GrantedAuthorityDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Granted Authorities",
+               super(formFactory, parentElement, "Granted Authorities",
                                style);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getCollection(java.lang.Object)
-        */
        @Override
        public Collection<GrantedAuthority> getCollection(Group entity) {
                return entity.getGrantedAuthorities();
@@ -71,83 +55,45 @@ public class GrantedAuthorityDetailSection extends
         };
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * createNewElement()
-        */
        @Override
        public GrantedAuthority createNewElement() {
 //             StoreUtil
 //                             .warningDialog("Not implemented yet", getClass(),
 //                                             "This functionality needs to be implemented in CDM Library first.");
 
-               GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(), //getConversationHolder(),
+               GrantedAuthority selection = GrantedAuthoritySelectionDialog.select(getLayoutComposite().getShell(),
                        null);
                return selection;
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
-        * (java.lang.Object)
-        */
        @Override
        public void addElement(GrantedAuthority element) {
                getEntity().addGrantedAuthority(element);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * removeElement(java.lang.Object)
-        */
        @Override
        public void removeElement(GrantedAuthority element) {
                getEntity().removeGrantedAuthority(element);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getEmptyString()
-        */
        @Override
        public String getEmptyString() {
                return "No Granted Authorities yet.";
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getTooltipString()
-        */
        @Override
        protected String getTooltipString() {
                return "Add a Granted Authority";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public GrantedAuthority addExisting() {
 
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index adbe10c1d13786c0d3a2c619c7f25ca21d86ae10..752a91a2c5a38645a0fdd6d6bccaf50ce8091154 100644 (file)
@@ -8,7 +8,6 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.grantedAuthority;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.GrantedAuthorityImpl;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -21,9 +20,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class GrantedAuthorityDetailWizardPage extends AbstractCdmEntityWizardPage<GrantedAuthorityImpl> {
 
-       public GrantedAuthorityDetailWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, GrantedAuthorityImpl entity) {
-               super(formFactory, conversation, entity);
+       public GrantedAuthorityDetailWizardPage(CdmFormFactory formFactory, GrantedAuthorityImpl entity) {
+               super(formFactory,  entity);
                setTitle("Granted Authority");
        }
 
index 0530f7ca999b3912a8ce9901f760f62e8d72a7a3..9a61da360a10e88030ac07e4aa2571dfae3afbb0 100644 (file)
@@ -52,4 +52,10 @@ public class GroupDetailElement extends AbstractCdmDetailElement<Group> {
                }
        }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 2cf9a1db8411191e2d3457e0d84bdced4ce1d1ae..c6a08f7e2f8093a190baa0627877136f227658f1 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.group;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -21,37 +20,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author n.hoffmann
  * @created Mar 9, 2011
- * @version 1.0
  */
 public class GroupDetailSection extends AbstractCdmDetailSection<Group> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
        public GroupDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "Group " + (getEntity() != null ? getEntity().getName() : "");
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<Group> createCdmDetailElement(AbstractCdmDetailSection<Group> parentElement, int style) {
            return formFactory.createGroupDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index a6f3d4a342e14b0fffbe6743a2b48ebfff277529..cdad799dab624b1afadb93f84b2769ccf9ad83a7 100644 (file)
@@ -9,7 +9,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.group;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -28,9 +27,8 @@ public class GroupDetailWizardPage  extends AbstractCdmEntityWizardPage<Group>{
         * @param conversation
         * @param entity
         */
-       public GroupDetailWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Group entity) {
-               super(formFactory, conversation, entity);
+       public GroupDetailWizardPage(CdmFormFactory formFactory, Group entity) {
+               super(formFactory, entity);
                setTitle("Group");
        }
 
index 5f13ea64542ef7fe51be6f734836435135b61069..164addf489df7586b234563503e656b42f71ef7c 100644 (file)
@@ -19,7 +19,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  */
 public class GroupSelectionElement extends EntitySelectionElement<Group> {
 
-       public GroupSelectionElement(CdmFormFactory formFactory,//ConversationHolder conversation,
+       public GroupSelectionElement(CdmFormFactory formFactory,
                ICdmFormElement parentElement,
                        String labelString, Group entity, int mode,
                        int style) {
index 52f91b0d2bf6f041de9319612d57cf2a42292c9c..c941a14c781198cf3c8584fe0f8c585f6f1476a2 100644 (file)
@@ -65,7 +65,7 @@ public class MemberDetailElement extends AbstractEntityCollectionElement<User> {
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_user = formFactory
-                               .createSelectionElement(User.class,//getConversationHolder(),
+                               .createSelectionElement(User.class,
                                        element, "", entity,
                                                EntitySelectionElement.EDITABLE, style);
                if (entity != null){
index 44008a7e06722962bc79df79acec15c58f32bf71..208d5827c261980764106532da9781a6ae5095a5 100644 (file)
@@ -6,13 +6,11 @@
 * 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.group;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.event.EventUtility;
@@ -26,26 +24,15 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author n.hoffmann
  * @created Mar 9, 2011
- * @version 1.0
  */
 public class MemberDetailSection extends AbstractEntityCollectionSection<Group, User> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public MemberDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Members", style);
+               super(formFactory, parentElement, "Members", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
        @Override
        public Collection<User> getCollection(Group entity) {
                return entity.getMembers();
@@ -56,68 +43,43 @@ public class MemberDetailSection extends AbstractEntityCollectionSection<Group,
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-        */
        @Override
        public User createNewElement() {
-               User selection = UserSelectionDialog.select(getLayoutComposite().getShell(), //getConversationHolder(),
+               User selection = UserSelectionDialog.select(getLayoutComposite().getShell(),
                        null, this.getEntity());
                return selection;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
        @Override
        public void addElement(User element) {
                getEntity().addMember(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
        @Override
        public void removeElement(User element) {
                getEntity().removeMember(element);
                EventUtility.postEvent(WorkbenchEventConstants.REMOVE_USER, element);
-
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
-        */
        @Override
        public String getEmptyString() {
                return "No members yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
-        */
        @Override
        protected String getTooltipString() {
                return "Add a member to this group";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public User addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-
-
-}
+}
\ No newline at end of file
index 12556d93825490ac8ef838d668d90580e22396db..c6163b68c535f1361b1e1f9eb95e0f0102d2ef6c 100644 (file)
@@ -39,15 +39,15 @@ public class PolytomousKeyDetailElement extends
 
            numberStartNumber = formFactory.createFloatTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
 
-           sectionTaxonomicScope = formFactory.createTaxonomicScopeSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(TaxonomicScopeSection.class, entity.getClass().getCanonicalName()));
+           sectionTaxonomicScope = formFactory.createTaxonomicScopeSection(formElement, StoreUtil.getSectionStyle(TaxonomicScopeSection.class, entity.getClass().getCanonicalName()));
            sectionTaxonomicScope.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionTaxonomicScope.setEntity(entity);
 
-           sectionGeoScopes = formFactory.createGeoScopePolyKeyDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(GeoScopePolyKeyDetailSection.class, entity.getClass().getCanonicalName()));
+           sectionGeoScopes = formFactory.createGeoScopePolyKeyDetailSection(formElement, StoreUtil.getSectionStyle(GeoScopePolyKeyDetailSection.class, entity.getClass().getCanonicalName()));
            sectionGeoScopes.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionGeoScopes.setEntity(entity);
 
-           sectionScopeRestriction = formFactory.createScopeRestrictionSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ScopeRestrictionSection.class, entity.getClass().getCanonicalName()));
+           sectionScopeRestriction = formFactory.createScopeRestrictionSection(formElement, StoreUtil.getSectionStyle(ScopeRestrictionSection.class, entity.getClass().getCanonicalName()));
            sectionScopeRestriction.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            sectionScopeRestriction.setEntity(entity);
        }
@@ -67,4 +67,10 @@ public class PolytomousKeyDetailElement extends
                }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 68a5db7d82cd6091816507fb0948683c2274c639..f0575547f76191b0ef2b0f882a3f55a81ac71117 100644 (file)
@@ -1,11 +1,15 @@
 /**
- *
- */
+* Copyright (C) 2009 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.key;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -14,30 +18,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
  * @author n.hoffmann
- *
  */
 public class PolytomousKeyDetailSection extends AbstractCdmDetailSection<PolytomousKey> {
 
        public PolytomousKeyDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "Polytomous Key";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<PolytomousKey> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKey> parentElement, int style) {
            return formFactory.createPolytomousKeyDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index a0ff6d61f38e0c7e781e2505882411824fcab968..daa95df0124b098025891d50fc18a97174c2c6d7 100644 (file)
@@ -55,7 +55,7 @@ public class PolytomousKeyNodeDetailElement extends
                                        formElement, "Question", parent.getQuestion(), 50, style);
 
                        selection_feature = formFactory
-                                       .createSelectionElement(Feature.class,//getConversationHolder(),
+                                       .createSelectionElement(Feature.class,
                                                formElement, "Character",
                                                        parent.getFeature(),
                                                        EntitySelectionElement.EDITABLE | EntitySelectionElement.DELETABLE, style);
@@ -66,20 +66,20 @@ public class PolytomousKeyNodeDetailElement extends
 
 
                selection_taxon = formFactory
-                               .createSelectionElement(Taxon.class,//getConversationHolder(),
+                               .createSelectionElement(Taxon.class,
                                        formElement, "Taxon",
                                                entity.getTaxon(), EntitySelectionElement.DELETABLE,
                                                style);
 
 
                selection_subkey = formFactory
-                               .createSelectionElement(PolytomousKey.class,//getConversationHolder(),
+                               .createSelectionElement(PolytomousKey.class,
                                        formElement, "Subkey",
                                                entity.getSubkey(),
                                                EntitySelectionElement.EDITABLE | EntitySelectionElement.DELETABLE, style);
 
                selection_otherNode = formFactory
-                               .createSelectionElement(PolytomousKeyNode.class,//getConversationHolder(),
+                               .createSelectionElement(PolytomousKeyNode.class,
                                        formElement, "Other Node",
                                                entity.getOtherNode(),
                                                EntitySelectionElement.DELETABLE, style);
@@ -112,4 +112,10 @@ public class PolytomousKeyNodeDetailElement extends
                        getEntity().setOtherNode(selection_otherNode.getEntity());
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 65c4d636c64fa269a0719d991b603160edb3ea03..1fa47a9ce375f3aa62ebe2bbc292fa29c897ff26 100644 (file)
@@ -1,11 +1,15 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.key;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -14,30 +18,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
  * @author n.hoffmann
- *
  */
 public class PolytomousKeyNodeDetailSection extends AbstractCdmDetailSection<PolytomousKeyNode> {
 
        public PolytomousKeyNodeDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "Polytomous Key Node";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<PolytomousKeyNode> createCdmDetailElement(AbstractCdmDetailSection<PolytomousKeyNode> parentElement, int style) {
            return formFactory.createPolytomousKeyNodeDetailElement(parentElement);
        }
-
-}
+}
\ No newline at end of file
index 5e35debd28532a90e5b31ab29ff2e3a9706da196..161851d32ec624a8922a259670e12f424431ff85 100644 (file)
@@ -1,14 +1,18 @@
 /**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
  *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
@@ -16,16 +20,14 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 
 /**
  * @author n.hoffmann
- *
  */
 public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSection<PolytomousKey, DefinedTerm> {
 
        public ScopeRestrictionSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Scope Restriction", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Scope Restriction", style);
        }
 
-
        @Override
        protected Collection<DefinedTerm> getEntityCollection(PolytomousKey entity) {
                return entity.getScopeRestrictions();
@@ -39,7 +41,6 @@ public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSect
        @Override
        public DefinedTerm createNewElement() {
                return null;
-
        }
 
        @Override
@@ -62,24 +63,15 @@ public class ScopeRestrictionSection extends AbstractUnboundEntityCollectionSect
                return "Add a scope restriction";
        }
 
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DefinedTerm addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index eba36707299a3ac28e277f6423968f6b5cc2b00d..0732cb88d4fdf9c4c1881db3b40bdf872fbdcc1c 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.ui.section.key;
 import java.util.Collection;
 import java.util.Comparator;
 
-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.dialog.selection.TaxonSelectionDialog;
@@ -29,26 +28,13 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 public class TaxonomicScopeSection extends
                AbstractEntityCollectionSection<PolytomousKey, Taxon> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public TaxonomicScopeSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Taxonomic Scope",
+               super(formFactory, parentElement, "Taxonomic Scope",
                                style);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getCollection(java.lang.Object)
-        */
        @Override
        public Collection<Taxon> getCollection(PolytomousKey entity) {
                return entity.getTaxonomicScope();
@@ -59,81 +45,41 @@ public class TaxonomicScopeSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * createNewElement()
-        */
        @Override
        public Taxon createNewElement() {
-               Taxon selection = TaxonSelectionDialog.selectTaxon(getShell(),//getConversationHolder(),
-                       null);
-
+               Taxon selection = TaxonSelectionDialog.selectTaxon(getShell(), null);
                return selection;
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
-        * (java.lang.Object)
-        */
        @Override
        public void addElement(Taxon element) {
                getEntity().addTaxonomicScope(element);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * removeElement(java.lang.Object)
-        */
        @Override
        public void removeElement(Taxon element) {
                getEntity().removeTaxonomicScope(element);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getEmptyString()
-        */
        @Override
        public String getEmptyString() {
                return "No taxonomic scope yet.";
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
-        * getTooltipString()
-        */
        @Override
        protected String getTooltipString() {
                return "Add a taxon to the scope of this key";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Taxon addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index b43dd994ad024f1795156476066323b7baaad15a..29c38d830299c09345490efba06928f914c5a776 100644 (file)
@@ -241,7 +241,7 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
                 removeElementsAndControls(textUri);
             }
             disposeImage();
-            section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(MediaRepresentationSection.class, getEntity().getClass().getCanonicalName()));
+            section_mediaRepresentation = formFactory.createMediaRepresentationSection(parentFormElement, StoreUtil.getSectionStyle(MediaRepresentationSection.class, getEntity().getClass().getCanonicalName()));
             section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_mediaRepresentation.setEntity(getEntity());
             //set buffered uri as text if uri had parsing problems in simple view
@@ -312,4 +312,10 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
         return uriBuffer;
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 248f31f4304367144f8d51dfe9d2137a5868f302..7a8098b65ee489214f29ae07775f1c0e810a9e0d 100644 (file)
@@ -62,7 +62,7 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         setWarnForReferencingObjects(element, 2);
         text_title = formFactory.createMultiLanguageTextElement(element, "Title", getEntity().getAllTitles(), 50, style);
 
-        selection_artist = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+        selection_artist = formFactory.createSelectionElement(AgentBase.class,
                 element, "Artist", null, EntitySelectionElement.ALL, style);
         addElement(selection_artist);
 
index a91a8d4c570b240d1795cfc8bbe8145e094cf23d..4727fb4d14b1fa53443bff1e2974dc4c41d6847a 100644 (file)
@@ -57,7 +57,7 @@ public class MediaRepresentationElement extends AbstractEntityCollectionElement<
        public void createControls(ICdmFormElement element, int style) {
                text_mimeType = formFactory.createTextWithLabelElement(element, "Mime Type", null, style);
                text_suffix = formFactory.createTextWithLabelElement(element, "Suffix", null, style);
-               section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(getConversationHolder(), element, StoreUtil.getSectionStyle(MediaRepresentationPartSection.class, MediaRepresentation.class.getCanonicalName()));
+               section_mediaRepresentationPart = formFactory.createMediaRepresentationPartSection(element, StoreUtil.getSectionStyle(MediaRepresentationPartSection.class, MediaRepresentation.class.getCanonicalName()));
                section_mediaRepresentationPart.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                if (entity != null){
                        setEntity(entity);
index 0905bf963d5135c54cb79295caa805de9b83acda..6bb00c6763d19b2b0c2643589910a94d4cf1249c 100644 (file)
@@ -1,4 +1,11 @@
-
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.media;
 
 import java.util.Collection;
@@ -6,7 +13,6 @@ import java.util.Comparator;
 
 import org.eclipse.jface.util.PropertyChangeEvent;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.ImageFile;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
@@ -17,24 +23,14 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>MediaRepresentationPartSection class.</p>
- *
  * @author n.hoffmann
  */
 public class MediaRepresentationPartSection extends
                AbstractEntityCollectionSection<MediaRepresentation, MediaRepresentationPart> {
 
-       /**
-        * <p>Constructor for MediaRepresentationPartSection.</p>
-        *
-        * @param cdmFormFactory 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 style a int.
-        */
-       public MediaRepresentationPartSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public MediaRepresentationPartSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Media Representation Part", style);
+               super(cdmFormFactory, parentElement, "Media Representation Part", style);
                formFactory.addPropertyChangeListener(this);
        }
 
@@ -42,6 +38,7 @@ public class MediaRepresentationPartSection extends
        public void addElement(MediaRepresentationPart element) {
                getEntity().addRepresentationPart(element);
        }
+
        @Override
        public MediaRepresentationPart createNewElement() {
                // FIXME we are supporting image only at the moment
@@ -95,4 +92,4 @@ public class MediaRepresentationPartSection extends
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 766e83c3ebcccb8851f26ded8374842b4484ee48..0d7b4c7e1af159e556b1036042277b7f81077354 100644 (file)
@@ -6,13 +6,11 @@
 * 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.media;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -21,40 +19,26 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>MediaRepresentationSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 24, 2010
- * @version 1.0
  */
 public class MediaRepresentationSection extends AbstractEntityCollectionSection<Media, MediaRepresentation> {
 
-       /**
-        * <p>Constructor for MediaRepresentationSection.</p>
-        *
-        * @param cdmFormFactory 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 style a int.
-        */
-       public MediaRepresentationSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public MediaRepresentationSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Media Representation", style);
+               super(cdmFormFactory, parentElement, "Media Representation", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(MediaRepresentation element) {
                getEntity().addRepresentation(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public MediaRepresentation createNewElement() {
                return MediaRepresentation.NewInstance();
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<MediaRepresentation> getCollection(
                        Media entity) {
@@ -66,39 +50,28 @@ public class MediaRepresentationSection extends AbstractEntityCollectionSection<
            return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No media representations yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create a new media representation";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(MediaRepresentation element) {
                getEntity().removeRepresentation(element);
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public MediaRepresentation addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-
-}
+}
\ No newline at end of file
index 182a6dd9df07d662c8a63e090c2a0652e347c6a3..949e5125b14066d714f0197a62086ba1e3b0a203 100644 (file)
@@ -1,12 +1,16 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.media;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.dialog.selection.MediaSelectionDialog;
@@ -16,22 +20,12 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>MediaSection class.</p>
- *
  * @author nho
  */
 public class MediaSection extends AbstractEntityCollectionSection<IdentifiableMediaEntity, Media>{
 
-       /**
-        * <p>Constructor for MediaSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public MediaSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Media", style);
+       public MediaSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Media", style);
        }
 
        @Override
@@ -78,4 +72,4 @@ public class MediaSection extends AbstractEntityCollectionSection<IdentifiableMe
     public boolean allowAddExisting() {
         return true;
     }
-}
+}
\ No newline at end of file
index abda6303b75943fd8e7b48941da4d7a6583f93d7..c3f94a94760dfe479e764ad7f6edd97ca346c5b8 100644 (file)
@@ -70,17 +70,10 @@ public abstract class AbstractTypeDesignationElement<T extends TypeDesignationBa
            removeSourcesControls();
            removeNotDesignatedControls();
            if (this.entity != null && this.entity.hasDesignationSource()){
-               if (singleSourceElement == null){
-                   
+               if (singleSourceElement == null){            
                    singleSourceElement = formFactory.createOriginalSourceElement(formElement, entity, "Status Reference");
-//             selection_reference = formFactory
-//                        .createSelectionElement(Reference.class, formElement, "Status Reference",
-//                                entity.getCitation(), EntitySelectionElement.ALL, style);
-//
-//                text_referenceDetail = formFactory.createTextWithLabelElement(
-//                    formElement, "Reference Detail", entity.getCitationMicroReference(), style);
-                
                }
+               singleSourceElement.setEntity(entity.getDesignationSource(true));
         }else{
             if (singleSourceElement != null){
                 removeReferenceControls();
@@ -90,12 +83,9 @@ public abstract class AbstractTypeDesignationElement<T extends TypeDesignationBa
                     this.entity.setCitationMicroReference(null);
                 }
             }
-        }
-           if (entity.hasDesignationSource()){
-            singleSourceElement.setEntity(entity.getDesignationSource(true));
-        }
+        }   
            checkbox_notDesignated = formFactory.createCheckbox(formElement, "Not Designated", entity.isNotDesignated(), style);
-           sourceSection = formFactory.createSourceSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SourceSection.class, IdentifiableSource.class.getCanonicalName()));
+           sourceSection = formFactory.createSourceSection(formElement, StoreUtil.getSectionStyle(SourceSection.class, IdentifiableSource.class.getCanonicalName()));
         sourceSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sourceSection.setEntity(entity);
         StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
index 426f8d6dbe152b03f667fd4d6b1141015d1a0322..4c33824a0fb8ed1b30bd1caa861b68e987c829d6 100644 (file)
@@ -42,6 +42,10 @@ public class AuthorshipDetailElement
     private EntitySelectionElement<TeamOrPersonBase> selectionExCombinationAuthor;
     @SuppressWarnings("rawtypes")
     private EntitySelectionElement<TeamOrPersonBase> selectionCombinationAuthor;
+    @SuppressWarnings("rawtypes")
+    private EntitySelectionElement<TeamOrPersonBase> selectionInCombinationAuthor;
+    @SuppressWarnings("rawtypes")
+    private EntitySelectionElement<TeamOrPersonBase> selectionInBasionymAuthor;
 
     private NumberWithLabelElement text_publicationYear;
     private NumberWithLabelElement text_originalPublicationYear;
@@ -68,31 +72,43 @@ public class AuthorshipDetailElement
 
            if (config == null || config.isAuthorshipSectionActivated()){
             selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-                               getConversationHolder(),
                                formElement, "Author",
                                entity.getCombinationAuthorship(),
                                EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
                addElement(selectionCombinationAuthor);
                selectionExCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-                               getConversationHolder(),
                                formElement, "Ex Author",
                                entity.getExCombinationAuthorship(),
                                EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
                addElement(selectionExCombinationAuthor);
+               if ((config == null || config.isInAuthorshipActivated())&& (getEntity().getNameType().isFungus() || getEntity().getNameType().isZoological())) {
+                   selectionInCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+                        formElement, "In Author",
+                        entity.getInCombinationAuthorship(),
+                        EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
+                addElement(selectionInCombinationAuthor);
+               }
                if (code != null){
                 if (code.equals(NomenclaturalCode.ICZN)){
                     text_publicationYear = formFactory.createFloatTextWithLabelElement(formElement, "Publication Year", ((IZoologicalName)entity).getPublicationYear(), style);
                 }
             }
-               selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+               selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
                     formElement, "Basionym Author", entity.getBasionymAuthorship(),
                     EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
                addElement(selectionBasionymAuthor);
-               selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+               selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
                        formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
                        EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
 
                addElement(selectionExBasionymAuthor);
+               if ((config == null || config.isInAuthorshipActivated()) && (getEntity().getNameType().isFungus() || getEntity().getNameType().isZoological())) {
+                   selectionInBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+                        formElement, "In Basionym Author",
+                        entity.getInBasionymAuthorship(),
+                        EntitySelectionElement.DELETABLE | EntitySelectionElement.SELECTABLE | EntitySelectionElement.EDITABLE, style);
+                addElement(selectionInBasionymAuthor);
+            }
                if (code != null && code.equals(NomenclaturalCode.ICZN)){
                    text_originalPublicationYear = formFactory.createFloatTextWithLabelElement(formElement, "Orig. Publication Year", ((IZoologicalName)entity).getOriginalPublicationYear(), style);
            }
@@ -152,6 +168,10 @@ public class AuthorshipDetailElement
             ((IZoologicalName)getEntity()).setOriginalPublicationYear(text_originalPublicationYear.getInteger());
         } else if (eventSource == text_publicationYear) {
             ((IZoologicalName)getEntity()).setPublicationYear(text_publicationYear.getInteger());
+        }else if (eventSource == selectionInCombinationAuthor) {
+            (getEntity()).setInCombinationAuthorship(selectionInCombinationAuthor.getEntity());
+        }else if (eventSource == selectionInBasionymAuthor) {
+            getEntity().setInBasionymAuthorship(selectionInBasionymAuthor.getEntity());
         }
 
 //             if (eventSource != toggleable_cache) {
@@ -175,4 +195,26 @@ public class AuthorshipDetailElement
                }
            }
        }
+
+       @Override
+       public void fillFields() {
+               /*
+               toggleable_cache.setText(getEntity().getAuthorshipCache());
+               toggleable_cache.setSelected(getEntity().isProtectedAuthorshipCache());
+               selectionExBasionymAuthor.setEntity(getEntity().getExBasionymAuthorship());
+           selectionBasionymAuthor.setEntity(getEntity().getBasionymAuthorship());
+           selectionExCombinationAuthor.setEntity(getEntity().getExCombinationAuthorship());
+           selectionCombinationAuthor.setEntity(getEntity().getCombinationAuthorship());
+           if (text_originalPublicationYear != null) {
+
+           }
+           if (text_publicationYear != null) {
+               text_publicationYear.setNumber(((IZoologicalName)getEntity()).getPublicationYear());
+               text_originalPublicationYear.setNumber(((IZoologicalName)getEntity()).getOriginalPublicationYear());
+           }
+
+           */
+
+
+       }
 }
\ No newline at end of file
index 939c520bb3b097215feecbd028b5635b97988d2b..9b07c1243b7e56600cf2c6cfa7b2e935a4d1a70b 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -29,9 +28,9 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<INonViralN
 
        private TaxonBase<?> taxonBase;
 
-       public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -40,6 +39,12 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<INonViralN
                INonViralName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               INonViralName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        public String getHeading() {
index a780e860d1aa58470f320bb5a0d5d45e95a2d238..b83f02d4193f2cf7d19fc7d11005e2c148756f09 100644 (file)
@@ -90,4 +90,13 @@ public class HybridDetailElement extends AbstractCdmDetailElement<INonViralName>
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               checkboxMonomHybrid.setSelection(getEntity().isMonomHybrid());
+               checkboxBinomHybrid.setSelection(getEntity().isBinomHybrid());
+               checkboxTrinomHybrid.setSelection(getEntity().isTrinomHybrid());
+               checkboxHybridFormula.setSelection(getEntity().isHybridFormula());
+               
+       }
 }
\ No newline at end of file
index 08858a1baf3559d513fb189f09a8cf53fd48638e..835c4825cde66b4427dfa905049c77c7191cdfca 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
@@ -31,9 +30,9 @@ public class HybridDetailSection
        private TaxonBase<?> taxonBase;
 
        public HybridDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -42,6 +41,12 @@ public class HybridDetailSection
                TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
                setEntity(name);
        }
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase taxon) {
+               taxonBase = taxon;
+               TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
index b855e5618798175b1aadda399f6bb922c1e9376d..47bc29357c4d9286afa7e684f241d8162cd016a7 100644 (file)
@@ -377,4 +377,45 @@ public class NameDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               if (combo_rank != null && (combo_rank.getSelection() == null || !combo_rank.getSelection().equals(getEntity().getRank()))  ) {
+                       combo_rank.setSelection(getEntity().getRank());
+               }
+               if(text_appendedPhrase != null && (text_appendedPhrase.getText() == null || !text_appendedPhrase.getText().equals(getEntity().getAppendedPhrase()))) {
+                       text_appendedPhrase.setText(getEntity().getAppendedPhrase());
+               }
+               if (text_uninomial != null && (text_uninomial.getText() == null || !text_uninomial.getText().equals(getEntity().getGenusOrUninomial()))) {
+                       text_uninomial.setText(getEntity().getGenusOrUninomial());
+               }
+               if (text_infragenericEpithet != null && (text_infragenericEpithet.getText() == null || !text_infragenericEpithet.getText().equals(getEntity().getInfraGenericEpithet()))) {
+                       text_infragenericEpithet.setText(getEntity().getInfraGenericEpithet());
+               }
+               if (text_specificEpithet != null && (text_specificEpithet.getText() == null || !text_specificEpithet.getText().equals(getEntity().getSpecificEpithet()))) {
+                       text_specificEpithet.setText(getEntity().getSpecificEpithet());
+               }
+               if (text_infraspecificEpithet != null && getEntity().getInfraSpecificEpithet() != null && !text_infraspecificEpithet.getText().equals(getEntity().getInfraSpecificEpithet())) {
+                       text_infraspecificEpithet.setText(getEntity().getInfraSpecificEpithet());
+               }
+               if (checkbox_anamorphic != null && (checkbox_anamorphic.getSelection() != ((IFungusName)getEntity()).isAnamorphic())) {
+                       checkbox_anamorphic.setSelection(((IFungusName)getEntity()).isAnamorphic());
+               }
+               if (text_cultivarName != null && ((ICultivarPlantName)getEntity()).getCultivarEpithet() != null && !text_cultivarName.getText().equals(((ICultivarPlantName)getEntity()).getCultivarEpithet())) {
+                       text_cultivarName.setText(((ICultivarPlantName)getEntity()).getCultivarEpithet());
+               }
+               if (text_cultivarGroup != null && ((ICultivarPlantName)getEntity()).getCultivarGroupEpithet() != null && !text_cultivarGroup.getText().equals(((ICultivarPlantName)getEntity()).getCultivarGroupEpithet())) {
+                       text_cultivarGroup.setText(((ICultivarPlantName)getEntity()).getCultivarGroupEpithet());
+               }
+               if (text_subGenusAuthorship != null && ((IBacterialName)getEntity()).getSubGenusAuthorship() != null && !text_subGenusAuthorship.getText().equals(((IBacterialName)getEntity()).getSubGenusAuthorship())) {
+                       text_subGenusAuthorship.setText(((IBacterialName)getEntity()).getSubGenusAuthorship());
+               }
+               if (text_breed!= null && ((IZoologicalName)getEntity()).getBreed() != null && !text_breed.getText().equals(((IZoologicalName)getEntity()).getBreed())) {
+                       text_breed.setText(((IZoologicalName)getEntity()).getBreed());
+               }
+               ((NameDetailSection)this.getParentElement()).setSectionTitle();
+               
+               
+       }
 }
\ No newline at end of file
index c3b352a5490bf825ce0d07958b52e3f5a7866082..66d436bd5f76c62652c6c98ced6a788808c282a5 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
@@ -21,35 +20,24 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>NameDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created 05.06.2009
  */
-public class NameDetailSection 
-               extends AbstractCdmDetailSection<INonViralName> 
+public class NameDetailSection
+               extends AbstractCdmDetailSection<INonViralName>
                implements ITaxonBaseDetailSection{
 
        private TaxonBase<?> taxonBase;
 
-       /**
-        * <p>Constructor for NameDetailSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        */
-       public NameDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public NameDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
     public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
-               INonViralName name = (INonViralName) HibernateProxyHelper.deproxy(entity.getName());
+               INonViralName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
 
@@ -80,8 +68,18 @@ public class NameDetailSection
            return formFactory.createNameDetailElement(parentElement, style);
 
        }
-       
+
        public void updateContent(){
                ((NameDetailElement)this.detailElement).updateContent();
        }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               this.taxonBase = taxon;
+               INonViralName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+               
+       }
+
+       
 }
index d93226f509a292b0a892c57e122cebb3e4cffa0f..0f7d6a2056c00f903f61a8c88bbaa719390dac0b 100644 (file)
@@ -71,8 +71,9 @@ public class NameRelationshipDetailElement extends AbstractSourcedEntityElement<
                LabelElement spacer = formFactory.createLabel(element, null);
                spacer.getLayoutComposite().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                addElement(spacer);
+               label = "Source";
                super.createControls(element, style);
-               setSourceLabel("Source");
+
                if (entity != null){
                        setEntity(entity);
                }
index 218a50de859f314e5a3bdfe96e21e55a1545e1a9..51ac303155789390cdaed7f1441c806ee8678dbc 100644 (file)
@@ -6,7 +6,6 @@
 * 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.name;
 
 import java.util.Collection;
@@ -15,7 +14,6 @@ import java.util.Comparator;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -28,8 +26,6 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>NameRelationshipDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 18, 2010
  */
@@ -37,26 +33,16 @@ public class NameRelationshipDetailSection extends AbstractEntityCollectionSecti
 
        private TaxonBase taxonBase;
 
-       /**
-        * <p>Constructor for NameRelationshipDetailSection.</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 style a int.
-        */
-       public NameRelationshipDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+       public NameRelationshipDetailSection(CdmFormFactory formFactory,
                        ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Name Relationships", style);
+               super(formFactory, parentElement, "Name Relationships", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(NameRelationship element) {
                //getEntity().addRelationship(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public NameRelationship createNewElement() {
 
@@ -72,7 +58,6 @@ public class NameRelationshipDetailSection extends AbstractEntityCollectionSecti
                return null;
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<NameRelationship> getCollection(TaxonName entity) {
                Collection<NameRelationship> allNameRelationships = entity.getRelationsFromThisName();
@@ -85,50 +70,46 @@ public class NameRelationshipDetailSection extends AbstractEntityCollectionSecti
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No name relationships yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a new name relationship from this name.";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(NameRelationship element) {
                getEntity().removeNameRelationship(element);
        }
 
-       /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
-
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntity(name);
+       }
+       
        @Override
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public NameRelationship addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 92e5786deb87c9a192e9965949c1d7ecdb184ebb..96326a630eb10687c3da7799f5a02935a58f4080 100644 (file)
@@ -11,11 +11,8 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.wizard.Wizard;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 
 /**
@@ -25,7 +22,7 @@ import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class NameRelationshipWizard extends Wizard implements IConversationEnabled{
+public class NameRelationshipWizard extends Wizard {
 
        private static NameRelationshipDetailSection callingSection;
 
@@ -76,20 +73,4 @@ public class NameRelationshipWizard extends Wizard implements IConversationEnabl
        public NameRelationship getNameRelationship() {
                return page.getNameRelationship();
        }
-
-       /**
-        * <p>getConversationHolder</p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       @Override
-    public ConversationHolder getConversationHolder() {
-               return callingSection.getConversationHolder();
-       }
-
-       /** {@inheritDoc} */
-       @Override
-    public void update(CdmDataChangeMap changeEvents) {}
-
-
 }
index 3bf90d6731e62f9cf9ec2b0d5d3b59eae0acb280..feff3ff6a980f1d4c4d207df08c0efe4f8007785 100644 (file)
@@ -55,7 +55,7 @@ public class NameTypeDesignationElement extends
                checkbox_conservedType = formFactory.createCheckbox(formElement,
                                "Conserved Type", false, style); //$NON-NLS-1$
                selection_typeName = formFactory
-                               .createSelectionElement(TaxonName.class,//getConversationHolder(),
+                               .createSelectionElement(TaxonName.class,
                                        formElement, "Name", null, //$NON-NLS-1$
                                                EntitySelectionElement.ALL, style);
                combo_typeStatus = formFactory.createDefinedTermComboElement(TermType.NameTypeDesignationStatus, formElement,
index a106d42443d7d3775619840ddeeca88161cb1361..e0dd9b5c70b71003366d212fecb8f768e33248c6 100644 (file)
@@ -6,13 +6,11 @@
 * 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.name;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -24,28 +22,19 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>NomenclaturalStatusSection class.</p>
- *
  * @author n.hoffmann
  */
-public class NomenclaturalStatusSection extends AbstractEntityCollectionSection<TaxonName, NomenclaturalStatus> implements ITaxonBaseDetailSection{
-
-       private TaxonBase taxonBase;
-
-       /**
-        * <p>Constructor for NomenclaturalStatusSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public NomenclaturalStatusSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+public class NomenclaturalStatusSection
+        extends AbstractEntityCollectionSection<TaxonName, NomenclaturalStatus>
+        implements ITaxonBaseDetailSection{
+
+       private TaxonBase<?> taxonBase;
+
+       public NomenclaturalStatusSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        int style) {
-               super(cdmFormFactory, conversation, parentElement, "Nomenclatural Status", style);
+               super(cdmFormFactory, parentElement, "Nomenclatural Status", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<NomenclaturalStatus> getCollection(TaxonName entity) {
                return entity.getStatus();
@@ -56,63 +45,57 @@ public class NomenclaturalStatusSection extends AbstractEntityCollectionSection<
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No nomenclatural status yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        public NomenclaturalStatus createNewElement() {
                return NomenclaturalStatus.NewInstance(null);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create a new nomenclatural status";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(NomenclaturalStatus element) {
                getEntity().addStatus(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(NomenclaturalStatus element) {
                getEntity().removeStatus(element);
        }
 
-       /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
                TaxonName nonViralName = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(nonViralName);
        }
+       
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName nonViralName = HibernateProxyHelper.deproxy(entity.getName());
+               this.setEntity(nonViralName);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public NomenclaturalStatus addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index e16d6e253a2fec5ab290fe1ac1a66e5fe2d2a1c6..6abaed300231a3eedfab0f565266c1045da54c0f 100644 (file)
@@ -75,19 +75,19 @@ public class NonViralNameDetailElement
                }
         }
 
-           section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(NameDetailSection.class, entity.getClass().getCanonicalName(), true));
+           section_name = formFactory.createNameDetailSection(formElement, null, StoreUtil.getSectionStyle(NameDetailSection.class, entity.getClass().getCanonicalName(), true));
            section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_name);
            addElement(section_name);
 //         if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
-           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(AuthorshipDetailSection.class, entity.getClass().getCanonicalName(), true));
+           section_author = formFactory.createAuthorshipDetailSection(formElement, null, StoreUtil.getSectionStyle(AuthorshipDetailSection.class, entity.getClass().getCanonicalName(), true));
            section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
            addControl(section_author);
            addElement(section_author);
 //         }
            //TODO RL
            if (config == null || config.isHybridActivated()){
-          section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(HybridDetailSection.class, entity.getClass().getCanonicalName()));
+          section_hybrid = formFactory.createHybridDetailSection(formElement, null, StoreUtil.getSectionStyle(HybridDetailSection.class, entity.getClass().getCanonicalName()));
           section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
           addControl(section_hybrid);
           addElement(section_hybrid);
@@ -252,4 +252,19 @@ public class NonViralNameDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               
+               section_name.getDetailElement().fillFields();;
+               section_author.getDetailElement().fillFields();
+               combo_nomenclaturalCode.setSelection(getEntity().getNameType());
+               section_hybrid.getDetailElement().fillFields();
+               textLsid.setText(getEntity().getLsid()!= null? getEntity().getLsid().toString():null);
+               if (text_nameApprobation != null) {
+                       text_nameApprobation.setText(getEntity().getNameApprobation());
+               }
+               
+       }
 }
\ No newline at end of file
index c9a79fa54f98d0f21f0619f92c62866511909ab2..28b2c3f60f5c8453c0a6fe4e6c7d1725a8ea1932 100644 (file)
@@ -6,7 +6,6 @@
 * 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.name;
 
 import org.eclipse.jface.action.Action;
@@ -16,7 +15,6 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -44,19 +42,9 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<TaxonNam
        private TaxonBase<?> taxonBase;
        boolean nameChoosable = false;
 
-       /**
-        * <p>Constructor for NonViralNameDetailSection.</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 nameChoosable if <code>true</code> adds a button to choose the displayed name
-        * @param style a int.
-        */
-       public NonViralNameDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+       public NonViralNameDetailSection(CdmFormFactory formFactory,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, boolean nameChoosable, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
                this.nameChoosable = nameChoosable;
        }
 
@@ -69,7 +57,7 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<TaxonNam
                    Action chooseNameAction = new Action("Choose Name", IAction.AS_PUSH_BUTTON){
                        @Override
                        public void run() {
-                           TaxonName taxonName = NameSelectionDialog.select(getShell(), //getConversationHolder(),
+                           TaxonName taxonName = NameSelectionDialog.select(getShell(),
                                    getEntity());
                            if(taxonName!=null){
                             TaxonName nonViralName = HibernateProxyHelper.deproxy(taxonName);
@@ -98,7 +86,7 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<TaxonNam
 
                                        if(confirm){
                                                TaxonName clonedName;
-                                               clonedName = (TaxonName) getEntity().clone();
+                                               clonedName = getEntity().clone();
                                                setEntity(clonedName);
                                                taxonBase.setName(clonedName);
                                                taxonBase.generateTitle();
@@ -147,4 +135,12 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<TaxonNam
                        AbstractCdmDetailSection<TaxonName> parentElement, int style) {
            return formFactory.createNonViralNameDetailElement(parentElement);
        }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               taxonBase = taxon;
+               TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+               
+       }
 }
index b577414fbd9bf7507ce01ac9f285a0fd049c47ec..01f70905340fa4b48ce0d53f25a21f60d78f42d9 100644 (file)
@@ -6,10 +6,8 @@
 * 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.name;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -17,8 +15,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>NonViralNameWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
  */
@@ -26,20 +22,11 @@ public class NonViralNameWizardPage extends AbstractCdmEntityWizardPage<TaxonNam
 
        private NonViralNameDetailElement nameElement;
 
-       /**
-        * <p>Constructor for NonViralNameWizardPage.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.name.NonViralName} object.
-        */
-       public NonViralNameWizardPage(CdmFormFactory formFactory, ConversationHolder conversation,
-                       TaxonName entity) {
-               super(formFactory, conversation, entity);
+       public NonViralNameWizardPage(CdmFormFactory formFactory, TaxonName entity) {
+               super(formFactory, entity);
                setTitle("Name");
        }
 
-       /** {@inheritDoc} */
        @Override
        public AbstractCdmDetailElement<TaxonName> createElement(ICdmFormElement rootElement) {
                nameElement = formFactory.createNonViralNameDetailElement(rootElement);
@@ -47,10 +34,9 @@ public class NonViralNameWizardPage extends AbstractCdmEntityWizardPage<TaxonNam
                return nameElement;
        }
 
-       /** {@inheritDoc} */
        @Override
        public void dispose() {
                nameElement.removeElements();
                super.dispose();
        }
-}
+}
\ No newline at end of file
index e7b0da3fcebd18c89aec7d26807e8234fb1fa82d..34756d3cf9a9fa1919c1592f4a5c56b7545a18fe 100644 (file)
@@ -23,7 +23,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.graphics.ImageData;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.compare.name.TypeDesignationComparator;
@@ -64,9 +63,9 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
 
        private TaxonBase<?> taxonBase;
 
-       public TypeDesignationSection(CdmFormFactory formFactory, ConversationHolder conversation,
+       public TypeDesignationSection(CdmFormFactory formFactory,
                        ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, Messages.TypeDesignationSection_TYPE_DESIGNATIONS, style);
+               super(formFactory, parentElement, Messages.TypeDesignationSection_TYPE_DESIGNATIONS, style);
        }
 
        @Override
@@ -191,7 +190,7 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
            }
                boolean removeTypeDesignationFromAllTypifiedNames = PreferencesUtil.getBooleanValue(IPreferenceKeys.ADD_TYPES_TO_ALL_NAMES);
                TaxonName entity = removeTypeDesignationFromAllTypifiedNames ? null : getEntity();
-               if(!element.isPersited() && entity!=null){
+               if(!element.isPersisted() && entity!=null){
             entity.removeTypeDesignation(element);
                }
                else if(detailsView!=null
@@ -219,6 +218,11 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
                setEntity(name);
        }
 
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.setTaxonBase(entity);
+       }
+
        private boolean isSpecimenType(){
                Rank rank = getEntity() == null ? null : getEntity().getRank();
                if(rank == null){
old mode 100755 (executable)
new mode 100644 (file)
index 27dbf35..6a9b605
@@ -40,7 +40,7 @@ public class DeleteTypeDesignationOperation extends AbstractPostOperation<TaxonN
     @Override
     public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
         monitor.worked(20);
-        if (typeDesignation != null && typeDesignation.isPersited()){
+        if (typeDesignation != null && typeDesignation.isPersisted()){
             if(element==null){
                 CdmStore.getService(INameService.class).deleteTypeDesignation(null, typeDesignation);
             }
index b82a805f0dc9cf5866f68bbec27c78d19b2b7891..fe76278e01da84f9db0b22868ff7a8da98685501 100644 (file)
@@ -9,7 +9,6 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -18,8 +17,6 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * <p>DeterminationEventDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Oct 13, 2010
  */
@@ -27,9 +24,9 @@ public abstract class AbstractDeterminationEventDetailSection
         extends AbstractEntityCollectionSection<SpecimenOrObservationBase, DeterminationEvent> {
 
        public AbstractDeterminationEventDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        String title, int style) {
-               super(formFactory, conversation, parentElement, title, style);
+               super(formFactory, parentElement, title, style);
        }
 
        @Override
index 9b2e9f2c2b35fb8c30233a850907551f9ff7550f..7976fa70a2b6e78668f2f954f5b324e14ad2ae8c 100644 (file)
@@ -77,7 +77,7 @@ public abstract class AbstractEventDetailElement<T extends EventBase> extends
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_agent = formFactory
-                               .createSelectionElement(AgentBase.class,//getConversationHolder(),
+                               .createSelectionElement(AgentBase.class,
                                                 element, "Actor", null,
                                                EntitySelectionElement.ALL, style);
                element_timePeriod = formFactory.createTimePeriodElement(element,
index 30e611c7ad6a592091c0941d7086ed6722942b82..5ffeaf3bd3e93935f1fe1951369a7847963199bc 100644 (file)
@@ -8,7 +8,7 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
index d3f695e4dfda778ef9e41571c2650456fcaa3339..282e90440785a7b0c22b23330fad141390b9e535 100644 (file)
@@ -60,7 +60,7 @@ public class CollectingAreaDetailElement extends
 
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
-               selection_namedArea = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
+               selection_namedArea = formFactory.createSelectionElement(NamedArea.class,
                                formElement, "Area",
                                null, EntitySelectionElement.NOTHING, style);
                if (entity != null){
index fb17ab5f5addf0feb3b3c3e5cb9d3e1fcd12d9c0..b67c414dcac1071cd15bfdb51468c3c648f740e3 100644 (file)
@@ -6,14 +6,12 @@
 * 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 java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
@@ -28,17 +26,9 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  */
 public class CollectingAreasDetailSection extends AbstractEntityCollectionSection<DerivedUnitFacade, NamedArea> {
 
-       /**
-        * <p>Constructor for CollectingAreasDetailSection.</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 style a int.
-        */
        public CollectingAreasDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Collecting Areas", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Collecting Areas", style);
        }
 
        @Override
@@ -53,7 +43,7 @@ public class CollectingAreasDetailSection extends AbstractEntityCollectionSectio
 
        @Override
        public NamedArea createNewElement() {
-               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), //getConversationHolder(),
+               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(),
                        null, FieldUnit.class.getCanonicalName());
 
                return selection;
index c2e5537079462681ed85664fe9995d9de75d5352..d9a7bb48e3b13f7beee1e022b0db6b82ff336766 100644 (file)
@@ -97,4 +97,10 @@ public class CollectionDetailElement extends
                    text_titleCache.setText(getEntity().getTitleCache());
         }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO actually this is only used for taxa/names
+               
+       }
 }
\ No newline at end of file
index d875d3529f2eb322228939501cd75679740575c8..b142820d62804f0f0589d37af60bd332bf158a91 100644 (file)
@@ -8,7 +8,6 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -16,23 +15,13 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>CollectionWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Oct 13, 2010
  */
 public class CollectionWizardPage extends AbstractCdmEntityWizardPage<Collection> {
 
-       /**
-        * <p>Constructor for CollectionWizardPage.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
-        */
-       public CollectionWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, Collection entity) {
-               super(formFactory, conversation, entity);
+       public CollectionWizardPage(CdmFormFactory formFactory, Collection entity) {
+               super(formFactory, entity);
                setPageComplete(true);
        }
 
index 95c59c9da7fb7ca3ebff7320d806172dcf2598e1..383376398173b8420274e92b532dc100f9c09504 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -36,9 +35,9 @@ public class CurrentDeterminationDetailSection extends
                AbstractDeterminationEventDetailSection {
 
        public CurrentDeterminationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Current Determination", style);
+               super(formFactory, parentElement, "Current Determination", style);
        }
 
        @Override
index 4803f7648d00eec0281629ada69a39cbd4b8357a..f868f083505fcc5e278762b251ed283522664649 100644 (file)
@@ -6,11 +6,10 @@
  * 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.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.MethodNotSupportedByDerivedUnitTypeException;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
@@ -29,13 +28,8 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * DerivedUnitBaseDetailElement class.
- * </p>
- *
  * @author n.hoffmann
  * @created Jun 24, 2010
- * @version 1.0
  */
 public class DerivedUnitBaseDetailElement extends
                AbstractSpecimenOrObservationDetailElement {
@@ -58,20 +52,6 @@ public class DerivedUnitBaseDetailElement extends
 
     private DerivedUnitMediaSection mediaDetailElement;
 
-
-
-       /**
-        * <p>
-        * Constructor for DerivedUnitBaseDetailElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
        public DerivedUnitBaseDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
@@ -103,7 +83,7 @@ public class DerivedUnitBaseDetailElement extends
                        // we ignore this
             MessagingUtils.info(e.getMessage());
                }
-        selection_storedUnder = formFactory.createSelectionElement(TaxonName.class, //getConversationHolder(),
+        selection_storedUnder = formFactory.createSelectionElement(TaxonName.class,
                 formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
 
                try {
@@ -116,7 +96,7 @@ public class DerivedUnitBaseDetailElement extends
 //             section_duplicates = (SpecimenCollectionDetailSection) formFactory
 //                             .createEntityDetailSection(
 //                                             EntityDetailType.SPECIMEN_COLLECTION,
-//                                             getConversationHolder(), formElement, Section.TWISTIE);
+//                                             formElement, Section.TWISTIE);
 //             section_duplicates
 //                             .setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 //             section_duplicates.setEntity(entity);
@@ -124,26 +104,19 @@ public class DerivedUnitBaseDetailElement extends
                textOriginalLabel = formFactory.createOriginalLabelDataElement(formElement);
                textOriginalLabel.setEntity(getEntity());
 
-
-
                super.createControls(formElement, entity, style);
 
-
-               section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
+               section_source = formFactory.createSourceCollectionDetailSection(formElement, StoreUtil.getSectionStyle(SourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
                section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_source.setEntity(entity);
 
                if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart || !showOnlyDerivedUnitData){
-            mediaDetailElement = formFactory.createDerivedUnitMediaSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(DerivedUnitMediaSection.class, entity.getClass().getCanonicalName()));
+            mediaDetailElement = formFactory.createDerivedUnitMediaSection(formElement, StoreUtil.getSectionStyle(DerivedUnitMediaSection.class, entity.getClass().getCanonicalName()));
             mediaDetailElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             mediaDetailElement.setEntity(getEntity());
                }
-
-
-
        }
 
-    /** {@inheritDoc} */
     @Override
     public void handleEvent(Object eventSource) {
        super.handleEvent(eventSource);
@@ -175,4 +148,10 @@ public class DerivedUnitBaseDetailElement extends
             }
         }
     }
-}
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
+}
\ No newline at end of file
index 682fb69cba35a3fbda87ec6a9a29153436a57bd9..5888f92c3e68a788c08c430a65c69c601d67488f 100644 (file)
@@ -6,56 +6,36 @@
 * 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 org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- * <p>DerivedUnitBaseDetailSection class.</p>
  *
  * @author n.hoffmann
  * @created Jun 24, 2010
- * @version 1.0
  */
 public class DerivedUnitBaseDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
 
-       /**
-        * <p>Constructor for DerivedUnitBaseDetailSection.</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 DerivedUnitBaseDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@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.createDerivedUnitBaseDetailElement(parentElement);
        }
-}
+}
\ No newline at end of file
index b215a2ec8d973c6e6104e89925aea80d261766a2..a79c7f75dff2ea1595e9bad4e642dfccc025f7d5 100644 (file)
@@ -6,11 +6,9 @@
 * 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.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -19,13 +17,11 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**
  * @author n.hoffmann
  * @created Dec 15, 2010
- * @version 1.0
  */
 public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       public DerivedUnitBaseWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, DerivedUnitFacade entity) {
-               super(formFactory, conversation, entity);
+       public DerivedUnitBaseWizardPage(CdmFormFactory formFactory, DerivedUnitFacade entity) {
+               super(formFactory, entity);
                setTitle("Derived Unit Details");
                setPageComplete(true);
        }
@@ -43,5 +39,4 @@ public class DerivedUnitBaseWizardPage extends AbstractCdmEntityWizardPage<Deriv
 
                return detailElement;
        }
-
-}
+}
\ No newline at end of file
index 0214816c6de6fb24d66f0d701dcb9315cf8973f7..aab1a1d2a74f54a1b959ce18b5974499256bd990 100644 (file)
@@ -8,7 +8,7 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.common.LanguageString;
@@ -87,7 +87,7 @@ public class DerivedUnitGeneralDetailElement extends
                            entity.getCountry(), EntitySelectionElement.DELETABLE, style);
 
                if(PreferencesUtil.isCollectingAreaInGeneralSection()){
-                   section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
+                   section_collectingAreas = formFactory.createCollectingAreasDetailSection(formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
                    section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                    section_collectingAreas.setEntity(entity);
                }
@@ -98,9 +98,10 @@ public class DerivedUnitGeneralDetailElement extends
                            entity.getExactLocation(), style);
                    element_elevation = formFactory.createGatheringEventUnitElement(
                            formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION,  style);
-
+                   element_elevation.setExpanded(true);
                    element_date = formFactory.createTimePeriodElement(formElement, "Date",
                            entity.getGatheringPeriod(), style);
+                   element_date.setExpanded(true);
                    selection_collector = formFactory
                            .createCollectorSelectionElement(
                                    formElement, "Collector",
@@ -118,7 +119,7 @@ public class DerivedUnitGeneralDetailElement extends
                            "Collecting number", entity.getFieldNumber(), style);
                }
                selection_collection = formFactory
-                               .createSelectionElement(Collection.class,//getConversationHolder(),
+                               .createSelectionElement(Collection.class,
                                        formElement, "Collection",
                                                entity.getCollection(),
                                                EntitySelectionElement.ALL, style);
@@ -128,23 +129,23 @@ public class DerivedUnitGeneralDetailElement extends
                text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
 
                uriPreferredStableUri = formFactory.createUriWithLabelElement(formElement, "Pref. Stable URI", entity.getPreferredStableUri(), style);
-               section_status = formFactory.createStatusCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
+               section_status = formFactory.createStatusCollectionDetailSection(formElement, StoreUtil.getSectionStyle(SourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
                section_status.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_status.setEntity(entity);
 
-               checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.innerDerivedUnit().isPublish(), style);
+               checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.baseUnit().isPublish(), style);
 
        }
 
        @Override
        public void handleEvent(Object eventSource) {
                if (eventSource == toggleableText_titleCache) {
-                       
+
                        getEntity().setTitleCache(toggleableText_titleCache.getText(),
                                        toggleableText_titleCache.getState());
                        if (toggleableText_titleCache.getState()) {
                                return;
-                       }                       
+                       }
                } else if (eventSource == selection_country) {
                        getEntity().setCountry(selection_country.getSelection());
                } else if (eventSource == languageText_locality) {
@@ -180,6 +181,8 @@ public class DerivedUnitGeneralDetailElement extends
                    getEntity().setPreferredStableUri(uriPreferredStableUri.parseText());
                } else if (eventSource == checkIsPublish) {
             getEntity().innerDerivedUnit().setPublish(checkIsPublish.getSelection());
+        }else if (eventSource == section_status) {
+               firePropertyChangeEvent(this);
         }
 
                toggleableText_titleCache.setText(getEntity().getTitleCache());
@@ -194,4 +197,10 @@ public class DerivedUnitGeneralDetailElement extends
         this.showSpecimenType = showSpecimenType;
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
+
 }
index d8b69b538146c3036dc8b426c9ffb1efd987deda..93092d56b0dc330ec4527f88b3f8aa8e75eb3cd8 100644 (file)
@@ -11,8 +11,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -28,31 +27,17 @@ public class DerivedUnitGeneralDetailSection extends AbstractCdmDetailSection<De
     //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
        private DerivedUnitGeneralDetailElement derivedUnitGeneralDetailElement;
 
-    /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param selectionProvider
-        * @param style
-        */
        public DerivedUnitGeneralDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
        @Override
        public String getHeading() {
                return "General";
        }
 
-       /* (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) {
            derivedUnitGeneralDetailElement = formFactory.createDerivedUnitGeneralDetailElement(parentElement);
@@ -62,5 +47,4 @@ public class DerivedUnitGeneralDetailSection extends AbstractCdmDetailSection<De
        public void setShowOnlyDerivedUnitData(boolean showOnlyDerivedUnitData){
            derivedUnitGeneralDetailElement.setShowOnlyDerivedUnitData(showOnlyDerivedUnitData);
        }
-
-}
+}
\ No newline at end of file
index 7f658046160f7d8a9fef3d1b9e046fe23901627e..b1f19f12493463ff3c1246723823424d5e7a4db1 100644 (file)
@@ -6,11 +6,12 @@
 * 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.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.OccurrenceStatus;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -19,19 +20,27 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**
  * @author n.hoffmann
  * @created Dec 17, 2010
- * @version 1.0
  */
 public class DerivedUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       public DerivedUnitGeneralWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, DerivedUnitFacade entity) {
-               super(formFactory, conversation, entity);
+       public DerivedUnitGeneralWizardPage(CdmFormFactory formFactory, DerivedUnitFacade entity) {
+               super(formFactory, entity);
                setTitle("General Specimen Data");
        }
 
        @Override
        protected void checkComplete() {
-               setPageComplete(true);
+               SpecimenOrObservationBase<?> baseUnit = this.entity.baseUnit();
+               boolean complete = true;
+               if (baseUnit instanceof DerivedUnit) {
+                       for (OccurrenceStatus status :((DerivedUnit)baseUnit).getStatus()) {
+                               if (status.getType() == null) {
+                                       complete = false;
+                                       break;
+                               }
+                       }
+               }
+               setPageComplete(complete);
        }
 
        @Override
@@ -43,5 +52,4 @@ public class DerivedUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<De
                checkComplete();
                return detailElement;
        }
-
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index e4cef05..ef99ced
@@ -11,8 +11,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -26,8 +25,8 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  */
 public class DerivedUnitMediaSection extends AbstractEntityCollectionSection<DerivedUnitFacade, Media> {
 
-    public DerivedUnitMediaSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(cdmFormFactory, conversation, parentElement, "Media", style);
+    public DerivedUnitMediaSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+        super(cdmFormFactory, parentElement, "Media", style);
     }
 
     @Override
@@ -74,5 +73,4 @@ public class DerivedUnitMediaSection extends AbstractEntityCollectionSection<Der
     public boolean allowAddExisting() {
         return true;
     }
-
-}
+}
\ No newline at end of file
index a42d807821f223c66ed0e9cd01d382516768f4c0..f76a2fe96c988d69aca16cd88b690bfcd9715185 100644 (file)
@@ -35,12 +35,12 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Specime
                SpecimenOrObservationBase entity, int style) {
 
         section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(
-                getConversationHolder(), formElement, StoreUtil.getSectionStyle(CurrentDeterminationDetailSection.class, entity.getClass().getCanonicalName(), true));
+                formElement, StoreUtil.getSectionStyle(CurrentDeterminationDetailSection.class, entity.getClass().getCanonicalName(), true));
         section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_currentDetermination.setEntity(entity);
 
         section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(
-                getConversationHolder(), formElement, StoreUtil.getSectionStyle(DeterminationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
+                formElement, StoreUtil.getSectionStyle(DeterminationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
         section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         section_determinationHistory.setEntity(entity);
        }
@@ -51,4 +51,10 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Specime
                        section_determinationHistory.refresh();
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 0db453316eae462ac520a99d7b3a2f863dae568b..ea5b9c0254ed382ee96084507e263024aac2774a 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -26,9 +25,9 @@ public class DeterminationDetailSection
             implements IDerivedUnitFacadeDetailSection {
 
        public DeterminationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
index e65b9c60e14d0413456472edbdf0df618b900d26..2f85aefa262dd98492ed4532f0f5fa49d711beb6 100644 (file)
@@ -64,11 +64,11 @@ public class DeterminationEventDetailElement
        @Override
        public void createControls(ICdmFormElement element, int style) {
            selectionTaxonNameBase = formFactory
-                   .createSelectionElement(TaxonName.class,//getConversationHolder(),
+                   .createSelectionElement(TaxonName.class,
                             element, "Taxon Name", null,
                            EntitySelectionElement.ALL, style);
                selection_taxonBase = formFactory
-                               .createSelectionElement(TaxonBase.class,//getConversationHolder(),
+                               .createSelectionElement(TaxonBase.class,
                                                 element, "Taxon", null,
                                                EntitySelectionElement.ALL, style);
 
index 0d0ca8ac74b675acf44b48b4920d02f6a4a123d3..ddcb8d0a07543bc81f18d47910539361058d2baa 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -26,9 +25,9 @@ public class DeterminationHistoryDetailSection extends
                AbstractDeterminationEventDetailSection {
 
        public DeterminationHistoryDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Determination History", style);
+               super(formFactory, parentElement, "Determination History", style);
        }
 
        @Override
index 18008ee70c9f8877effaf8b2fc0ddf7972ff510d..c714fe3a1950de3b5da14f359195f3dce2ae2ee0 100644 (file)
@@ -6,10 +6,9 @@
 * 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.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -17,11 +16,8 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 
 /**
- * <p>FieldUnitDetailElement class.</p>
- *
  * @author n.hoffmann
  * @created Jun 17, 2010
- * @version 1.0
  */
 public class FieldUnitFacadeDetailElement extends AbstractSpecimenOrObservationDetailElement {
 
@@ -43,18 +39,11 @@ public class FieldUnitFacadeDetailElement extends AbstractSpecimenOrObservationD
 //
 //     private TermComboElement<DefinedTerm> combo_sex;
 
-       /**
-        * <p>Constructor for FieldUnitDetailElement.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        */
        public FieldUnitFacadeDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
                        DerivedUnitFacade entity, int style) {
@@ -71,7 +60,6 @@ public class FieldUnitFacadeDetailElement extends AbstractSpecimenOrObservationD
                super.createControls(formElement, entity, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
                super.handleEvent(eventSource);
@@ -93,6 +81,10 @@ public class FieldUnitFacadeDetailElement extends AbstractSpecimenOrObservationD
                else if(eventSource == number_individualCount){
                        getEntity().setIndividualCount(number_individualCount.getText());
                }
+       }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
        }
-}
+}
\ No newline at end of file
index bbaa490b6dbfe8b386b74b75a5e5c58a6803a8c0..99b6d42048d30fd3e0d9801f9d5c6d690fe238f6 100644 (file)
@@ -6,50 +6,33 @@
 * 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 org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- * <p>FieldUnitDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Jun 17, 2010
  */
 public class FieldUnitFacadeDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
 
-       /**
-        * <p>Constructor for FieldUnitDetailSection.</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 FieldUnitFacadeDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+       public FieldUnitFacadeDetailSection(CdmFormFactory formFactory,
                        ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Field 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.createFieldUnitFacadeDetailElement(parentElement);
index 27cc2e73cf035eb1d520416c80dafe3cac26ec0f..42b195e2646246d68625ead4339c0eb6df936a6e 100644 (file)
@@ -8,15 +8,12 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.Set;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
@@ -74,10 +71,10 @@ public class FieldUnitFacadeGeneralDetailElement extends AbstractCdmDetailElemen
            combo_specorobstype.setSelection(entity.getType());
         }
 
-        selection_country = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
+        selection_country = formFactory.createSelectionElement(NamedArea.class,
                 formElement, "Country", entity.getCountry(), EntitySelectionElement.DELETABLE, style);
         if(PreferencesUtil.isCollectingAreaInGeneralSection()){
-            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
+            section_collectingAreas = formFactory.createCollectingAreasDetailSection(formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
             section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_collectingAreas.setEntity(entity);
         }
@@ -122,7 +119,7 @@ public class FieldUnitFacadeGeneralDetailElement extends AbstractCdmDetailElemen
             getEntity().setGatheringPeriod(element_date.getTimePeriod());
         } else if (eventSource == selection_collector) {
             getEntity().setCollector(selection_collector.getSelection());
-            
+
             if (getEntity().getCollector() instanceof Team){
                if (selection_primary_collector.getCollectorTeam() != null && selection_primary_collector.getEntity() != null ){
                        boolean collInNewTeam = false;
@@ -141,7 +138,7 @@ public class FieldUnitFacadeGeneralDetailElement extends AbstractCdmDetailElemen
                selection_primary_collector.setEntity(null);
             }
             selection_primary_collector.setEnabled((getEntity().getCollector() instanceof Team));
-            
+
         } else if (eventSource == selection_primary_collector) {
             getEntity().setPrimaryCollector((Person)selection_primary_collector.getSelection());
         } else if (eventSource == text_collectingNumber) {
@@ -155,18 +152,25 @@ public class FieldUnitFacadeGeneralDetailElement extends AbstractCdmDetailElemen
         toggleableText_titleCache.setText(getEntity().getTitleCache());
 
     }
+    @Override
     protected void updateControlStates(){
         if (getEntity() != null ){
             enabled = enabled && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), requiredCrud);
         }else{
             enabled = true;
         }
-        Set<Object> except = new HashSet<>(); 
+        Set<Object> except = new HashSet<>();
         if (!selection_primary_collector.isEnabled() && enabled){
                except.add(selection_primary_collector);
         }
         setEnabled(enabled, except);
-        
+
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
+
 }
\ No newline at end of file
index 1721c206e0010d6211c688f81c912252adbd235f..4833bfbc450ac5d06dfae6503ac0baa4f62a015b 100644 (file)
@@ -10,8 +10,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -20,38 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 05.11.2013
- *
  */
 public class FieldUnitFacadeGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public FieldUnitFacadeGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "General";
     }
 
-    /* (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.createFieldUnitFacadeGeneralDetailElement(parentElement);
     }
-
-}
+}
\ No newline at end of file
index 99af179fc1360bd36164698b713a75ed687996d1..3161dfcce4ecf64fd7b6786cd3fd66e8063d6b3c 100644 (file)
@@ -8,40 +8,24 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 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;
 
-/**
- *
- */
 public class FieldUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param entity
-     */
-    public FieldUnitGeneralWizardPage(CdmFormFactory formFactory,
-            ConversationHolder conversation, DerivedUnitFacade entity) {
-        super(formFactory, conversation, entity);
+    public FieldUnitGeneralWizardPage(CdmFormFactory formFactory, DerivedUnitFacade entity) {
+        super(formFactory,  entity);
         setTitle("General FieldUnit Data");
     }
 
-    /* (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) {
         FieldUnitFacadeGeneralDetailElement detailElement = formFactory.createFieldUnitFacadeGeneralDetailElement(rootElement);
@@ -49,5 +33,4 @@ public class FieldUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<Deri
         checkComplete();
         return detailElement;
     }
-
-}
+}
\ No newline at end of file
index f76adabb6819b189f75a5a00e63816a7790ac709..bc7f8f15e5ed40ba48946e70ca7bd41381ba9575 100644 (file)
@@ -9,8 +9,7 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,9 +22,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class FieldUnitWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       public FieldUnitWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, DerivedUnitFacade entity) {
-               super(formFactory, conversation, entity);
+       public FieldUnitWizardPage(CdmFormFactory formFactory, DerivedUnitFacade entity) {
+               super(formFactory, entity);
                setTitle("Field Unit Details");
                setPageComplete(true);
        }
index 747577168b671ca2b35c52ba4174951e117fdae2..5506e545cefd46ebe3a362c9ae32b020502e6cd7 100644 (file)
@@ -9,7 +9,7 @@
 
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -78,7 +78,7 @@ public class GatheringEventDetailElement extends
 
 
         if(!PreferencesUtil.isCollectingAreaInGeneralSection()){
-            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
+            section_collectingAreas = formFactory.createCollectingAreasDetailSection(formElement, StoreUtil.getSectionStyle(CollectingAreasDetailSection.class, entity.getClass().getCanonicalName()));
             section_collectingAreas.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_collectingAreas.setEntity(entity);
         }
@@ -95,4 +95,10 @@ public class GatheringEventDetailElement extends
                                        text_gatheringEventDescription.getText());
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
 }
index 33ea2e354cfed40c3d0385f7b858473967b42242..14aabe0d9378488c11f3f4b826116d6437d95a5b 100644 (file)
@@ -11,8 +11,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -23,7 +22,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  *
  * @author n.hoffmann
  * @created Jun 24, 2010
- * @version 1.0
  */
 public class GatheringEventDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
 
@@ -31,30 +29,21 @@ public class GatheringEventDetailSection extends AbstractCdmDetailSection<Derive
         * <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 GatheringEventDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, 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.createGatheringEventDetailElement(parentElement);
index aa4bee581dd18bf39e9020d4589e77c2c57a56d9..d74e7b14ca517c3e147b72114671d0a459ab44fc 100644 (file)
@@ -6,11 +6,9 @@
 * 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.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -19,13 +17,11 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**
  * @author n.hoffmann
  * @created Dec 15, 2010
- * @version 1.0
  */
 public class GatheringEventWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
 
-       public GatheringEventWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, DerivedUnitFacade entity) {
-               super(formFactory, conversation, entity);
+       public GatheringEventWizardPage(CdmFormFactory formFactory, DerivedUnitFacade entity) {
+               super(formFactory, entity);
                setTitle("Gathering Event Details");
                setPageComplete(true);
        }
index d9b637105ed8381c1e87125882c003f0dea52c48..55b2790592571a560dd86875fddd5e9a1bc0c62d 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
@@ -32,23 +31,11 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  */
 public class GeoScopeDetailSection extends AbstractEntityCollectionSection<Classification, NamedArea> {
 
-       /**
-        * <p>Constructor for CollectingAreasDetailSection.</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 style a int.
-        */
        public GeoScopeDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Geo Scopes", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Geo Scopes", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public Collection<NamedArea> getCollection(Classification entity) {
                return entity.getGeoScopes();
@@ -59,69 +46,42 @@ public class GeoScopeDetailSection extends AbstractEntityCollectionSection<Class
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public NamedArea createNewElement() {
-               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), //getConversationHolder(),
+               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(),
                        null, Classification.class.getCanonicalName());
 
                return selection;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(NamedArea element) {
                getEntity().addGeoScope(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(NamedArea element) {
                getEntity().removeGeoScope(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No geo scopes yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a geo scope";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public NamedArea addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index 1c832e7dcbb62ed3748e7529fab7df5b7ff21034..04bc81cd2857c96eeced1a73b8bc362a10b93ec2 100644 (file)
@@ -6,13 +6,11 @@
 * 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 java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.NamedAreaSelectionDialog;
@@ -22,19 +20,16 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- *
  * @author pplitzner
  * @date Sep 21, 2015
- *
  */
 public class GeoScopePolyKeyDetailSection extends AbstractEntityCollectionSection<PolytomousKey, NamedArea> {
 
     public GeoScopePolyKeyDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Geo Scopes", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory,  parentElement, "Geo Scopes", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<NamedArea> getCollection(PolytomousKey entity) {
                return entity.getGeographicalScope();
@@ -45,53 +40,41 @@ public class GeoScopePolyKeyDetailSection extends AbstractEntityCollectionSectio
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public NamedArea createNewElement() {
-               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(), //getConversationHolder(),
+               NamedArea selection = NamedAreaSelectionDialog.select(getLayoutComposite().getShell(),
                        null, PolytomousKey.class.getCanonicalName());
 
                return selection;
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(NamedArea element) {
                getEntity().addGeographicalScope(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(NamedArea element) {
                getEntity().removeGeographicalScope(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No geo scopes yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a geo scope";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public NamedArea addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index 271eb16..b06703f
@@ -1,41 +1,37 @@
+/**
+ * Copyright (C) 2022 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 org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Control;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.ExtensionType;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.OccurrenceStatus;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 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.SelectionArbitrator;
-import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
-import eu.etaxonomy.taxeditor.ui.section.reference.SingleSourceSection;
-import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractOriginalSourceElement;
-import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSingleSourceElement;
-import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSourcedEntityBaseElement;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSourcedEntityElement;
-import eu.etaxonomy.taxeditor.ui.section.supplemental.IdentifiableSourceElement;
 
 public class OccurrenceStatusElement extends AbstractSourcedEntityElement<OccurrenceStatus>{
 
-       private TermComboElement<DefinedTerm> combo_statusType; 
-       
-//     private IdentifiableSourceElement sourceElement;
+       private TermComboElement<DefinedTerm> combo_statusType;
+       private Color colorRedSWT = new Color(null, 255, 0, 0);
 
-       
-       public OccurrenceStatusElement(CdmFormFactory formFactory, AbstractFormSection section, OccurrenceStatus entity, SelectionListener removeListener, int style) {
+       public OccurrenceStatusElement(CdmFormFactory formFactory, AbstractFormSection<?> section, OccurrenceStatus entity, SelectionListener removeListener, int style) {
                super(formFactory, section, entity, removeListener, "Status", style);
-               
        }
 
        @Override
@@ -43,11 +39,15 @@ public class OccurrenceStatusElement extends AbstractSourcedEntityElement<Occurr
                super.setEntity(entity);
                if (combo_statusType != null){
                        DefinedTerm statusType = HibernateProxyHelper.deproxy(entity.getType());
-                       combo_statusType.setSelection(statusType);                      
+                       combo_statusType.setSelection(statusType);
+                       if (statusType == null) {
+                               Color colorRedSWT = new Color(null, 255, 0, 0);
+                               combo_statusType.setBackground(colorRedSWT);
+                       }else {
+                               combo_statusType.setBackground(NOT_SELECTED);
+                       }
                }
                this.setSourceLabel("Source");
-               
-               
        }
 
        @Override
@@ -57,26 +57,52 @@ public class OccurrenceStatusElement extends AbstractSourcedEntityElement<Occurr
                        setEntity(entity);
                }
                super.createControls(element, style);
+               if (entity == null ^ entity.getType() == null) {
+                       combo_statusType.setBackground(colorRedSWT);
+               }else {
+                       combo_statusType.setBackground(NOT_SELECTED);
+               }
                this.setSourceLabel("Source");
-               
        }
 
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == combo_statusType){
                        getEntity().setType(combo_statusType.getSelection());
+                       firePropertyChangeEvent(new CdmPropertyChangeEvent(this.getParentElement(), eventSource));
+                       if (getEntity().getType() == null) {
+                               combo_statusType.setBackground(colorRedSWT);
+                       }else {
+                               combo_statusType.setBackground(NOT_SELECTED);
+                       }
                }
                if (getParentElement() instanceof AbstractCdmDetailSection) {
             ((AbstractCdmDetailSection<?>) getParentElement()).updateTitle();
         }
-               
        }
 
        @Override
        public SelectionArbitrator getSelectionArbitrator() {
-               // TODO Auto-generated method stub
+               // actually this view is used in the specimen wizard, so there the selection arbitrator is not needed.
                return null;
        }
 
-       
-}
+       @Override
+       public void setBackground(Color color) {
+
+               for(ICdmFormElement element : getElements()){
+                       if (element != null) {
+                               if (element != combo_statusType ^ (element == combo_statusType && combo_statusType.getSelection() != null)){
+                                       element.setBackground(color);
+                               }else {
+                                       element.setBackground(colorRedSWT);
+                               }
+                       }
+               }
+               for(Control element : getControls()){
+                       if (!element.isDisposed()){
+                           element.setBackground(color);
+                       }
+               }
+       }
+}
\ No newline at end of file
index a023a0934b5e8045094d2c9aedaad6278691a9f3..2a33ea0432ecd777a0c53eb64272bb6a3e637c22 100644 (file)
@@ -10,8 +10,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -20,37 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 17.06.2014
- *
  */
 public class OriginalLabelDataSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public OriginalLabelDataSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "Original Label Data";
     }
 
-    /* (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.createOriginalLabelDataElement(parentElement);
     }
-
-}
+}
\ No newline at end of file
index 94ec129f806e469f93ebea509bdd928ff38bb6e6..319c3c2bb223611ecc6ecc802a56b5581aa659de 100644 (file)
@@ -6,14 +6,12 @@
 * 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 java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -22,32 +20,18 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>SourceCollectionDetailSection class.</p>
  *
  * @author n.hoffmann
  * @created Oct 15, 2010
- * @version 1.0
  */
 public class SourceCollectionDetailSection extends
                AbstractEntityCollectionSection<DerivedUnitFacade, IdentifiableSource> {
 
-       /**
-        * <p>Constructor for SourceCollectionDetailSection.</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 style a int.
-        */
        public SourceCollectionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Sources", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Sources", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public Collection<IdentifiableSource> getCollection(DerivedUnitFacade entity) {
                return entity.getSources();
@@ -58,65 +42,38 @@ public class SourceCollectionDetailSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public IdentifiableSource createNewElement() {
                return IdentifiableSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(IdentifiableSource element) {
                getEntity().addSource(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(IdentifiableSource element) {
                getEntity().removeSource(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No sources yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add source";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public IdentifiableSource addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index 0536a1896321766e093f47b90125d36b2e5f0285..b861b12c4530688696dc9a2e2ea46e00184934bc 100644 (file)
@@ -83,7 +83,7 @@ public class SpecimenCollectionDetailElement extends
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_derivedUnit = formFactory
-                               .createSelectionElement(DerivedUnit.class,//getConversationHolder(),
+                               .createSelectionElement(DerivedUnit.class,
                                        element, "Derived Unit", null,
                                                EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
                if (entity != null){
index 86eb66731e9ef11344c46f31e2df84cd9f98c9bc..e6f46424056076382b67898b6ac2c86740e18905 100644 (file)
@@ -6,14 +6,12 @@
 * 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 java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -22,32 +20,17 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>SpecimenCollectionDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Oct 14, 2010
- * @version 1.0
  */
 public class SpecimenCollectionDetailSection extends
                AbstractEntityCollectionSection<DerivedUnitFacade, DerivedUnit> {
 
-       /**
-        * <p>Constructor for SpecimenCollectionDetailSection.</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 style a int.
-        */
        public SpecimenCollectionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Duplicates", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Duplicates", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public Collection<DerivedUnit> getCollection(DerivedUnitFacade entity) {
                return entity.getDuplicates();
@@ -58,65 +41,38 @@ public class SpecimenCollectionDetailSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public DerivedUnit createNewElement() {
                return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(DerivedUnit element) {
                getEntity().addDuplicate(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(DerivedUnit element) {
                getEntity().removeDuplicate(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No duplicates yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add a duplicate";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DerivedUnit addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index b9b8c243d288bf12b48792b47f9ce411b9c6f379..28a89a0fffe788844d3bdae23c661ae61109289b 100644 (file)
@@ -6,18 +6,14 @@
 * 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 java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.OccurrenceStatus;
-import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,32 +21,17 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>SourceCollectionDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Oct 15, 2010
- * @version 1.0
  */
 public class StatusCollectionDetailSection extends
                AbstractEntityCollectionSection<DerivedUnitFacade, OccurrenceStatus> {
 
-       /**
-        * <p>Constructor for SourceCollectionDetailSection.</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 style a int.
-        */
        public StatusCollectionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Status", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Status", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public Collection<OccurrenceStatus> getCollection(DerivedUnitFacade entity) {
                if (entity.baseUnit() instanceof DerivedUnit){
@@ -64,67 +45,41 @@ public class StatusCollectionDetailSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public OccurrenceStatus createNewElement() {
                return OccurrenceStatus.NewInstance(null);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(OccurrenceStatus element) {
                 ((DerivedUnit)getEntity().baseUnit()).addStatus(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(OccurrenceStatus element) {
                ((DerivedUnit)getEntity().baseUnit()).removeStatus(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No status yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add status";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public OccurrenceStatus addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-    
+
     @Override
     protected void setSectionTitle() {
            DerivedUnitFacade entity = getEntity();
@@ -140,5 +95,4 @@ public class StatusCollectionDetailSection extends
                        this.setText(getTitleString());
                }
        }
-
-}
+}
\ No newline at end of file
index cd042e4161428832430e373204cf2368d283928d..0c7e6eb0d4241f2685fc005c7594ff2921e168cc 100644 (file)
@@ -6,7 +6,6 @@
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
-
 package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
 
 import java.util.Set;
@@ -14,10 +13,10 @@ import java.util.Set;
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
 import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -34,7 +33,6 @@ public class DerivedUnitTypeDesignationElement
 
     private TermComboElement<SpecimenTypeDesignationStatus> combo_typeStatus;
 
-//    private List<EntitySelectionElement<TaxonNameBase>> selectionTaxonNames;
     private ICdmFormElement parentFormElement;
     private int style;
 
@@ -57,31 +55,21 @@ public class DerivedUnitTypeDesignationElement
                else if(typifiedNames.size()>1){
                    formFactory.createLabel(getLayoutComposite(), "!!!!!!!!");
                }
-       
+
                SpecimenTypeDesignationStatus typeStatus = HibernateProxyHelper
                                .deproxy(entity.getTypeStatus());
                combo_typeStatus.setSelection(typeStatus);
                checkbox_notDesignated.setSelection(entity.isNotDesignated());
         }
-
-//        for (TaxonNameBase taxonNameBase : typifiedNames) {
-//            EntitySelectionElement<TaxonNameBase> selectionElement = formFactory.createSelectionElement(
-//                    TaxonNameBase.class, getConversationHolder(), parentFormElement, "Scientific Name", null,
-//                    EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
-//            selectionElement.setEntity(taxonNameBase);
-//        }
-
-
     }
 
-    /** {@inheritDoc} */
     @Override
     public void createControls(ICdmFormElement element, int style) {
         this.parentFormElement = element;
         this.style = style;
 
         selectionTaxonName = formFactory.createSelectionElement(
-                TaxonName.class, //getConversationHolder(),
+                TaxonName.class,
                 parentFormElement, "Scientific Name", null,
                 EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
 
@@ -94,7 +82,6 @@ public class DerivedUnitTypeDesignationElement
         }
     }
 
-    /** {@inheritDoc} */
     @Override
     public void handleEvent(Object eventSource) {
         if (eventSource == selectionTaxonName) {
@@ -104,12 +91,5 @@ public class DerivedUnitTypeDesignationElement
         } else if (eventSource == checkbox_notDesignated) {
             getEntity().setNotDesignated(checkbox_notDesignated.getSelection());
         }
-//        else if (eventSource == selection_reference) {
-//            getEntity().setCitation(selection_reference.getSelection());
-//        } else if (eventSource == text_referenceDetail) {
-//            getEntity().setCitationMicroReference(
-//                    text_referenceDetail.getText());
-//        }
     }
-
-}
+}
\ No newline at end of file
index c73774980dccb1aee3368deb964be7d667588ca8..faa6f45d47e3acb46cc986824df7d83b790b266a 100644 (file)
@@ -15,8 +15,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -27,15 +26,14 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date Oct 29, 2015
- *
  */
 public class DerivedUnitTypeDesignationSection extends AbstractEntityCollectionSection<DerivedUnitFacade, SpecimenTypeDesignation> {
 
     private Collection<SpecimenTypeDesignation> typeDesignations;
 
     public DerivedUnitTypeDesignationSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Type Designations", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Type Designations", style);
     }
 
     @Override
@@ -85,7 +83,6 @@ public class DerivedUnitTypeDesignationSection extends AbstractEntityCollectionS
         return "No type designation yet.";
     }
 
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a type designation";
index f2404e55e73969adf269010b08509caf4ff7005f..8b1f8a543f2101d1a427974d9a43347f12d88593 100644 (file)
@@ -27,8 +27,8 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
@@ -46,7 +46,6 @@ import eu.etaxonomy.taxeditor.view.CdmViewerChooser;
 /**
  * @author pplitzner
  * @date Dec 1, 2014
- *
  */
 public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> implements IDoubleClickListener{
 
@@ -54,10 +53,10 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
         super(formFactory, formElement);
     }
 
-    /** {@inheritDoc} */
     @Override
     protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
-        Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listIndividualsAssociationTaxa(entity.innerDerivedUnit(), null, null, null, null);
+       boolean includeUnpublished = true;
+        Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listIndividualsAssociationTaxa(entity.innerDerivedUnit(), includeUnpublished, null, null, null, null);
         Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null);
         Collection<DeterminationEvent> determinationEvents = CdmStore.getService(IOccurrenceService.class).listDeterminationEvents(entity.innerDerivedUnit(), null, null, null, null);
 
@@ -110,7 +109,7 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
             }
             openInItem.setData(cdmBase);
             openInItem.addSelectionListener(new SelectionListener() {
-               
+
                @Override
                public void widgetSelected(SelectionEvent e) {
                        new CdmViewerChooser(TaxonAssociationDetailElement.this.getLayoutComposite().getShell()).chooseViewer(e.widget.getData());
@@ -182,4 +181,10 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
             new CdmViewerChooser(event.getViewer().getControl().getShell()).chooseViewer(firstElement);
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
 }
index b9ad3f24062ab8504f39f9465e7efe5f37f85a43..16f05f6ed270b0c6462a37d32a210f053c4f093f 100644 (file)
@@ -6,13 +6,11 @@
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
-
 package eu.etaxonomy.taxeditor.ui.section.occurrence.association;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -20,31 +18,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
 
 /**
- *
  * @author pplitzner
  * @date Dec 1, 2014
- *
  */
 public class TaxonAssociationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
 
        public TaxonAssociationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Taxon Associations";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
            return formFactory.createTaxonAssociationDetailElement(parentElement);
index fe797a2acfcdda379adbce26049e1a0c63aaceb0..f92a5893fb674563c135b88d2cde8eb9bd9b6c81 100644 (file)
@@ -6,10 +6,8 @@
 * 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.derivedUnit;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -17,32 +15,18 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
- * <p>DeterminationEventDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Oct 13, 2010
- * @version 1.0
  */
 public abstract class PreservedSpecimenAbstractDeterminationEventDetailSection extends
                AbstractEntityCollectionSection<DerivedUnit, DeterminationEvent> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public PreservedSpecimenAbstractDeterminationEventDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        String title, int style) {
-               super(formFactory, conversation, parentElement, title, style);
+               super(formFactory, parentElement, title, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public DeterminationEvent createNewElement() {
                DeterminationEvent instance = DeterminationEvent.NewInstance();
@@ -50,31 +34,18 @@ public abstract class PreservedSpecimenAbstractDeterminationEventDetailSection e
                return instance;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(DeterminationEvent determination) {
                getEntity().addDetermination(determination);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(DeterminationEvent determination) {
                getEntity().removeDetermination(determination);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No determinations yet.";
        }
-
-}
+}
\ No newline at end of file
index d545968059850fc7195ac07b31f58546d4a07e6c..e44e0f7404ed8a0e30e26836cbafb11cd75715e2 100644 (file)
@@ -6,7 +6,6 @@
 * 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.derivedUnit;
 
 import java.util.Arrays;
@@ -15,13 +14,13 @@ import java.util.Comparator;
 import java.util.Set;
 
 import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.ToolBarManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -32,32 +31,23 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author n.hoffmann
  * @created May 11, 2011
- * @version 1.0
  */
 public class PreservedSpecimenCurrentDeterminationDetailSection extends
     PreservedSpecimenAbstractDeterminationEventDetailSection {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param style
-        */
        public PreservedSpecimenCurrentDeterminationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Current Determination", style);
+               super(formFactory, parentElement, "Current Determination", style);
        }
 
        @Override
        protected Control createToolbar() {
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
 
-               Action addAction = new Action("add", Action.AS_PUSH_BUTTON){
-                       /* (non-Javadoc)
-                        * @see org.eclipse.jface.action.Action#run()
-                        */
-                       @Override
+               Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
+
+                   @Override
                        public void run() {
                                DeterminationEvent element = createNewElement();
 
@@ -98,9 +88,6 @@ public class PreservedSpecimenCurrentDeterminationDetailSection extends
                internalUpdateSection(false);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
        @Override
        public Collection<DeterminationEvent> getCollection(DerivedUnit entity) {
                DeterminationEvent preferredDetermination = null;
@@ -118,9 +105,6 @@ public class PreservedSpecimenCurrentDeterminationDetailSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.occurrence.AbstractDeterminationEventDetailSection#createNewElement()
-        */
        @Override
        public DeterminationEvent createNewElement() {
                DeterminationEvent newElement = super.createNewElement();
@@ -128,30 +112,18 @@ public class PreservedSpecimenCurrentDeterminationDetailSection extends
                return newElement;
        }
 
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create new current determination event";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public DeterminationEvent addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index 10231bbadb5496833643f2b6a387574d975b8da5..41c43400fbdc8e7833b0a3e54e1b3a766d0db5a0 100644 (file)
@@ -73,12 +73,12 @@ public class PreservedSpecimenDetailElement extends
 
         PreservationMethod preservationMethod = entity.getPreservation();
         combo_preservationMethod = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation Method", preservationMethod==null?null:preservationMethod.getDefinedMaterialOrMethod(), style);
-        selection_storedUnder = formFactory.createSelectionElement(TaxonName.class, //getConversationHolder(),
+        selection_storedUnder = formFactory.createSelectionElement(TaxonName.class,
                 formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
 
         text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
 
-        section_source = formFactory.createPreservedSpecimenSourceCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(PreservedSpecimenSourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
+        section_source = formFactory.createPreservedSpecimenSourceCollectionDetailSection(formElement, StoreUtil.getSectionStyle(PreservedSpecimenSourceCollectionDetailSection.class, entity.getClass().getCanonicalName()));
                section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_source.setEntity(entity);
        }
@@ -104,4 +104,10 @@ public class PreservedSpecimenDetailElement extends
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index e0a6c0ea32ca71e85d89aa080acaec7ae6060efc..ff2806f878b4143e52b3cc529e52d33b069f6a34 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -31,29 +30,21 @@ public class PreservedSpecimenDetailSection extends AbstractCdmDetailSection<Der
         * <p>Constructor for DerivedUnitBaseDetailSection.</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 PreservedSpecimenDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
-       /** {@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<DerivedUnit> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnit> parentElement, int style) {
            return formFactory.createPreservedSpecimenDetailElement(parentElement);
index 198a66c2815f3d608016b88cbb331a5d6f75cd61..09255116101f14b96d4d02c68b2700d1907ba3cb 100644 (file)
@@ -67,4 +67,10 @@ public class PreservedSpecimenGeneralDetailElement extends AbstractCdmDetailElem
             toggleableText_titleCache.setText(getEntity().getTitleCache());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 23e111dd682000d397b2f37b528fe82b97c78093..5d1a3a532df6a133c68a0e6381c5bf146fe215ad 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.derivedUnit;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -20,37 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 17.12.2013
- *
  */
 public class PreservedSpecimenGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnit> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public PreservedSpecimenGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "General Specimen";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<DerivedUnit> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnit> parentElement, int style) {
         return formFactory.createPreservedSpecimenGeneralDetailElement(parentElement);
     }
-}
+}
\ No newline at end of file
index 0760fce110b448aa1df5a3080178f5862667b2a6..1bc164c61ce87be509cf8aa5db2cfdc2b15b8a1a 100644 (file)
@@ -6,48 +6,31 @@
 * 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.derivedUnit;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
-import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
 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.DefaultCdmBaseComparator;
 
 /**
- * <p>SourceCollectionDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Oct 15, 2010
- * @version 1.0
  */
 public class PreservedSpecimenSourceCollectionDetailSection extends
                AbstractEntityCollectionSection<DerivedUnit, IdentifiableSource> {
 
-       /**
-        * <p>Constructor for SourceCollectionDetailSection.</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 style a int.
-        */
        public PreservedSpecimenSourceCollectionDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Sources", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Sources", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
-       /** {@inheritDoc} */
        @Override
        public Collection<IdentifiableSource> getCollection(DerivedUnit entity) {
                return entity.getSources();
@@ -58,65 +41,38 @@ public class PreservedSpecimenSourceCollectionDetailSection extends
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public IdentifiableSource createNewElement() {
                return IdentifiableSource.NewInstance(OriginalSourceType.PrimaryTaxonomicSource);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void addElement(IdentifiableSource element) {
                getEntity().addSource(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(IdentifiableSource element) {
                getEntity().removeSource(element);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No sources yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-        */
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add source";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public IdentifiableSource addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index ec9030b62b9342b631c2e94f193f302e96695a2f..13d34977fa958cb412b887e62148211f98d60f9c 100644 (file)
@@ -6,10 +6,8 @@
 * 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.dna;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -18,45 +16,30 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 
 /**
- *
  * @author pplitzner
  * @date Oct 16, 2014
- *
  */
 public abstract class AbstractSampleDesignationDetailSection extends
                AbstractEntityCollectionSection<IdentifiableEntity<?>, Identifier> {
 
        public AbstractSampleDesignationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        String title, int style) {
-               super(formFactory, conversation, parentElement, title, style);
+               super(formFactory, parentElement, title, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
-        */
-       /** {@inheritDoc} */
        @Override
        public Identifier createNewElement() {
                return Identifier.NewInstance(getEntity(), null, DerivateLabelProvider.getSampleDesignationTerm());
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-        */
-       /** {@inheritDoc} */
        @Override
        public void removeElement(Identifier sampleDesignation) {
                getEntity().removeIdentifier(sampleDesignation);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-        */
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No sample designations yet.";
        }
-
-}
+}
\ No newline at end of file
index 0340ce6f90caf56dbe4d258726354f57cddbc702..5e4009395760948bb3c135003a6b163fe223e5a6 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -45,10 +44,10 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 public abstract class AbstractUnboundEntityCollectionSection<ENTITY, ELEMENT>
         extends AbstractEntityCollectionSection<ENTITY, ELEMENT> {
 
-    private boolean addUnboundElement = false;
+    protected boolean addUnboundElement = false;
 
-    public AbstractUnboundEntityCollectionSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, String title, int style) {
-        super(formFactory, conversation, parentElement, title, style);
+    public AbstractUnboundEntityCollectionSection(CdmFormFactory formFactory, ICdmFormElement parentElement, String title, int style) {
+        super(formFactory, parentElement, title, style);
     }
 
     /**
index 50c2abaec6f3246ec8449a3dd42b82880a6af338..cc30b95df7ec28d88afd6c4f09f0c94a62d90dc8 100644 (file)
@@ -41,7 +41,7 @@ public class AmplificationCloningDetailElement extends AbstractCdmDetailElement<
         Cloning cloning = entity.getCloning();
         textCloningStrain = formFactory.createTextWithLabelElement(formElement, "Cloning Strain", cloning==null?"":cloning.getStrain(), style);
         date = formFactory.createTimePeriodElement(formElement, "Cloning Date", cloning==null?null:cloning.getTimeperiod(), style);
-        selectionCloningStaff = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+        selectionCloningStaff = formFactory.createSelectionElement(AgentBase.class,
                 formElement, "Cloning Staff", cloning==null?null:cloning.getActor(), EntitySelectionElement.ALL, style);
         comboCloningMaterialOrMethod = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Cloning Mat. & Meth.", cloning==null?null:cloning.getDefinedMaterialOrMethod(), style);
     }
@@ -68,4 +68,10 @@ public class AmplificationCloningDetailElement extends AbstractCdmDetailElement<
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index ebb71848dcf013e98c28f638f4ab9a4060816a4e..46e7863d058a8a365ef84de1b11da40b024e38af 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.AmplificationResult;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,9 +24,9 @@ public class AmplificationCloningDetailSection
         extends AbstractCdmDetailSection<AmplificationResult> {
 
     public AmplificationCloningDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
index 80feae63903c750dd2249e7422b00b2d7a0696b2..1b756125e5bc5b2a84145c538269b9fa6657ccdc 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.AmplificationResult;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -23,27 +22,14 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date 26.02.2014
- *
  */
 public class AmplificationGelPhotoCollectionDetailSection extends AbstractEntityCollectionSection<AmplificationResult, Media> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param title
-     * @param style
-     */
-    public AmplificationGelPhotoCollectionDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public AmplificationGelPhotoCollectionDetailSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Gel Photo", style);
+        super(formFactory, parentElement, "Gel Photo", style);
     }
 
-
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-     */
     @Override
     public Collection<Media> getCollection(AmplificationResult entity) {
         if(entity.getGelPhoto()!=null){
@@ -57,9 +43,6 @@ public class AmplificationGelPhotoCollectionDetailSection extends AbstractEntity
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
     @Override
     public Media createNewElement() {
         if(getEntity().getGelPhoto()==null){
@@ -68,59 +51,35 @@ public class AmplificationGelPhotoCollectionDetailSection extends AbstractEntity
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
-     */
     @Override
     public void addElement(Media element) {
         if(getEntity().getGelPhoto()==null){
             getEntity().setGelPhoto(element);
         }
-
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
-     */
     @Override
     public void removeElement(Media element) {
         getEntity().setGelPhoto(null);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
-     */
     @Override
     public String getEmptyString() {
         return "No gel photo yet";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
-     */
     @Override
     protected String getTooltipString() {
         return "Add a gel photo";
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Media addExisting() {
         return null;
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-}
+}
\ No newline at end of file
index 6bb18a6e61222fa5206f170ea49705911ae16608..de54ed954904d893e9bf1e77dd4c2dc7121a8a3f 100644 (file)
@@ -18,42 +18,28 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**
  * @author pplitzner
  * @date 15.01.2014
- *
  */
 public class AmplificationGelPhotoDetailElement  extends AbstractCdmDetailElement<AmplificationResult> {
     private AmplificationGelPhotoCollectionDetailSection sectionGelPhoto;
 
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public AmplificationGelPhotoDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-     */
     @Override
     protected void createControls(ICdmFormElement formElement, AmplificationResult entity, int style) {
-        sectionGelPhoto = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, entity.getClass().getCanonicalName()));
+        sectionGelPhoto = formFactory.createAmplificationGelPhotoCollectionDetailSection(formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, entity.getClass().getCanonicalName()));
         sectionGelPhoto.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionGelPhoto.setEntity(entity);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-     * .lang.Object)
-     */
     @Override
     public void handleEvent(Object eventSource) {
     }
 
-}
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+}
\ No newline at end of file
index 624d8a1a012cc420e68f40eed47a5372fb46298f..e8364c3e27f792df4ad42a0032e0d2986791c0fa 100644 (file)
@@ -49,18 +49,18 @@ public class AmplificationGeneralDetailElement extends AbstractCdmDetailElement<
         textDesignation = formFactory.createTextWithLabelElement(formElement, "Designation", entity.getLabelCache(), style);
         textDesignation.setEnabled(false);
         textDesignation.setBackground(getPersistentBackground());
-        selectionInstitution = formFactory.createSelectionElement(Institution.class, //getConversationHolder(),
+        selectionInstitution = formFactory.createSelectionElement(Institution.class,
                 formElement, "Institution", entity.getInstitution(), EntitySelectionElement.ALL, style);
-        selectionAmplificationStaff = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+        selectionAmplificationStaff = formFactory.createSelectionElement(AgentBase.class,
                 formElement, "Amplification staff", entity.getActor(), EntitySelectionElement.ALL, style);
         dateAmplification = formFactory.createTimePeriodElement(formElement, "Date", entity.getTimeperiod(), style);
         comboMarker = formFactory.createDefinedTermComboElement(TermType.DnaMarker, formElement, "DNA Marker", entity.getDnaMarker(), style);
-        selectionPrimerFW = formFactory.createSelectionElement(Primer.class,// getConversationHolder(),
+        selectionPrimerFW = formFactory.createSelectionElement(Primer.class,
                 formElement, "Primer FW", entity.getForwardPrimer(), EntitySelectionElement.ALL, style);
-        selectionPrimerRW = formFactory.createSelectionElement(Primer.class, //getConversationHolder(),
+        selectionPrimerRW = formFactory.createSelectionElement(Primer.class,
                 formElement, "Primer RW", entity.getReversePrimer(), EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
     }
@@ -91,4 +91,10 @@ public class AmplificationGeneralDetailElement extends AbstractCdmDetailElement<
         getEntity().updateCache();
         textDesignation.setText(getEntity().getLabelCache());
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 240a8c30e7aae71f446cb3db8b63993a78f55e87..94cc7db622a751017c9a6540cfdf4584d06c0d75 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -20,37 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 19.12.2013
- *
  */
 public class AmplificationGeneralDetailSection extends AbstractCdmDetailSection<Amplification> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public AmplificationGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "General Amplification";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<Amplification> createCdmDetailElement(AbstractCdmDetailSection<Amplification> parentElement, int style) {
         return formFactory.createAmplificationGeneralDetailElement(parentElement);
     }
-}
+}
\ No newline at end of file
index 2dc44b58f373152d5b38e40f87c7cdf33184a5c5..60c0501863c59258634bfe1b422184e9f4921243 100644 (file)
@@ -45,9 +45,9 @@ public class AmplificationPrimerDetailElement extends AbstractCdmDetailElement<A
      */
     @Override
     protected void createControls(ICdmFormElement formElement, Amplification entity, int style) {
-        selectionPrimerForward = formFactory.createSelectionElement(Primer.class, //getConversationHolder(),
+        selectionPrimerForward = formFactory.createSelectionElement(Primer.class,
                 formElement, "Forward Primer", entity.getForwardPrimer(), EntitySelectionElement.ALL, style);
-        selectionPrimerReverse = formFactory.createSelectionElement(Primer.class, //getConversationHolder(),
+        selectionPrimerReverse = formFactory.createSelectionElement(Primer.class,
                 formElement, "Reverse Primer", entity.getReversePrimer(), EntitySelectionElement.ALL, style);
     }
 
@@ -67,4 +67,10 @@ public class AmplificationPrimerDetailElement extends AbstractCdmDetailElement<A
             getEntity().setReversePrimer(selectionPrimerReverse.getSelection());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index fdb25013c9808e988e8726aa67ee78db95fb06e5..768ff80411fd3f67578c0b9895963cf430de24e3 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -20,38 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 15.01.2014
- *
  */
 public class AmplificationPrimerDetailSection extends AbstractCdmDetailSection<Amplification> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public AmplificationPrimerDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "Primer";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<Amplification> createCdmDetailElement(AbstractCdmDetailSection<Amplification> parentElement, int style) {
         return formFactory.createAmplificationPrimerDetailElement(parentElement);
     }
-
-}
+}
\ No newline at end of file
index c5b7e6b648b02bac1e3c08f281cf18e2f54ddce6..eebb0cca3f3701c9f30ab20e561e205c917af214 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -27,9 +26,9 @@ import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 public class CurrentSampleDesignationDetailSection extends AbstractSampleDesignationDetailSection {
 
        public CurrentSampleDesignationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Current Sample Designation", style);
+               super(formFactory, parentElement, "Current Sample Designation", style);
        }
 
        @Override
index 8b1fa716113faf9c8bb11d57ab57f1d9969805ad..15f414bf92dd742c8ac016d5a96710a1e79b6f62 100644 (file)
@@ -84,4 +84,10 @@ public class DnaQualityDetailElement extends AbstractCdmDetailElement<DnaSample>
             dnaQuality.setQualityCheckDate(dateTime);
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 65c462afa73f90b0a308e53295c4d307885263ab..10ced86ef6ae5d85156efe358aff12de32dbc193 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,9 +23,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class DnaQualityDetailSection extends AbstractCdmDetailSection<DnaSample> {
 
     public DnaQualityDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
index 9d32c928e6f2e4be1b35c67a67fe3d298ab1f8d9..ba8fa81562efe657e65670bb5346362256b95e31 100644 (file)
@@ -36,7 +36,7 @@ public class DnaSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaS
     @Override
     protected void createControls(ICdmFormElement formElement, DnaSample entity, int style) {
         selection_collection = formFactory
-                .createSelectionElement(Collection.class,//getConversationHolder(),
+                .createSelectionElement(Collection.class,
                         formElement, "Collection",
                         entity.getCollection(),
                         EntitySelectionElement.ALL, style);
@@ -63,4 +63,10 @@ public class DnaSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaS
             getEntity().setCollection(selection_collection.getSelection());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index ac1315bbc84b6f65a743f36ccf7c2fee212ad756..1f735126bd107be4785e2f11fc36c8bcaa02c930 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,12 +24,11 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class DnaSampleGeneralDetailSection extends AbstractCdmDetailSection<DnaSample> {
 
     public DnaSampleGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
     @Override
     public String getHeading() {
         return "General";
@@ -40,4 +38,4 @@ public class DnaSampleGeneralDetailSection extends AbstractCdmDetailSection<DnaS
     protected AbstractCdmDetailElement<DnaSample> createCdmDetailElement(AbstractCdmDetailSection<DnaSample> parentElement, int style) {
         return formFactory.createDnaSampleGeneralDetailElement(parentElement);
     }
-}
+}
\ No newline at end of file
index f23219b81a99c8b55ac86c12a79c9d7f990ff374..e4b7bad2a55c108a7be840e235f116c6985acea1 100644 (file)
@@ -57,9 +57,9 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         if(entity.getDerivedFrom()!=null){
             materialOrMethodText = entity.getDerivedFrom().getDescription();
         }
-        selectionInstitution = formFactory.createSelectionElement(Institution.class, //getConversationHolder(),
+        selectionInstitution = formFactory.createSelectionElement(Institution.class,
                 formElement, "Institution", institution, EntitySelectionElement.ALL, style);
-        selectionStaff = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+        selectionStaff = formFactory.createSelectionElement(AgentBase.class,
                 formElement, "Staff", staff, EntitySelectionElement.ALL, style);
         datePreparationDate = formFactory.createTimePeriodElement(formElement, "Preparation date", preparationDate, style);
         numberPreservationTemperature = formFactory.createFloatTextWithLabelElement(formElement, "Preservation Temp. [C°]", temperature, style);
@@ -102,4 +102,10 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         }
         return preservationMethod;
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index cf46eb0ac008b4af71ad23f4af46d138d49a9b5a..61d53e26b6f46c0582d60afd10bd7701a3c25875 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,9 +23,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class DnaSamplePreparationPreservationSection extends AbstractCdmDetailSection<DnaSample> {
 
     public DnaSamplePreparationPreservationSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
index 557786ef3871dbfb88d9f508c79ab3dc9513fd7d..31f23f3a776fc7e9a43c1d2246507c7a28d4e883 100644 (file)
@@ -26,7 +26,6 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author pplitzner
  * @date 06.01.2014
- *
  */
 public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer> {
 
@@ -39,21 +38,10 @@ public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer>
     private TermComboElement<DefinedTerm> comboMarker;
     private EntitySelectionElement<Reference> selectionReference;
 
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public PrimerGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-     */
     @Override
     protected void createControls(ICdmFormElement formElement, Primer entity, int style) {
         textPrimerName = formFactory.createTextWithLabelElement(formElement, "Primer Name", entity.getLabel(), style);
@@ -66,23 +54,16 @@ public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer>
         comboMarker = formFactory.createDefinedTermComboElement(TermType.DnaMarker, formElement, "DNA Marker", entity.getDnaMarker(), style);
 
         selectionReference = formFactory
-                .createSelectionElement(Reference.class,//getConversationHolder(),
+                .createSelectionElement(Reference.class,
                         formElement, "Reference",
                         entity.getPublishedIn(),
                         EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-     * .lang.Object)
-     */
     @Override
     public void handleEvent(Object eventSource) {
         if(eventSource==textPrimerName){
@@ -103,4 +84,10 @@ public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer>
             getEntity().setPublishedIn(selectionReference.getSelection());
         }
     }
-}
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+}
\ No newline at end of file
index 2766774dd8fa8384366d46886ca7577ecc221a3b..2517f16f016c0fa62072071d2233f96bedd06319 100644 (file)
@@ -35,11 +35,11 @@ public class SampleDesignationDetailElement
        protected void createControls(ICdmFormElement formElement,
                DerivedUnit facade, int style) {
            DerivedUnit entity = getEntity();
-        sectionCurrentSampleDesignation = formFactory.createCurrentSampleDesignationDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CurrentSampleDesignationDetailSection.class, entity.getClass().getCanonicalName(), true));
+        sectionCurrentSampleDesignation = formFactory.createCurrentSampleDesignationDetailSection(formElement, StoreUtil.getSectionStyle(CurrentSampleDesignationDetailSection.class, entity.getClass().getCanonicalName(), true));
         sectionCurrentSampleDesignation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionCurrentSampleDesignation.setEntity(entity);
 
-        sectionSampleDesignationHistory = formFactory.createSampleDesignationHistoryDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SampleDesignationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
+        sectionSampleDesignationHistory = formFactory.createSampleDesignationHistoryDetailSection(formElement, StoreUtil.getSectionStyle(SampleDesignationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
         sectionSampleDesignationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         sectionSampleDesignationHistory.setEntity(entity);
        }
@@ -50,4 +50,10 @@ public class SampleDesignationDetailElement
                        sectionSampleDesignationHistory.refresh();
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 77dc9307fd79153e0dda95e0fd2ea4e9421477fc..04ba23ce04adf6830bbd4ca5bcc292ea4955ce9b 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -23,9 +22,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class SampleDesignationDetailSection extends AbstractCdmDetailSection<DerivedUnit> {
 
        public SampleDesignationDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
index 8c035a6dc4f7215027dc8c661bb2153e1bbd359b..96d45bf71c7e7c87f0da5d596d072477fb858f05 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.LinkedList;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -27,9 +26,8 @@ import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider;
 public class SampleDesignationHistoryDetailSection extends AbstractSampleDesignationDetailSection {
 
        public SampleDesignationHistoryDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
-                       int style) {
-               super(formFactory, conversation, parentElement, "Sample Designation History", style);
+                       ICdmFormElement parentElement,int style) {
+               super(formFactory, parentElement, "Sample Designation History", style);
        }
 
        @Override
index 98b82a4ec51a3e80b9bff8e993b937c16fcf3110..8fff9bf51181525c44abf9a4f548c80712688bea 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
@@ -25,27 +24,14 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date 03.03.2014
- *
  */
 public class SequenceContigFileCollectionDetailSection extends AbstractEntityCollectionSection<Sequence, Media> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param title
-     * @param style
-     */
-    public SequenceContigFileCollectionDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public SequenceContigFileCollectionDetailSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Contig File", style);
+        super(formFactory, parentElement, "Contig File", style);
     }
 
-
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-     */
     @Override
     public Collection<Media> getCollection(Sequence entity) {
         if(entity.getContigFile()!=null){
@@ -59,9 +45,6 @@ public class SequenceContigFileCollectionDetailSection extends AbstractEntityCol
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
     @Override
     public Media createNewElement() {
         if(getEntity().getContigFile()==null){
@@ -70,9 +53,6 @@ public class SequenceContigFileCollectionDetailSection extends AbstractEntityCol
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
-     */
     @Override
     public void addElement(Media element) {
         if(getEntity().getContigFile()==null){
@@ -88,47 +68,28 @@ public class SequenceContigFileCollectionDetailSection extends AbstractEntityCol
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
-     */
     @Override
     public void removeElement(Media element) {
         getEntity().setContigFile(null);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
-     */
     @Override
     public String getEmptyString() {
         return "No contig file yet";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
-     */
     @Override
     protected String getTooltipString() {
         return "Add a contig file";
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Media addExisting() {
         return null;
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index 4403aa6c748e4e2183cf8a5bd5b6cdb34e1d8207..1fb93a059d3fe3b4ed4debb152f3c4cbbe3b79df 100644 (file)
@@ -140,4 +140,10 @@ public class SequenceGeneralDetailElement extends AbstractCdmDetailElement<Seque
         }
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 90cbeeabcf33856d3aced51a0fb6cbe6acd82a62..d17fe7a031239ebd04229b063ecbdb7c1910114f 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -20,38 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 19.12.2013
- *
  */
 public class SequenceGeneralDetailSection extends AbstractCdmDetailSection<Sequence>{
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public SequenceGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "General";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<Sequence> createCdmDetailElement(AbstractCdmDetailSection<Sequence> parentElement, int style) {
         return formFactory.createSequenceGeneralDetailElement(parentElement);
     }
-
-}
+}
\ No newline at end of file
index ead142425a43133fdc5d23f16fe548c6ee16b8ea..9f00d6722484496c188707c429c239b669257b75 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
@@ -21,21 +20,17 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
  * This section visualizes {@link Reference}s belonging to a {@link Sequence} and alllows adding/removing them.
+ *
  * @author pplitzner
  * @date 07.01.2014
- *
  */
 public class SequenceReferenceCollectionDetailSection extends AbstractUnboundEntityCollectionSection<Sequence, Reference> {
 
     public SequenceReferenceCollectionDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "References", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "References", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
     protected Collection<Reference> getEntityCollection(Sequence entity) {
         return entity.getCitations();
@@ -46,66 +41,38 @@ public class SequenceReferenceCollectionDetailSection extends AbstractUnboundEnt
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
     @Override
     public Reference createNewElement() {
         return ReferenceFactory.newGeneric();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(Reference element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void removeElement(Reference element) {
         getEntity().removeCitation(element);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No references yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a reference";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Reference addExisting() {
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-
-
-}
+}
\ No newline at end of file
index 58e0416eac2b68b1deb8af4115c4213ee7ff77d3..1cac012a9fc5301e3dfff2822aca2aed0a1fa82f 100644 (file)
@@ -23,60 +23,41 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 /**
  * @author pplitzner
  * @date 06.01.2014
- *
  */
 public class SingleReadGeneralDetailElement extends AbstractCdmDetailElement<SingleRead> {
 
     private EntitySelectionElement<Primer> selectionPrimer;
     private EntitySelectionElement<Amplification> selectionAmplification;
 
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public SingleReadGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
-     */
     @Override
     protected void createControls(ICdmFormElement formElement, SingleRead entity, int style) {
-        selectionPrimer = formFactory.createSelectionElement(Primer.class, //getConversationHolder(),
+        selectionPrimer = formFactory.createSelectionElement(Primer.class,
                 formElement, "Primer", entity.getPrimer(), EntitySelectionElement.ALL, style);
         AmplificationResult amplificationResult = entity.getAmplificationResult();
         if(amplificationResult==null){
             amplificationResult = AmplificationResult.NewInstance();
             amplificationResult.addSingleRead(entity);
         }
-        selectionAmplification = formFactory.createSelectionElement(Amplification.class, //getConversationHolder(),
+        selectionAmplification = formFactory.createSelectionElement(Amplification.class,
                 formElement, "Amplification", amplificationResult.getAmplification(), EntitySelectionElement.ALL, style);
 
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(formElement, StoreUtil.getSectionStyle(AnnotationSection.class, entity.getClass().getCanonicalName()));
         annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         annotationSection.setEntity(entity);
 
-        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(getConversationHolder(), formElement, formFactory.getSelectionProvider(), StoreUtil.getSectionStyle(AmplificationCloningDetailSection.class, amplificationResult.getClass().getCanonicalName()));
+        AmplificationCloningDetailSection cloningSection = formFactory.createAmplificationCloningDetailSection(formElement, formFactory.getSelectionProvider(), StoreUtil.getSectionStyle(AmplificationCloningDetailSection.class, amplificationResult.getClass().getCanonicalName()));
         cloningSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         cloningSection.setEntity(amplificationResult);
 
-        AmplificationGelPhotoCollectionDetailSection gelPhotoSection = formFactory.createAmplificationGelPhotoCollectionDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, amplificationResult.getClass().getCanonicalName()));
+        AmplificationGelPhotoCollectionDetailSection gelPhotoSection = formFactory.createAmplificationGelPhotoCollectionDetailSection(formElement, StoreUtil.getSectionStyle(AmplificationGelPhotoCollectionDetailSection.class, amplificationResult.getClass().getCanonicalName()));
         gelPhotoSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         gelPhotoSection.setEntity(amplificationResult);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-     * .lang.Object)
-     */
     @Override
     public void handleEvent(Object eventSource) {
         if(eventSource==selectionPrimer){
@@ -93,4 +74,10 @@ public class SingleReadGeneralDetailElement extends AbstractCdmDetailElement<Sin
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 60a90987174d3d7e4aa7527ae80252c14e6638e1..c7d1a0678ac24a2917cde73746a658b572796d0b 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -20,38 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**
  * @author pplitzner
  * @date 06.01.2014
- *
  */
 public class SingleReadGeneralDetailSection extends AbstractCdmDetailSection<SingleRead>{
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param selectionProvider
-     * @param style
-     */
     public SingleReadGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-     */
     @Override
     public String getHeading() {
         return "General";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-     */
     @Override
     protected AbstractCdmDetailElement<SingleRead> createCdmDetailElement(AbstractCdmDetailSection<SingleRead> parentElement, int style) {
         return formFactory.createSingleReadGeneralDetailElement(parentElement);
     }
-
-}
+}
\ No newline at end of file
index fcb253ffccebec155d8658b7eab198be99f44233..cc1f2aa272a5a667ebafa82bc15c4520358cfb48 100644 (file)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
@@ -25,27 +24,14 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 /**
  * @author pplitzner
  * @date 03.03.2014
- *
  */
 public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCollectionSection<SingleRead, Media> {
 
-    /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param title
-     * @param style
-     */
-    public SingleReadPherogramCollectionDetailSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public SingleReadPherogramCollectionDetailSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Read Chromatogram", style);
+        super(formFactory, parentElement, "Read Chromatogram", style);
     }
 
-
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-     */
     @Override
     public Collection<Media> getCollection(SingleRead entity) {
         if(entity.getPherogram()!=null){
@@ -59,9 +45,6 @@ public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCo
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
     @Override
     public Media createNewElement() {
         if(getEntity().getPherogram()==null){
@@ -70,9 +53,6 @@ public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCo
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
-     */
     @Override
     public void addElement(Media element) {
         if(getEntity().getPherogram()==null){
@@ -88,47 +68,28 @@ public class SingleReadPherogramCollectionDetailSection extends AbstractEntityCo
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
-     */
     @Override
     public void removeElement(Media element) {
         getEntity().setPherogram(null);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
-     */
     @Override
     public String getEmptyString() {
         return "No read chromatogram yet";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
-     */
     @Override
     protected String getTooltipString() {
         return "Add a read chromatogram";
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Media addExisting() {
         return null;
     }
 
-
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         return false;
     }
-}
+}
\ No newline at end of file
index b1dd94ed7baa45774606d4af4dcb0b1884d79f18..7f3e2a269df9aa975276e1941e724d58ea13505d 100644 (file)
@@ -8,10 +8,11 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.common.TimePeriod;
@@ -85,7 +86,6 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
         textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
         textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
         checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.isPublish(), style);
-
     }
 
     @Override
@@ -136,4 +136,20 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
         }
         return preservationMethod;
     }
+
+    @Override
+    public void fillFields() {
+
+       //TODO: implement
+//     comboKindOfTissue;
+//        selectionInstitution;
+//        selectionStaff;
+//        datePreparation;
+//        comboPreservationMedium;
+//        selectionCollection;
+//        textAccessionNumber;
+//        textBarcode;
+//        checkIsPublish;
+
+    }
 }
\ No newline at end of file
index 536fe2a753e0bb0003d87afede0f5f2fe0e90921..0dfd287dc0c0b5b26a461a8d9cb0929ad3ea1153 100644 (file)
@@ -10,8 +10,7 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
@@ -24,9 +23,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class TissueSampleGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> {
 
     public TissueSampleGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
index 025945c814c63eff1cf1261b4ee1024a5faa9749..79aa3a354fafdb5666e2a8f35c289aef3d7b1d1e 100644 (file)
@@ -8,7 +8,7 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
@@ -80,13 +80,14 @@ public class MediaSpecimenGeneralDetailElement
             comboKindOfUnit = formFactory.createDefinedTermComboElement(mediaSpecimenVocabulary, formElement, "Kind of Media", entity.getKindOfUnit(), style);
             textTitleLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Subject", media.getTitle(CdmStore.getDefaultLanguage()), style);
             if (getEntity() != null && media.getAllDescriptions() != null && !media.getAllDescriptions().isEmpty() ) {
-               boolean textExist = false;
+               boolean textExists = false;
                for (LanguageString lngStr: media.getAllDescriptions().values()) {
                        if (StringUtils.isNotBlank(lngStr.getText())) {
-                               textExist = true;
+                               textExists = true;
+                               break;
                        }
                }
-               if (textExist) {
+               if (textExists) {
                        text_description = formFactory.createMultiLanguageTextElement(formElement, "Description", media.getAllDescriptions(), 50, SWT.WRAP);
                }
             }
@@ -95,7 +96,7 @@ public class MediaSpecimenGeneralDetailElement
 
             LabelElement label1 = formFactory.createLabel(formElement, "");
 
-            selectionArtist = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
+            selectionArtist = formFactory.createSelectionElement(AgentBase.class,
                     formElement, "Prepared by", media.getArtist(), EntitySelectionElement.ALL, style);
             TimePeriod mediaCreated = entity.getMediaSpecimen().getMediaCreated();
 
@@ -215,4 +216,10 @@ public class MediaSpecimenGeneralDetailElement
         return mediaDetailElement.isAdvancedMediaView();
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
+
 }
index c9038d29ddeb8de9e74cc152a53163b439ca8500..0a1ea2aa9cc545d14e66d155b398d10d5f1af2bd 100644 (file)
@@ -13,7 +13,6 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -31,9 +30,9 @@ public class MediaSpecimenGeneralDetailSection extends AbstractCdmDetailSection<
     private ITogglableMediaElement togglableMediaElement;
 
     public MediaSpecimenGeneralDetailSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement,
+            ICdmFormElement parentElement,
             ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
old mode 100755 (executable)
new mode 100644 (file)
index 0fbf232..014bf9e
@@ -82,4 +82,15 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
              ((NamedSourceBase)getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
          }
     }
+
+       @Override
+       public void fillFields() {
+               if (this.getEntity() != null) {
+                       text_idInSource.setText(this.getEntity().getIdInSource());
+                   text_idNamespace.setText(this.getEntity().getIdNamespace());;
+                   text_originalInfo.setText(this.getEntity().getOriginalInfo());                  
+                   select_nameUsedInSource.setEntity(((NamedSourceBase)getEntity()).getNameUsedInSource());;
+               }
+               
+       }
 }
\ No newline at end of file
index 7ce690091ee98e5286e511b94467936453dfb8c2..e122a269639090abd1d06f748b9046c251282d00 100644 (file)
@@ -65,7 +65,15 @@ public class NomenclaturalSourceDetailElement extends
 
        @Override
        public void handleEvent(Object eventSource) {
+               if (eventSource.equals(sourceElement)) {
+                       getEntity().setNomenclaturalSource((NomenclaturalSource) sourceElement.getEntity());
+               }
+       }
 
+       @Override
+       public void fillFields() {
+               sourceElement.setEntity(getEntity().getNomenclaturalSource());
+               
        }
 
 
index 3563aa67c3e45dad0af87c6f78ad40ccf132b750..add2f8bb62f97eb5c3f7b5b983073f8a2e1ed5e6 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.reference;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NomenclaturalSource;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -37,14 +36,13 @@ public class NomenclaturalSourceDetailSection extends
         * <p>Constructor for NomenclaturalReferenceDetailSection.</p>
         *
         * @param cdmFormFactory 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 NomenclaturalSourceDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
+       public NomenclaturalSourceDetailSection(CdmFormFactory cdmFormFactory,
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -58,6 +56,12 @@ public class NomenclaturalSourceDetailSection extends
                TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        protected void setSectionTitle() {
old mode 100755 (executable)
new mode 100644 (file)
index 542a3ca..7ef7a40
@@ -47,7 +47,7 @@ public class NomenclaturalSourceElement extends OriginalSourceElement<Nomenclatu
         entity = HibernateProxyHelper.deproxy(entity);
 
         selection_NomRef = formFactory.createSelectionElementWithAbbreviatedTitle(Reference.class,
-                getConversationHolder(), formElement, "Reference",
+                formElement, "Reference",
                 null,
                 EntitySelectionElement.ALL, style);
 
@@ -66,17 +66,19 @@ public class NomenclaturalSourceElement extends OriginalSourceElement<Nomenclatu
 
         select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Original Spelling", entity != null? entity.getNameUsedInSource(): null, EntitySelectionElement.ALL, style);
 
-        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Protologue/Original Publication", false, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+        externalLinks = formFactory.createExternalLinksSection(formElement, "Protologue/Original Publication", false, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setEmptySectionString("No protologue yet.");
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(entity);
         externalLinks.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
+        
 
 
         addControl(externalLinks);
         addElement(externalLinks);
+        externalLinks.setExpanded(true);
 
-//        advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
+//        advancedSection = formFactory.createOriginalSourceAdvancedSection(formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
 //        TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
 //
 //        advancedSection.setLayoutData(layoutData);
index 529c903ea154d6a3630901faa5d09ec25a6439c2..aec51cc444fc813b5b4b1c7e3bfac91bae194327 100755 (executable)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.reference;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -25,9 +24,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  */
 public class OriginalSourceAdvancedSection extends AbstractCdmDetailSection<OriginalSourceBase> {
 
-    public OriginalSourceAdvancedSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public OriginalSourceAdvancedSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
     }
 
     @Override
@@ -58,8 +57,6 @@ public class OriginalSourceAdvancedSection extends AbstractCdmDetailSection<Orig
 //        setLayout(layout);
     }
 
-
-
 //    protected ExternalLinksSection getExternalLinksElement(){
 //        return ((AdvancedSourceElement)this.getDetailElement()).getExternalLinks();
 //    }
index d1e4f055990e639bc9f799188d18f6e67d6a7816..b985f62a9763d876a850094c8c3de89427e83cd8 100755 (executable)
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
 import eu.etaxonomy.cdm.model.reference.NamedSourceBase;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.reference.ReferenceType;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -40,6 +41,7 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
         extends AbstractCdmDetailElement<T>
         implements IPropertyChangeListener{
 
+       protected ICdmFormElement composite;
     protected EntitySelectionElement<Reference> selection_Ref;
     protected TextWithLabelElement microReference;
     protected TimePeriodElement accessed;
@@ -47,6 +49,7 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
     protected String label = "Source";
     protected CdmBase cdmEntity;
     protected ExternalLinksSection externalLinks;
+    protected ReferenceType refType;
 
     public OriginalSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement, CdmBase cdmEntity, String label) {
         super(formFactory, formElement);
@@ -63,6 +66,10 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
 
         if (entity != null){
             selection_Ref.setEntity(entity.getCitation());
+            if (entity.getCitation() != null) {
+               refType = entity.getCitation().getType();
+            }
+
         }
         selection_Ref.setBackground(this.getPersistentBackground());
         microReference = formFactory.createTextWithLabelElement(formElement, "Details", entity != null? entity.getCitationMicroReference(): "", style);
@@ -77,7 +84,7 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
             accessed = formFactory.createTimePeriodElement(formElement, "Accessed", acc, style);
         }
 
-        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Link(s)", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+        externalLinks = formFactory.createExternalLinksSection(formElement, "Link(s)", StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(HibernateProxyHelper.deproxy(entity));
         externalLinks.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
@@ -85,7 +92,7 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
 
         addControl(externalLinks);
         addElement(externalLinks);
-        advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
+        advancedSection = formFactory.createOriginalSourceAdvancedSection(formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
         TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
         advancedSection.setLayoutData(layoutData);
         advancedSection.setFont(AbstractUtility.getFont(Resources.COLOR_FONT_DEFAULT));
@@ -105,7 +112,14 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
     @Override
     public void handleEvent(Object eventSource) {
         if (eventSource.equals(selection_Ref)){
+
             getEntity().setCitation(selection_Ref.getEntity());
+         
+            ReferenceType newRefType = getEntity().getCitation() != null? getEntity().getCitation().getType(): null;
+            if (refType != null && refType.isDynamic()^(newRefType!= null && newRefType.isDynamic()) ){
+               this.refresh();
+            }
+            refType = newRefType;
         }else if (eventSource.equals(microReference)){
             getEntity().setCitationMicroReference(microReference.getText());
         }else if(eventSource == accessed){
@@ -127,4 +141,32 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
         externalLinks.setIndent(indent+10);
         advancedSection.setIndent(indent+10);
     }
+
+    @Override
+    public void refresh() {
+               updateContent();
+               this.getParentElement().refresh();
+       }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       selection_Ref.setEntity(getEntity().getCitation()!= null? getEntity().getCitation(): null);
+                   microReference.setText(getEntity().getCitationMicroReference());
+                   if (accessed != null) {
+                       accessed.setEntity(getEntity().getAccessed()!= null? getEntity().getAccessed(): null);
+                   }
+                   if (advancedSection != null) {
+                       advancedSection.setEntity(getEntity());
+                   }
+
+                   externalLinks.setEntity(getEntity());
+
+               }
+
+       }
+
+
+
+
 }
\ No newline at end of file
index 16822f1bc04d26f1d479c737017301e9a448f0f2..a0e0982f8fb80251532a55aaaaf63c515428cbb4 100644 (file)
@@ -57,7 +57,9 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
        private TextWithLabelElement text_organisation;
        private TextWithLabelElement text_pages;
        private TextWithLabelElement text_placePublished;
+       private TextWithLabelElement text_placePublished2;
        private TextWithLabelElement text_publisher;
+       private TextWithLabelElement text_publisher2;
        private TextWithLabelElement text_referenceAbstract;
        private TextWithLabelElement text_series;
 //     private TextWithLabelElement text_seriesPart;
@@ -141,7 +143,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                if(referenceType != null && !referenceType.equals(ReferenceType.Journal) && !referenceType.equals(ReferenceType.PrintSeries) ) {
                        if (isNomenclaturalReference){
                                selection_authorTeam = formFactory
-                               .createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,getConversationHolder(),
+                               .createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
                                        formElement, "Author",
                                                entity.getAuthorship(),
                                                EntitySelectionElement.ALL, style);
@@ -212,10 +214,10 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
        }
 
-    private void createWebPageControls(ReferenceDetailElement referenceDetailElement, Reference reference, int style) {
+    private void createWebPageControls(ICdmFormElement element, Reference reference, int style) {
                DateTime accessed = reference.getAccessed();
 
-               text_accessed = formFactory.createDateElement(referenceDetailElement, "Accessed", accessed, style, false);
+               text_accessed = formFactory.createDateElement(element, "Accessed", accessed, style, false);
        }
 
        @Override
@@ -297,14 +299,27 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
        private void createPublicationControls(ICdmFormElement element,
                        ReferenceType referenceType, Reference reference, int style) {
 
-               // placePublished
-               text_placePublished = formFactory.createTextWithLabelElement(element,
-                               "Place Published", reference.getPlacePublished(), style);
+           if (!referenceType.equals(ReferenceType.Journal)) {
+               // placePublished
+               text_placePublished = formFactory.createTextWithLabelElement(element,
+                               "Place Published", reference.getPlacePublished(), style);
 
-               // publisher
-               text_publisher = formFactory.createTextWithLabelElement(element,
-                               "Publisher", reference.getPublisher(), style);
+               // publisher
+               text_publisher = formFactory.createTextWithLabelElement(element,
+                               "Publisher", reference.getPublisher(), style);
 
+               // placePublished2
+               text_placePublished2 = formFactory.createTextWithLabelElement(element,
+                                               "2nd Place Published", reference.getPlacePublished2(), style);
+
+               text_placePublished2.setEditable(!(reference.getPlacePublished() == null && reference.getPublisher() == null));
+
+
+               // publisher2
+               text_publisher2 = formFactory.createTextWithLabelElement(element,
+                               "2nd Publisher", reference.getPublisher2(), style);
+               text_publisher2.setEditable(!(getEntity().getPlacePublished() == null && getEntity().getPublisher() == null));
+           }
                if (referenceType.equals(ReferenceType.Journal)) {
                        // issn
                        text_issn = formFactory.createTextWithLabelElement(element, "ISSN",
@@ -314,7 +329,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                if (referenceType.equals(ReferenceType.Report)) {
                        // institution
                        selection_institution = formFactory
-                                       .createSelectionElement(Institution.class,//getConversationHolder(),
+                                       .createSelectionElement(Institution.class,
                                                element, "Institution",
                                                        reference.getInstitution(),
                                                        EntitySelectionElement.ALL, style);
@@ -403,7 +418,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
         text_uri = formFactory.createUriWithLabelElement(element, "URI",
                 reference.getUri(), style);
         if (reference.isDynamic()){
-            createWebPageControls(this, reference, style);
+            createWebPageControls(element, reference, style);
         }
     }
 
@@ -450,9 +465,17 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        getEntity().setPages(text_pages.getText());
                } else if (eventSource == text_placePublished) {
                        getEntity().setPlacePublished(text_placePublished.getText());
-               } else if (eventSource == text_publisher) {
+                       text_publisher2.setEditable(!(getEntity().getPlacePublished() == null && getEntity().getPublisher() == null));
+                       text_placePublished2.setEditable(!(getEntity().getPlacePublished() == null && getEntity().getPublisher() == null));
+               }  else if (eventSource == text_placePublished2) {
+                       getEntity().setPlacePublished2(text_placePublished2.getText());
+               }else if (eventSource == text_publisher) {
                        getEntity().setPublisher(text_publisher.getText());
-               } else if (eventSource == text_referenceAbstract) {
+                       text_publisher2.setEditable(!(getEntity().getPlacePublished() == null && getEntity().getPublisher() == null));
+                       text_placePublished2.setEditable(!(getEntity().getPlacePublished() == null && getEntity().getPublisher() == null));
+               } else if (eventSource == text_publisher2) {
+                       getEntity().setPublisher2(text_publisher2.getText());
+               }else if (eventSource == text_referenceAbstract) {
                        getEntity().setReferenceAbstract(text_referenceAbstract.getText());
                } else if (eventSource == text_series) {
                        getEntity().setSeriesPart(text_series.getText());
@@ -557,7 +580,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
                List<Object> except = new ArrayList<>();
 
-           except.addAll( Arrays.asList(new Object[] { toggleable_cache, toggleableAbbrevCache, text_editor, text_isbn, text_issn, text_organisation, text_pages, text_placePublished, text_publisher, text_referenceAbstract,  text_uri, selection_institution}));
+           except.addAll( Arrays.asList(new Object[] { toggleable_cache, toggleableAbbrevCache, text_editor, text_isbn, text_issn, text_organisation, text_pages, text_placePublished,text_placePublished2, text_publisher, text_publisher2, text_referenceAbstract,  text_uri, selection_institution}));
 
            if (abbrev){
              except.add(text_title);
@@ -579,4 +602,10 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
            updateCacheRelevance();
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+
+       }
 }
\ No newline at end of file
index da56b527f053aba61679b4c39f5b126477156216..c8aa6aeac5fca92d733227e4c6f101e92c79dac0 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.reference;
 import org.eclipse.e4.ui.workbench.modeling.EPartService;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.reference.Reference;
@@ -24,8 +23,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>ReferenceBaseDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created 05.06.2009
  */
@@ -33,18 +30,9 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
 
        private TaxonBase<?> taxonBase;
 
-       /**
-        * <p>Constructor for ReferenceBaseDetailSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
-        */
-       public ReferenceDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public ReferenceDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -55,6 +43,14 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
 
                setEntity(reference);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase<?> entity) {
+               this.taxonBase = entity;
+               TaxonName name = entity.getName();
+               Reference reference = HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+
+               setEntityWithoutUpdate(reference);
+       }
 
        @Override
        public String getHeading() {
index ecc68f8842e4856b54ce68204de9a63785b3b77a..c59b41d9bf5969fa7a6ff86f021c494566e09b96 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.reference;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -21,23 +20,15 @@ import eu.etaxonomy.taxeditor.ui.element.IExceptionHandler;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 
 /**
- * <p>ReferenceBaseWizardPage class.</p>
- *
  * @author n.hoffmann
  * @created Jun 1, 2010
  */
 public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference> implements IExceptionHandler{
-       private boolean isNomenclaturalReference = false;
 
-       /**
-        * <p>Constructor for ReferenceBaseWizardPage.</p>
-        *
-        * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
-        */
-       public ReferenceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity, boolean isNomenclaturalReference) {
-               super(formFactory, conversation, entity);
+    private boolean isNomenclaturalReference = false;
+
+       public ReferenceWizardPage(CdmFormFactory formFactory, Reference entity, boolean isNomenclaturalReference) {
+               super(formFactory, entity);
                setTitle("Reference");
                this.isNomenclaturalReference = isNomenclaturalReference;
        }
index 0265ede1600565b43817113943d5c232780041f9..a16c831026b53fbb4c873ca8e86121659baf31f6 100644 (file)
@@ -36,4 +36,10 @@ public class SecundumSourceDetailElement extends AbstractCdmDetailElement<TaxonB
                
        }
 
+       @Override
+       public void fillFields() {
+               sourceElement.fillFields();
+               
+       }
+
 }
old mode 100755 (executable)
new mode 100644 (file)
index 415eb8f..f580efb
@@ -35,7 +35,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 public class SecundumSourceElement extends OriginalSourceElement<SecundumSource> {
 
        protected EntitySelectionElement<TaxonName> select_nameUsedInSource;
-
+       
        public SecundumSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement, CdmBase cdmEntity,
             String label) {
         super(formFactory, formElement, cdmEntity, label);
@@ -44,10 +44,12 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
     @Override
     protected void createControls(ICdmFormElement formElement, SecundumSource entity,  int style) {
 
-        setEntityWithoutUpdate(HibernateProxyHelper.deproxy(entity));
+        HibernateProxyHelper.deproxy(entity);
 
         this.selection_Ref = formFactory.createSelectionElement(Reference.class, formElement, "Secundum", getEntity()!= null? getEntity().getCitation(): null, EntitySelectionElement.ALL, style);
-
+        if (entity.getCitation() != null) {
+               refType = entity.getCitation().getType();
+        }
         selection_Ref.setBackground(this.getPersistentBackground());
         for (ICdmFormElement element: selection_Ref.getElements()){
             element.setBackground(getPersistentBackground());
@@ -67,7 +69,7 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
                select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Name in Source", entity != null? ((NamedSourceBase)entity).getNameUsedInSource(): null, EntitySelectionElement.DELETABLE, style);
         }
 
-        externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, "Links", false, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
+        externalLinks = formFactory.createExternalLinksSection(formElement, "Links", false, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
         externalLinks.setEmptySectionString("No links yet.");
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
         externalLinks.setEntity(getEntity());
@@ -86,4 +88,15 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
                super.handleEvent(eventSource);
         }
     }
+    
+    @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       if (select_nameUsedInSource != null) {
+                               select_nameUsedInSource.setEntity(getEntity().getNameUsedInSource());
+                       }
+               }
+               
+       }
 }
\ No newline at end of file
index 384b5051b9af67f7254e590cd458f198876d40ac..3f83f02b9670d58658cffdefa470a0b9bcb7f886 100644 (file)
@@ -1,37 +1,38 @@
+/**
+ * Copyright (C) 2011 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.reference;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.name.NomenclaturalSource;
-import eu.etaxonomy.cdm.model.taxon.SecundumSource;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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;
 
 public abstract class SecundumSourceSection extends AbstractCdmDetailSection<TaxonBase>  {
-       
 
-       public SecundumSourceSection(CdmFormFactory formFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider,
-                       int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
-               
+       public SecundumSourceSection(CdmFormFactory formFactory, ICdmFormElement parentElement,
+               ISelectionProvider selectionProvider, int style) {
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
        public String getHeading() {
-               
+
                return "Secundum Source";
        }
-       
+
        @Override
        protected void setSectionTitle() {
                String title = "";
                if(getEntity() != null ){
-                       
+
                        if (getEntity().getSecSource() != null && getEntity().getSecSource().getCitation() != null){
                            String secundumCitation = getEntity().getSecSource().getCitation().getNomenclaturalCitation(getEntity().getSecSource().getCitationMicroReference());
                            title = ": " + secundumCitation;
@@ -44,7 +45,7 @@ public abstract class SecundumSourceSection extends AbstractCdmDetailSection<Tax
 //     @Override
 //     protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(
 //                     AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
-//             
+//
 //             return formFactory.createSecundumSourceDetailElement(parentElement);
 //     }
 
index 72fb88de7a1aa7c5cafb85a0c99ee4ca0be8b8f9..5b162ea710fe6b52992a0576cc128fa8da7f3ff8 100755 (executable)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.reference;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
@@ -28,19 +27,19 @@ public class SingleSourceSection extends AbstractCdmDetailSection<OriginalSource
     private CdmBase cdmEntity;
     private String label;
 
-    public SingleSourceSection(CdmFormFactory formFactory, ConversationHolder conversation,
+    public SingleSourceSection(CdmFormFactory formFactory,
             ICdmFormElement parentElement, CdmBase cdmEntity, ISelectionProvider selectionProvider, int style, String label) {
-        super(formFactory, conversation, parentElement, selectionProvider, style);
+        super(formFactory, parentElement, selectionProvider, style);
         this.cdmEntity = cdmEntity;
         this.label = label;
-        ((OriginalSourceElement)this.detailElement).setCdmEntity(cdmEntity);
+        ((OriginalSourceElement<?>)this.detailElement).setCdmEntity(cdmEntity);
     }
 
     @Override
     protected AbstractCdmDetailElement<OriginalSourceBase> createCdmDetailElement(
             AbstractCdmDetailSection<OriginalSourceBase> parentElement, int style) {
 
-        return new OriginalSourceElement(getFormFactory(), parentElement, cdmEntity, label);
+        return new OriginalSourceElement<>(getFormFactory(), parentElement, cdmEntity, label);
     }
 
     @Override
index 1fd7c9d296495316d6a404574a56719b724015c8..77ee10e75ab7a26d68f3e0ee6bb6162c40e820a3 100644 (file)
@@ -16,7 +16,9 @@ import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.ICdmTarget;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
@@ -45,6 +47,7 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
 
     protected boolean isCommonNameReference = false;
     protected EntitySelectionElement<Reference> selection_reference;
+    protected EntitySelectionElement<SpecimenOrObservationBase> selection_specimen;
     protected TextWithLabelElement text_referenceDetail;
     protected TimePeriodElement accessed;
        protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
@@ -108,7 +111,16 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
           selection_reference = formFactory
                     .createCommonNameReferenceSelectionElement(formElement, "Reference",
                             null, EntitySelectionElement.ALL, style);
-        }else{
+        }else if (entity instanceof DescriptionElementSource && PreferencesUtil.getBooleanValue(PreferencePredicate.ShowSpecimenInFactSource.getKey())) {
+               selection_reference = formFactory
+                    .createSelectionElement(Reference.class,
+                             formElement, "Reference",
+                            null, EntitySelectionElement.ALL, style);
+               selection_specimen = formFactory
+                                       .createSelectionElement(SpecimenOrObservationBase.class,
+                                               formElement, "or Specimen",
+                                                       null, EntitySelectionElement.ALL, SWT.NULL);
+               }else{
            selection_reference = formFactory
                       .createSelectionElement(Reference.class,
                                formElement, "Reference",
@@ -147,6 +159,9 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
 
                if (entity != null){
                        selection_reference.setEntity(entity.getCitation());
+                       if (selection_specimen != null && entity instanceof DescriptionElementSource) {
+                               selection_specimen.setEntity(((DescriptionElementSource)entity).getSpecimen());
+                       }
                text_referenceDetail.setText(entity.getCitationMicroReference());
                text_originalInfo.setText(entity.getOriginalInfo());
 
index 938db02977d9bde8fe3570b8e0ac74198e9d7f3f..c369655d65d8190ca0d31c4cb4c55a92f724ffa8 100644 (file)
@@ -29,14 +29,13 @@ public abstract class AbstractSourcedEntityElement<T extends SingleSourcedEntity
 
        private SelectionArbitrator selectionArbitrator;
        private OriginalSourceElement sourceElement;
-       private String label = "Source";
-//     protected EntitySelectionElement<Reference> selection_reference;
-//     protected TextWithLabelElement text_referenceDetail;
+       protected String label = "Source";
+
 
        protected boolean isCommonNameReference = false;
 
        public AbstractSourcedEntityElement(CdmFormFactory formFactory,
-                       AbstractFormSection section, T entity,
+                       AbstractFormSection<?> section, T entity,
                        SelectionListener removeListener, String label, int style, boolean isCommonNameReference) {
                super(formFactory, section, entity, removeListener, null, style);
                // make this element selectable
@@ -44,9 +43,7 @@ public abstract class AbstractSourcedEntityElement<T extends SingleSourcedEntity
                        selectionArbitrator = formFactory.createSelectionArbitrator(this);
                }
                this.isCommonNameReference = isCommonNameReference;
-               
-
-
+               this.label = label;
        }
 
     public AbstractSourcedEntityElement(CdmFormFactory formFactory,
@@ -55,10 +52,8 @@ public abstract class AbstractSourcedEntityElement<T extends SingleSourcedEntity
         this(formFactory, section, entity, removeListener, label, style, false);
     }
 
-
     @Override
        public void createControls(ICdmFormElement formElement, int style) {
-
            sourceElement = formFactory.createOriginalSourceElement(formElement, entity, label);
 
         if (entity.getSource() == null){
@@ -67,9 +62,7 @@ public abstract class AbstractSourcedEntityElement<T extends SingleSourcedEntity
             sourceElement.setEntity(source);
         }else{
             sourceElement.setEntity(entity.getSource());
-
         }
-        
        }
 
        @Override
@@ -89,5 +82,4 @@ public abstract class AbstractSourcedEntityElement<T extends SingleSourcedEntity
                this.sourceElement.refresh();
            }
        }
-
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoElement.java
new file mode 100644 (file)
index 0000000..8e0d7b2
--- /dev/null
@@ -0,0 +1,84 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.ui.section.supplemental;
+
+import org.eclipse.swt.events.SelectionListener;
+
+import eu.etaxonomy.cdm.model.common.AnnotationType;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.AnnotationDto;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.ui.combo.term.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;
+
+/**
+ * <p>AnnotationElement class.</p>
+ *
+ * @author Katja Luther
+ */
+public class AnnotationDtoElement extends AbstractEntityCollectionElement<AnnotationDto>{
+
+       private TextWithLabelElement text;
+       private TermComboElement<AnnotationType> combo_annotationType;
+
+       /**
+        * <p>Constructor for AnnotationElement.</p>
+        *
+        * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
+        * @param annotation a {@link eu.etaxonomy.cdm.model.common.Annotation} object.
+        * @param style a int.
+        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+        * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
+        */
+       public AnnotationDtoElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement, AnnotationDto annotation, SelectionListener removeListener, int style) {
+               super(cdmFormFactory, formElement, annotation, removeListener, null, style);
+       }
+
+       @Override
+       public void createControls(ICdmFormElement element, int style) {
+               combo_annotationType = formFactory.createDefinedTermComboElement(TermType.AnnotationType, this, "Annotation Type", null, style);
+
+               text = formFactory.createMultiLineTextWithLabel(this, "Annotation", 100, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
+       }
+
+       @Override
+       public void setEntity(AnnotationDto entity) {
+               this.entity = entity;
+               if (entity == null || combo_annotationType == null) {
+                   return;
+               }
+               if (combo_annotationType != null && entity.getTypeUuid() != null){
+                   AnnotationType selectedType = null;
+                   for (AnnotationType anType: combo_annotationType.getTerms()) {
+                       if (anType != null && anType.getUuid() != null && anType.getUuid().equals(entity.getTypeUuid())) {
+                           selectedType = anType;
+                           break;
+                       }
+                   }
+                   combo_annotationType.setSelection(selectedType);
+
+               }
+               text.setText(entity.getText());
+       }
+
+       @Override
+       public void handleEvent(Object eventSource) {
+               if(eventSource == combo_annotationType){
+                   getEntity().setTypeLabel(combo_annotationType.getSelection() == null ? null :combo_annotationType.getSelection().getLabel());
+                   getEntity().setTypeUuid(combo_annotationType.getSelection() == null ? null :combo_annotationType.getSelection().getUuid());
+               }else if(eventSource == text){
+                       getEntity().setText(text.getText());
+               }
+
+               EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AnnotationDtoSection.java
new file mode 100644 (file)
index 0000000..38eebb7
--- /dev/null
@@ -0,0 +1,90 @@
+/**
+* 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.supplemental;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.model.common.AnnotationType;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.persistence.dto.AnnotationDto;
+import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+
+/**
+ * @author n.hoffmann
+ * @created Nov 5, 2009
+ */
+public class AnnotationDtoSection extends AbstractEntityCollectionSection<TermNodeDto, AnnotationDto>{
+
+       public AnnotationDtoSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Annotations", style);
+       }
+
+       @Override
+       public AnnotationDto createNewElement() {
+               String text = "";
+               AnnotationType type = AnnotationType.EDITORIAL();
+               Language language = CdmStore.getDefaultLanguage();
+
+               AnnotationDto anDto = new AnnotationDto(UUID.randomUUID(), 0);
+               anDto.setTypeUuid(type.getUuid());
+               return anDto;
+       }
+
+       @Override
+       public Collection<AnnotationDto> getCollection(TermNodeDto entity) {
+               return entity.getAnnotations();
+       }
+
+       @Override
+       public Comparator<AnnotationDto> getComparator() {
+           return null;
+      //  return new DefaultCdmBaseComparator<>();
+       }
+
+       @Override
+       public String getEmptyString() {
+               return "No annotations yet.";
+       }
+
+       @Override
+       protected String getTooltipString() {
+               return "Create a new annotation";
+       }
+
+       @Override
+       public void addElement(AnnotationDto element) {
+               getEntity().addAnnotation(element);
+       }
+
+       @Override
+       public void removeElement(AnnotationDto element) {
+               getEntity().removeAnnotation(element);
+               EventUtility.postEvent(WorkbenchEventConstants.REMOVE_ELEMENT, element);
+       }
+
+    @Override
+    public AnnotationDto addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}
\ No newline at end of file
index 47b1060db886a987bc378ea4c2996291588f6dd5..7e0c7cc92657cb01a7efc71c3d32520874628592 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.supplemental;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.AnnotationType;
@@ -28,12 +27,8 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  */
 public class AnnotationSection extends AbstractEntityCollectionSection<AnnotatableEntity, Annotation>{
 
-       /**
-        * <p>Constructor for AnnotationSection.</p>
-        *
-        */
-       public AnnotationSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Annotations", style);
+       public AnnotationSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Annotations", style);
        }
 
        @Override
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoElement.java
new file mode 100644 (file)
index 0000000..7cc10dc
--- /dev/null
@@ -0,0 +1,89 @@
+/**
+* Copyright (C) 2009 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.supplemental;
+
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+
+import eu.etaxonomy.cdm.persistence.dto.ICdmBaseDto;
+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;
+
+/**
+ * @author l.morris
+ * @date 24 Jan 2012
+ */
+public class CdmBaseDtoElement extends AbstractCdmFormElement implements IEntityElement<ICdmBaseDto>{
+       private Label label_created;
+       private Label label_updated;
+       private TextWithLabelElement text_uuid;
+       private TextWithLabelElement text_objectId;
+
+       private ICdmBaseDto entity;
+
+       public CdmBaseDtoElement(CdmFormFactory formFactory,
+                       ICdmFormElement formElement, ICdmBaseDto entity, int style) {
+
+               super(formFactory, formElement);
+
+               label_created = formFactory.createLabel(getLayoutComposite(), null, style);
+               TableWrapData layout = LayoutConstants.FILL_HORIZONTALLY();
+               layout.maxHeight = 1;
+               label_created.setLayoutData(layout);
+
+               label_updated = formFactory.createLabel(getLayoutComposite(), null, style);
+               TableWrapData layoutUpdated = LayoutConstants.FILL_HORIZONTALLY();
+               layoutUpdated.maxHeight = 1;
+               label_updated.setLayoutData(layoutUpdated);
+               text_uuid = formFactory.createTextWithLabelElement(formElement, "UUID", null, style);
+               text_uuid.setEditable(false);
+               text_objectId = formFactory.createTextWithLabelElement(formElement, "Object ID", null, style);
+               text_objectId.setEditable(false);
+               if (entity != null) {
+                       setEntity(entity);
+               }
+       }
+
+       @Override
+       public void setSelected(boolean selected) {
+               // this entity element is not likely to get selected
+       }
+
+       @Override
+       public ICdmBaseDto getEntity() {
+               return entity;
+       }
+
+       public void setEntity(ICdmBaseDto entity) {
+
+               this.entity = entity;
+               String createdBy = entity.getCreatedBy()!= null? entity.getCreatedBy():"";
+               String createdString = "Created "
+                                       + dateFormat(entity.getCreated())
+                                       + " by " + createdBy;
+               label_created.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+               label_created.setText(createdString);
+
+               String updatedBy = entity.getUpdatedBy()!= null? entity.getUpdatedBy():"";
+               String updatedString = "Updated "
+                               + dateFormat(entity.getUpdated())
+                               + " by " + updatedBy;
+               label_updated.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+               label_updated.setText(updatedString);
+
+               text_uuid.setText(entity != null ? entity.getUuid().toString() : "");
+               text_objectId.setText(entity != null ? entity.getId()+"" : "");
+
+               refresh();
+       }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/CdmBaseDtoSection.java
new file mode 100644 (file)
index 0000000..7d14433
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+* Copyright (C) 2009 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.supplemental;
+
+import eu.etaxonomy.cdm.persistence.dto.ICdmBaseDto;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+
+/**
+ * @author l.morris
+ * @date 24 Jan 2012
+ *
+ */
+public class CdmBaseDtoSection extends AbstractFormSection<ICdmBaseDto> {
+
+       private CdmBaseDtoElement cdmBaseElement;
+
+       /**
+        * @param formFactory
+        * @param parentElement
+        * @param selectionProvider
+        * @param style
+        */
+       public CdmBaseDtoSection(CdmFormFactory formFactory,
+                       ICdmFormElement parentElement,
+                       int style) {
+
+               super(formFactory, parentElement, style);
+               cdmBaseElement = formFactory.createCdmBaseDtoElement(this, null, style);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void setEntity(ICdmBaseDto entity) {
+               super.setEntity(entity);
+               cdmBaseElement.setEntity(entity);
+       }
+
+}
index 7d0a586d04792f0a3a486ed629c069b7838d1a85..150fd2150dae3ca6c5f90d21edcd6f6e3e56f2de 100644 (file)
@@ -65,7 +65,7 @@ public class CreditElement extends AbstractEntityCollectionElement<Credit> {
        @Override
        public void createControls(ICdmFormElement element, int style) {
                agentSelection = formFactory
-                               .createSelectionElement(AgentBase.class,//getConversationHolder(),
+                               .createSelectionElement(AgentBase.class,
                                        this, "Agent", null,
                                                EntitySelectionElement.ALL, style);
                text = formFactory.createMultiLineTextWithLabel(this, "Text", 100,
index 3259284ec03237ffc88d6a4aa0a1b29f8cf453c4..b7a81018dd2e1490508044c3699d43d79f242254 100644 (file)
@@ -1,12 +1,16 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -22,25 +26,15 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
  */
 public class CreditSection extends AbstractEntityCollectionSection<IdentifiableEntity, Credit> {
 
-       /**
-        * <p>Constructor for CreditSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public CreditSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Credits", style);
+       public CreditSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Credits", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Credit createNewElement() {
                return Credit.NewInstance(null, null, null);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Collection<Credit> getCollection(IdentifiableEntity entity) {
                return entity.getCredits();
@@ -51,46 +45,35 @@ public class CreditSection extends AbstractEntityCollectionSection<IdentifiableE
         return new DefaultCdmBaseComparator<>();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return  "No credits yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Create a new credit entry";
        }
 
-       /** {@inheritDoc} */
        @Override
        public void addElement(Credit element) {
                getEntity().addCredit(element);
        }
 
-       /** {@inheritDoc} */
        @Override
        public void removeElement(Credit element) {
                getEntity().removeCredit(element);
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Credit addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index efeab0c165fe672d49c5e58fe0fa6b98c66e85bb..6ccc6c9b7e28f567e651bcdf7a69d1fe16f1cc9c 100644 (file)
@@ -1,12 +1,16 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -15,22 +19,12 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>ExtensionSection class.</p>
- *
  * @author nho
  */
 public class ExtensionSection extends AbstractEntityCollectionSection<IdentifiableEntity, Extension> {
 
-       /**
-        * <p>Constructor for ExtensionSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public ExtensionSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation,parentElement, "Extensions", style);
+       public ExtensionSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Extensions", style);
        }
 
        @Override
@@ -79,5 +73,4 @@ public class ExtensionSection extends AbstractEntityCollectionSection<Identifiab
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/HeadlineDtoSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/HeadlineDtoSection.java
new file mode 100644 (file)
index 0000000..dd31cb9
--- /dev/null
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.ui.section.supplemental;
+
+
+import eu.etaxonomy.cdm.persistence.dto.IAnnotatableDto;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+
+/**
+ * <p>HeadlineDtoSection class.</p>
+ *
+ * @author k.luther
+ */
+public class HeadlineDtoSection extends AbstractFormSection<IAnnotatableDto> {
+
+       /**
+        * <p>Constructor for HeadlineSection.</p>
+        *
+        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
+        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
+        * @param style a int.
+        */
+       public HeadlineDtoSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
+                       int style) {
+               super(cdmFormFactory, parentElement, style);
+       }
+
+       @Override
+       public void setEntity(IAnnotatableDto dto) {
+
+               super.setEntity(dto);
+
+               //String simpleName = entity.getClass().getSimpleName();
+        String titleString = dto.getLabel();
+        titleString = StoreUtil.cleanTitleString(titleString);
+        setText(titleString);
+               layout();
+       }
+
+}
index 96de77e9f05c8834a06dd66784d784c58c6c0288..94fd9b3ef4c1dac3525ded69bb19d62cd54a02ef 100644 (file)
@@ -52,7 +52,7 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
        @Override
        public void createControls(ICdmFormElement formElement, int style) {
                super.createControls(formElement, style);
-               externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, IdentifiableSource.class.getCanonicalName()));
+               externalLinks = formFactory.createExternalLinksSection(formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, IdentifiableSource.class.getCanonicalName()));
         externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
         if (entity != null){
                setEntity(this.entity);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoElement.java
new file mode 100644 (file)
index 0000000..6889a1f
--- /dev/null
@@ -0,0 +1,81 @@
+package eu.etaxonomy.taxeditor.ui.section.supplemental;
+
+import org.eclipse.swt.events.SelectionListener;
+
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.persistence.dto.IAnnotatableDto;
+import eu.etaxonomy.cdm.persistence.dto.MarkerDto;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.ui.combo.term.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;
+
+/**
+ * @author n.hoffmann
+ * @created Nov 16, 2009
+ * @version 1.0
+ */
+public class MarkerDtoElement extends AbstractEntityCollectionElement<MarkerDto>{
+
+
+       private TermComboElement<MarkerType> combo_markerType;
+       private CheckboxElement checkbox_markerState;
+
+       public MarkerDtoElement(CdmFormFactory cdmFormFactory, AbstractFormSection formElement, MarkerDto element,
+               SelectionListener removeListener, int style) {
+           super(cdmFormFactory, formElement, element, removeListener, null, style);
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void createControls(ICdmFormElement element, int style) {
+               checkbox_markerState = formFactory.createCheckbox(this, null, false, style);
+               combo_markerType = formFactory.createDefinedTermComboElement(TermType.MarkerType, this, null, null, style);
+               if (entity != null){
+                       setEntity(entity);
+               }
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void setEntity(MarkerDto element) {
+               this.entity = element;
+
+               if (checkbox_markerState != null){
+                       checkbox_markerState.setSelection(element.getValue());
+                       MarkerType selectedType = null;
+            for (MarkerType markerType: combo_markerType.getTerms()) {
+                if (markerType != null && markerType.getUuid() != null && markerType.getUuid().equals(entity.getTypeUuid())) {
+                    selectedType = markerType;
+                    break;
+                }
+            }
+            combo_markerType.setSelection(selectedType);
+
+
+                       combo_markerType.removeEmptyElement();
+               }
+       }
+
+       /** {@inheritDoc} */
+       @Override
+       public void handleEvent(Object eventSource) {
+               if(eventSource == combo_markerType && getParentElement() instanceof MarkerDtoSection){
+                   MarkerDtoSection markerSection = (MarkerDtoSection)getParentElement();
+                   IAnnotatableDto annotatableEntity = markerSection.getEntity();
+                   annotatableEntity.removeMarker(entity);
+                       MarkerType markerType = combo_markerType.getSelection();
+                       entity.setTypeUuid(markerType.getUuid());
+                       annotatableEntity.addMarker(entity);
+               }
+               else if(eventSource == checkbox_markerState){
+                       getEntity().setValue(checkbox_markerState.getSelection());
+               }
+               EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/MarkerDtoSection.java
new file mode 100644 (file)
index 0000000..9bd1b89
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.ui.section.supplemental;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.persistence.dto.IAnnotatableDto;
+import eu.etaxonomy.cdm.persistence.dto.MarkerDto;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author nho
+ */
+public class MarkerDtoSection extends AbstractUnboundEntityCollectionSection<IAnnotatableDto, MarkerDto> {
+
+       public MarkerDtoSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Marker", style);
+       }
+
+       @Override
+       public MarkerDto createNewElement() {
+           MarkerDto marker = new MarkerDto(UUID.randomUUID(), 0);
+           marker.setValue(true);
+        return marker;
+       }
+
+       @Override
+       public String getEmptyString() {
+               return "No markers yet.";
+       }
+
+       @Override
+       protected String getTooltipString() {
+               return "Create a new marker";
+       }
+
+       @Override
+       public void addElement(MarkerDto element) {
+               getEntity().addMarker(element);
+       }
+
+
+    @Override
+    public Comparator<MarkerDto> getComparator() {
+        return null;//new DefaultCdmBaseComparator<>();
+    }
+
+    @Override
+    public MarkerDto addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    protected Collection<MarkerDto> getEntityCollection(IAnnotatableDto entity) {
+        return entity.getMarkers();
+    }
+
+    @Override
+    public void removeElement(MarkerDto element) {
+       getEntity().removeMarker(element);
+       EventUtility.postEvent(WorkbenchEventConstants.REMOVE_ELEMENT, element);
+    }
+}
\ No newline at end of file
index 13837b269145a2bf36e7561c8cf5adcc83458f6f..dbb4653ce1af21622da10f060449540d7e78b3bf 100644 (file)
@@ -1,9 +1,16 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.element.CdmFormFactory;
@@ -12,22 +19,12 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
 
 /**
- * <p>MarkerSection class.</p>
- *
  * @author nho
  */
 public class MarkerSection extends AbstractUnboundEntityCollectionSection<AnnotatableEntity, Marker> {
 
-       /**
-        * <p>Constructor for MarkerSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public MarkerSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Marker", style);
+       public MarkerSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Marker", style);
        }
 
        @Override
@@ -78,5 +75,4 @@ public class MarkerSection extends AbstractUnboundEntityCollectionSection<Annota
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index a54ec51686c0e64817b0afbe7b3794babdde229d..6039207482f541bd1f7129b2fb094b7aea27b39a 100644 (file)
@@ -40,7 +40,7 @@ public class RightsElement extends AbstractEntityCollectionElement<Rights>{
        public void createControls(ICdmFormElement element, int style) {
                combo_rightsType = formFactory.createDefinedTermComboElement(TermType.RightsType, this, "Rights Type", null, style);
                selection_agent = formFactory.createSelectionElement(
-                               AgentBase.class, //getConversationHolder(),
+                               AgentBase.class,
                                this, "Agent",
                                null, EntitySelectionElement.ALL, style);
                text = formFactory.createMultiLineTextWithLabel(this, "Text", 100,
index 50e60346f5303335878b22158cb433d3d11d396a..8bc4154a046087f757197736521244e75c1e1c1e 100644 (file)
@@ -1,12 +1,16 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-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.dialog.selection.RightsSelectionDialog;
@@ -16,22 +20,12 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- * <p>RightsSection class.</p>
- *
  * @author nho
  */
 public class RightsSection extends AbstractEntityCollectionSection<IdentifiableEntity, Rights> {
 
-       /**
-        * <p>Constructor for RightsSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public RightsSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Rights", style);
+       public RightsSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Rights", style);
        }
 
        @Override
@@ -79,6 +73,4 @@ public class RightsSection extends AbstractEntityCollectionSection<IdentifiableE
     public boolean allowAddExisting() {
         return true;
     }
-
-
-}
+}
\ No newline at end of file
index 008ab07b0d93e15bf882e89f4a790af7fb17ff87..2881bb6d60a036f24890d4fed4542f9730b28b2b 100644 (file)
@@ -1,40 +1,33 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.reference.ISourceable;
 import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 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.description.SourceComparator;
 
 /**
- * <p>SourceSection class.</p>
- *
  * @author n.hoffmann
  * @created Nov 17, 2009
  */
 public class SourceSection extends AbstractEntityCollectionSection<ISourceable, IdentifiableSource> {
 
-       /**
-        * <p>Constructor for SourceSection.</p>
-        *
-        * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
-        * @param style a int.
-        * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
-        * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
-        */
-       public SourceSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Sources", style);
+       public SourceSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Sources", style);
        }
 
        @Override
index 6ac00ae80d47a114e9d5a75c68f1d9baf2bfc733..717d209dc0adbb8ffd43c5bc187e492cfd1ebda7 100644 (file)
@@ -1,6 +1,13 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.supplemental.identifier;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -9,26 +16,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 public abstract class AbstractIdentifierSection<T> extends AbstractEntityCollectionSection<T, Identifier> {
 
        public AbstractIdentifierSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(formFactory, conversation, parentElement, "Identifiers", style);
+                       ICdmFormElement parentElement, int style) {
+               super(formFactory, parentElement, "Identifiers", style);
        }
 
-       /** {@inheritDoc} */
        @Override
        public Identifier createNewElement() {
                return Identifier.NewInstance(null, null);
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getEmptyString() {
                return "No identifiers yet.";
        }
 
-       /** {@inheritDoc} */
        @Override
        protected String getTooltipString() {
                return "Add an identifier";
        }
-
-}
+}
\ No newline at end of file
index d17982187440cb5f96596a0a3bae6f947c0d0531..eeffce09263b4b2dee477655bd9a90a9890a7636 100644 (file)
@@ -6,31 +6,26 @@
 * 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.supplemental.identifier;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- *
  * @author pplitzner
- *
  */
 public class DerivedUnitFacadeIdentifierSection extends AbstractIdentifierSection<DerivedUnitFacade> {
 
-
        public DerivedUnitFacadeIdentifierSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, style);
+               super(formFactory, parentElement, style);
        }
 
        @Override
@@ -55,22 +50,15 @@ public class DerivedUnitFacadeIdentifierSection extends AbstractIdentifierSectio
                getEntity().removeIdentifier(element);
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Identifier addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index 05aa6ae361275e9f4f1208bd5f7091e899d19e5f..5fd9cc3955e626445ade4267db478b4e41d0925f 100644 (file)
@@ -6,13 +6,12 @@
  * 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.supplemental.identifier;
 
 import org.eclipse.swt.events.SelectionListener;
 
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
 import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.term.IdentifierType;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
@@ -22,15 +21,13 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 
 /**
- *
  * @author pplitzner
- *
  */
 public class IdentifierElement extends AbstractEntityCollectionElement<Identifier> {
 
        private TextWithLabelElement textIdentifier;
 
-       private TermComboElement<DefinedTerm> comboIdentifierType;
+       private TermComboElement<IdentifierType> comboIdentifierType;
 
     public IdentifierElement(CdmFormFactory formFactory,
             AbstractFormSection section, Identifier entity,
@@ -38,7 +35,6 @@ public class IdentifierElement extends AbstractEntityCollectionElement<Identifie
         super(formFactory, section, entity, removeListener, null, style);
     }
 
-    /** {@inheritDoc} */
     @Override
     public void setEntity(Identifier entity) {
         this.entity = entity;
@@ -47,9 +43,7 @@ public class IdentifierElement extends AbstractEntityCollectionElement<Identifie
                comboIdentifierType.setSelection(entity.getType());
         }
     }
-        
 
-       /** {@inheritDoc} */
        @Override
     public void createControls(ICdmFormElement formElement, int style) {
            comboIdentifierType = formFactory.createDefinedTermComboElement(TermType.IdentifierType, formElement, "Type", null, style);
@@ -67,5 +61,4 @@ public class IdentifierElement extends AbstractEntityCollectionElement<Identifie
                        getEntity().setType(comboIdentifierType.getSelection());
                }
        }
-
 }
index cca80ae1c9de164567fa033a6ba500f7ac04a9be..dfb0ef05d743a8e503df2455806572480dfe6795 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.supplemental.identifier;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Identifier;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -24,9 +23,9 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 public class IdentifierSection extends AbstractIdentifierSection<IdentifiableEntity> {
 
        public IdentifierSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, style);
+               super(formFactory, parentElement, style);
        }
 
        @Override
index cf98f4c61a9226745b4a730994c2dbe71130dbf8..0e9663be6eca75574113fd02262852227464329c 100644 (file)
@@ -6,7 +6,6 @@
 * 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.taxon;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
@@ -14,7 +13,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
@@ -26,13 +24,11 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>ParsingMessagesSection class.</p>
- *
  * @author n.hoffmann
  * @created Mar 3, 2010
  */
-public class ParsingMessagesSection 
-                       extends AbstractCdmDetailSection<INonViralName> 
+public class ParsingMessagesSection
+                       extends AbstractCdmDetailSection<INonViralName>
                        implements ITaxonBaseDetailSection {
 
        /** Constant <code>HEADING_SUCCESS=""</code> */
@@ -41,27 +37,16 @@ public class ParsingMessagesSection
        public static final String HEADING_PROBLEM = "The name has problems.";
        private TaxonBase taxonBase;
 
-       /**
-        * <p>Constructor for ParsingMessagesSection.</p>
-        *
-        * @param cdmFormFactory 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 ParsingMessagesSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
+       public ParsingMessagesSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
-       /** {@inheritDoc} */
        @Override
        protected void createControls(AbstractCdmDetailSection formElement, int style) {
                // we do it differently here
        }
 
-       /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
@@ -71,6 +56,12 @@ public class ParsingMessagesSection
                        displayParsingProblems();
                }
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               //
+               this.taxonBase = entity;
+               this.setEntityWithoutUpdate(entity.getName());
+       }
 
        private void destroyParsingProblemComposites() {
                setText(HEADING_SUCCESS);
@@ -95,7 +86,6 @@ public class ParsingMessagesSection
                this.layout();
        }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return HEADING_SUCCESS;
@@ -112,4 +102,4 @@ public class ParsingMessagesSection
            //no detail element
            return null;
        }
-}
+}
\ No newline at end of file
index 71ac44b30d5fd661ba1d8265968b8807e6b1d445..adb6955ed41d685e809bcf29efa7e9d6e4159dda 100644 (file)
@@ -19,7 +19,7 @@ import eu.etaxonomy.cdm.persistence.permission.Role;
 import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -45,7 +45,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
 
        private CheckboxElement checkbox_published;
 
-    private TermComboElement<SynonymType> combo_relationshipType;
+    private EnumComboElement<SynonymType> combo_relationshipType;
 
        public TaxonBaseDetailElement(CdmFormFactory cdmFormFactory,
                        ICdmFormElement formElement, int style) {
@@ -85,11 +85,9 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                checkbox_doubtful = formFactory.createCheckbox(formElement,
                                        entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
 
-
                checkbox_published = formFactory.createCheckbox(formElement,
                        entity.getClass().getSimpleName()+" is published", entity.isPublish(), style);
 
-
            //cache relevance
         registerCacheRelevance(checkbox_doubtful);
         registerCacheRelevance(checkbox_useNameCache);
@@ -102,7 +100,6 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
         checkbox_published.setEnabled(
                        CdmStore.currentAuthentiationHasOneOfRoles(Role.ROLE_PUBLISH, Role.ROLE_ADMIN)
                        );
-
     }
 
        @Override
@@ -155,4 +152,33 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void refresh() {
+               updateContent();
+
+       }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               if (!(checkbox_doubtful.getSelection() == getEntity().isDoubtful())) {
+                       checkbox_doubtful.setSelection(getEntity().isDoubtful());
+               }               
+               if (!(checkbox_useNameCache.getSelection() == getEntity().isUseNameCache())) {
+                       checkbox_useNameCache.setSelection(getEntity().isUseNameCache());
+               }
+               if (!secElement.getEntity().equals(getEntity().getSecSource())) {
+                       secElement.fillFields();
+               }
+               if (getEntity().getAppendedPhrase()!= null && !getEntity().getAppendedPhrase().equals(text_appendedPhrase.getText())) {
+                       text_appendedPhrase.setText(getEntity().getAppendedPhrase());
+               }
+               if (!(checkbox_published.getSelection() == getEntity().isPublish())) {
+                       checkbox_published.setSelection(getEntity().isPublish());
+               }
+               if (combo_relationshipType != null && !((Synonym) getEntity()).getType().equals(combo_relationshipType.getSelection())) {
+                       combo_relationshipType.setSelection(((Synonym) getEntity()).getType());
+               }               
+       }
 }
\ No newline at end of file
index eb6407e0cedc5ee2626d6b740d99098706837e34..7cc23688186059a97b624012be0cb798584cbfad 100644 (file)
@@ -10,21 +10,21 @@ package eu.etaxonomy.taxeditor.ui.section.taxon;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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;
 
 /**
  * @author n.hoffmann
  * @created Nov 4, 2009
  */
-public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?>> {
+public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?>> implements ITaxonBaseDetailSection{
 
-       public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
+       public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+               super(cdmFormFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -36,4 +36,22 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?
        protected AbstractCdmDetailElement<TaxonBase<?>> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase<?>> parentElement, int style) {
            return formFactory.createTaxonBaseDetailElement(parentElement, style);
        }
+
+       @Override
+       public void setTaxonBase(TaxonBase<?> taxon) {
+               this.setEntity(taxon);
+               
+       }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               setEntityWithoutUpdate(taxon);
+               
+       }
+
+       @Override
+       public TaxonBase<?> getTaxonBase() {
+               
+               return getEntity();
+       }
 }
index aa81c4c69f6baef08562633a669c2874e27c7061..734ff9694d54646304043117094ff3fbf2cdff81 100644 (file)
@@ -1,25 +1,28 @@
+/**
+* Copyright (C) 2009 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.taxon;
 
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 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.ICdmDetailElement;
 
 public class TaxonDetailSection extends AbstractCdmDetailSection<Taxon> {
 
-       
-       public TaxonDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
-       }
 
+       public TaxonDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
+               super(cdmFormFactory, parentElement, selectionProvider, style);
+       }
 
-       /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return getEntity() != null ? getEntity().getClass().getSimpleName() : "Taxon";
@@ -32,10 +35,5 @@ public class TaxonDetailSection extends AbstractCdmDetailSection<Taxon> {
 
        public void setTaxon(Taxon fromTaxon) {
                // TODO Auto-generated method stub
-               
        }
-
-       
-       
-
-}
+}
\ No newline at end of file
index 088ce9099cdbb0811a6e77361f2e04fd5ed6bf75..0f1db1a8ded4de9e711ca3ba4c22c301d622c19a 100644 (file)
@@ -108,4 +108,10 @@ public class TaxonOfRelationshipElement extends  AbstractIdentifiableEntityDetai
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               checkbox_doubtful.setSelection(getEntity().isDoubtful());
+       }
 }
\ No newline at end of file
index 8828f664a3b72841739cae9d938bb9d8b608303d..c6adbe6d149f583a0d2e38be6ce0a6d8e4fe5808 100644 (file)
@@ -8,8 +8,6 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.taxon;
 
-import java.util.Comparator;
-
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.SWT;
 
@@ -17,8 +15,6 @@ import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
-import eu.etaxonomy.cdm.model.term.TermRelationshipType;
-import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.taxeditor.event.EventUtility;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
@@ -26,7 +22,6 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.InverseTermWrapper;
 import eu.etaxonomy.taxeditor.ui.combo.MisappliedRelationshipComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.RelationshipTypeCombo;
-import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
@@ -77,7 +72,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
 
                        taxon = entity.getFromTaxon();
 
-            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
+            taxonElement = formFactory.createTaxonDetailSection(formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
             taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             addControl(taxonElement);
             addElement(taxonElement);
@@ -93,7 +88,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
 
             checkbox_published = formFactory.createCheckbox(this,
                     "Published", taxon.isPublish(), style);
-            sensuReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(),
+            sensuReference = formFactory.createSelectionElement(Reference.class,
                  formElement, label,
                 taxon.getSec(), EntitySelectionElement.ALL,
                 style);
@@ -121,7 +116,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
             }
 
             /*TODO: use super.createControls(); to create single source element
-            secReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(),
+            secReference = formFactory.createSelectionElement(Reference.class,
                     formElement, label,
                     entity.getCitation(), EntitySelectionElement.ALL,
                     style);
@@ -143,7 +138,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
                }else if (entity.getType().isAnySynonym() ){
                    taxon = entity.getFromTaxon();
 
-            taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
+            taxonElement = formFactory.createTaxonDetailSection(formElement, null, StoreUtil.getSectionStyle(TaxonDetailSection.class, Taxon.class.getCanonicalName()));
             taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             addControl(taxonElement);
             addElement(taxonElement);
@@ -156,7 +151,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
             checkbox_published = formFactory.createCheckbox(this,
                     "Published", taxon.isPublish(), style);
             /*
-             * secReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(),
+             * secReference = formFactory.createSelectionElement(Reference.class,
 
                     formElement, "Syn. Sec.",
                     entity.getCitation(), EntitySelectionElement.ALL,
@@ -170,7 +165,7 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
 
             super.createControls(formElement, entity, style);
             setSourceLabel("Syn. Sec.");
-            sensuReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(),
+            sensuReference = formFactory.createSelectionElement(Reference.class,
                     formElement, "Sec",
                    taxon.getSec(), EntitySelectionElement.ALL,
                    style);
@@ -193,10 +188,10 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
                     style,
                     false,
                     null);
+
             combo_taxonRelationshipType.setEnabled(false);
             selection_relatedTaxon = formFactory.createSelectionElement(
-                    Taxon.class, //getConversationHolder(),
+                    Taxon.class,
                     formElement, "Related Taxon", getRelatedTaxon(),
                     EntitySelectionElement.SELECTABLE, style);
             checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation Doubtful", entity.isDoubtful(), style);
@@ -282,4 +277,24 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
         // TODO Auto-generated method stub
         return null;
     }
+
+       @Override
+       public void fillFields() {
+               taxon = getEntity().getFromTaxon();
+               if (combo_misappliedRelationshipType!= null) {
+                       combo_misappliedRelationshipType.setSelection(getEntity().getType());
+               }
+               
+               super.singleSourceSection.fillFields();
+               selection_relatedTaxon.setEntity(getEntity().getToTaxon());;
+               checkBoxDoubtful.setSelection(getEntity().isDoubtful());
+               
+               sensuReference.setEntity(taxon.getSec());;
+               text_sensu_microreference.setText(taxon.getSecMicroReference());
+               text_appendedPhrase.setText(taxon.getAppendedPhrase());
+
+           checkbox_published.setSelection(taxon.isPublish());;
+           //taxonElement.fillFields();???
+               
+       }
 }
\ No newline at end of file
index a1edf71bfb641f86b0af8adc95da35d9a3dd8edc..c0c2ce060cd2ebb743614f36bed4927a85d56cfa 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
@@ -39,14 +38,15 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
  *
  */
 public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<TaxonRelationship> implements ITaxonBaseDetailSection {
-       Taxon taxon;
-       TaxonName name;
-       boolean taxonChoosable = false;
+
+    private Taxon taxon;
+       private TaxonName name;
+       private boolean taxonChoosable = false;
 
        public TaxonRelationshipDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style, boolean taxonChoosable) {
-               super(formFactory, conversation, parentElement,  selectionProvider, style);
+               super(formFactory, parentElement,  selectionProvider, style);
                this.taxonChoosable = taxonChoosable;
        }
 
@@ -64,13 +64,17 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
            return formFactory.createTaxonRelationshipDetailElement(parentElement);
        }
 
-       /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase taxon) {
                this.taxon = (Taxon)taxon;
                TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
                setName(name);
        }
+       
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase taxon) {
+               this.setTaxonBase(taxon);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
@@ -90,7 +94,7 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
                    Action chooseTaxonAction = new Action("Choose Taxon", IAction.AS_PUSH_BUTTON){
                        @Override
                        public void run() {
-                           Taxon taxon = TaxonBaseSelectionDialog.selectTaxon(getShell(), //getConversationHolder(),
+                           Taxon taxon = TaxonBaseSelectionDialog.selectTaxon(getShell(),
                                    getEntity().getFromTaxon());
                            if(taxon!=null){
                             taxon = HibernateProxyHelper.deproxy(taxon);
index 6e4350ef6fcac7a86e3f873506a6fe309da9ceca..298e7b2a3fbcbb4cd0d30ebc113afc891df01d07 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.taxon;
 
 import org.eclipse.swt.SWT;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -23,9 +22,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class TaxonWizardPage extends AbstractCdmEntityWizardPage<TaxonBase<?>> {
 
-       public TaxonWizardPage(CdmFormFactory formFactory, ConversationHolder conversation,
-               TaxonBase<?> entity) {
-               super(formFactory, conversation, entity);
+       public TaxonWizardPage(CdmFormFactory formFactory, TaxonBase<?> entity) {
+               super(formFactory, entity);
                setTitle("Taxon");
        }
 
index cab88c413e29516df18d22881b1aa523442c1d5f..4bf472adbcee55b757dff3ce1fbee2c55f03c46f 100644 (file)
@@ -59,7 +59,7 @@ public class GroupsByUserDetailElement extends
        @Override
        public void createControls(ICdmFormElement element, int style) {
                selection_group = formFactory
-                               .createSelectionElement(Group.class,//getConversationHolder(),
+                               .createSelectionElement(Group.class,
                                        element, "", getEntity(),
                                                EntitySelectionElement.NOTHING, style);
        }
index b7a22dcaf0ca8b55ec7f24d100721135f78cfaaa..6406b4e9d50515dcbcdd2e90a71c9d358f5cb495 100644 (file)
@@ -1,12 +1,16 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.section.user;
 
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.Group;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.GroupSelectionDialog;
@@ -17,26 +21,15 @@ import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
  * @author n.hoffmann
- *
  */
 public class GroupsByUserDetailSection extends AbstractEntityCollectionSection<User, Group> {
 
-       /**
-        * @param formFactory
-        * @param conversation
-        * @param parentElement
-        * @param title
-        * @param style
-        */
        public GroupsByUserDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        int style) {
-               super(formFactory, conversation, parentElement, "Groups", style);
+               super(formFactory, parentElement, "Groups", style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
-        */
        @Override
        public Collection<Group> getCollection(User entity) {
                return entity.getGroups();
@@ -47,64 +40,42 @@ public class GroupsByUserDetailSection extends AbstractEntityCollectionSection<U
         return new DefaultCdmBaseComparator<>();
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-        */
        @Override
        public Group createNewElement() {
-               Group selectedGroup = GroupSelectionDialog.select(getShell(), //getConversationHolder(),
+               Group selectedGroup = GroupSelectionDialog.select(getShell(),
                        null, getEntity());
                return selectedGroup;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
-        */
        @Override
        public void addElement(Group element) {
                element.addMember(getEntity());
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
-        */
        @Override
        public void removeElement(Group element) {
                element.removeMember(getEntity());
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
-        */
        @Override
        public String getEmptyString() {
                return "No groups yet.";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
-        */
        @Override
        protected String getTooltipString() {
                return "Add this user to a group";
        }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Group addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index 5fe9bcd870b2d89896f15598e4e0744f9b2e62be..b4a36a69579921ba7c1d78f1974354613957c0a0 100644 (file)
@@ -46,8 +46,7 @@ public class UserDetailElement extends AbstractCdmDetailElement<User> {
 
                if (userIsAuthenticated() || CdmStore.getLoginManager().isUserManager() || CdmStore.getLoginManager().isAdmin() ) {
                        formFactory.createEditPasswordElement(
-                                       formElement, "Change Password", getConversationHolder(),
-                                       entity, style);
+                                       formElement, "Change Password", entity, style);
                }
 
                text_emailAdress = formFactory.createTextWithLabelElement(formElement,
@@ -55,7 +54,6 @@ public class UserDetailElement extends AbstractCdmDetailElement<User> {
 
                selection_person = formFactory
                                .createSelectionElement(Person.class,
-                                               //getConversationHolder(),
                                                formElement,
                                                "Person",
                                                entity.getPerson(),
@@ -104,4 +102,17 @@ public class UserDetailElement extends AbstractCdmDetailElement<User> {
                                        checkbox_credentialsNonExpired.getSelection());
                }
        }
-}
+
+       @Override
+       public void fillFields() {
+               // TODO implement
+               //text_username;
+               //text_emailAdress;
+               //selection_person;
+               //checkbox_credentialsNonExpired;
+               //checkbox_enabled;
+               //checkbox_accountNonLocked;
+               //checkbox_accountNonExpired;
+               
+       }
+}
\ No newline at end of file
index 73f5b5dd9cf2b6f662b7bd1d008515149abc37a5..e80233e29d2ea96be4ae1beea33fe8cec3213b1c 100644 (file)
@@ -13,7 +13,6 @@ import java.util.List;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -26,9 +25,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 public class UserDetailSection extends AbstractCdmDetailSection<User> {
 
        public UserDetailSection(CdmFormFactory formFactory,
-                       ConversationHolder conversation, ICdmFormElement parentElement,
+                       ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
-               super(formFactory, conversation, parentElement, selectionProvider, style);
+               super(formFactory, parentElement, selectionProvider, style);
        }
 
        @Override
@@ -45,4 +44,4 @@ public class UserDetailSection extends AbstractCdmDetailSection<User> {
        protected AbstractCdmDetailElement<User> createCdmDetailElement(AbstractCdmDetailSection<User> parentElement, int style) {
            return formFactory.createUserDetailElement(parentElement);
        }
-}
+}
\ No newline at end of file
index 8e622e7ac2f03a1509d30d3e7ae0e82f6fe0ba0f..cbd44f8e1feee00a6a3b4e6ffd0e8d4f524e87a8 100644 (file)
@@ -3,7 +3,6 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.user;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -16,9 +15,8 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  */
 public class UserDetailWizardPage extends AbstractCdmEntityWizardPage<User> {
 
-       public UserDetailWizardPage(CdmFormFactory formFactory,
-                       ConversationHolder conversation, User entity) {
-               super(formFactory, conversation, entity);
+       public UserDetailWizardPage(CdmFormFactory formFactory, User entity) {
+               super(formFactory, entity);
                setTitle("User");
        }
 
index cf63b1701fbf49d607b0a0814d14b78e38d13b88..d7ea8df74a0a9232050fa6267c028051caa1048b 100644 (file)
@@ -15,18 +15,20 @@ import java.util.ListIterator;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
 import org.eclipse.swt.events.SelectionEvent;\r
 import org.eclipse.swt.events.SelectionListener;\r
 \r
-import eu.etaxonomy.cdm.model.term.DefinedTerm;\r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
 import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.common.LanguageString;\r
 import eu.etaxonomy.cdm.model.common.Marker;\r
-import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.cdm.model.description.CategoricalData;\r
 import eu.etaxonomy.cdm.model.description.State;\r
 import eu.etaxonomy.cdm.model.description.StateData;\r
+import eu.etaxonomy.cdm.model.term.DefinedTerm;\r
+import eu.etaxonomy.cdm.model.term.TermType;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.TermStore;\r
 import eu.etaxonomy.taxeditor.store.UsageTermCollection;\r
@@ -35,19 +37,17 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
 \r
-\r
 /**\r
  * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
  *\r
  * @author a.theys\r
  * @created mar 13, 2012\r
- * @version 1.0\r
  */\r
 public class UseRecordDetailElement extends\r
                AbstractCdmDetailElement<CategoricalData> implements SelectionListener {\r
 \r
        @SuppressWarnings("unused")\r
-       private static final Logger logger = LogManager.getLogger(UseRecordDetailElement.class);\r
+       private static final Logger logger = LogManager.getLogger();\r
 \r
        private TermComboElement<State> combo_UseCategory;\r
        private TermComboElement<State> combo_UseSubCategory;\r
@@ -61,7 +61,6 @@ public class UseRecordDetailElement extends
                super(formFactory, formElement);\r
        }\r
 \r
-       /** {@inheritDoc} */\r
        @Override\r
        protected void createControls(ICdmFormElement formElement,\r
                        CategoricalData entity, int style) {\r
@@ -111,13 +110,10 @@ public class UseRecordDetailElement extends
                } else {\r
                        combo_EthnicGroup.setEnabled(false);\r
                }\r
-\r
        }\r
 \r
        /**\r
         * Returns the select modifier\r
-        * @param comboCategory\r
-        * @return\r
         */\r
        private DefinedTerm modifierSelection(String comboCategory) {\r
                if(!getEntity().getModifiers().isEmpty()) {\r
@@ -130,13 +126,10 @@ public class UseRecordDetailElement extends
                        return null;\r
                }\r
                return null;\r
-\r
        }\r
 \r
        /**\r
         * Returns the selected state\r
-        * @param comboCategory\r
-        * @return\r
         */\r
        private State stateSelection(String comboCategory) {\r
                if (!getEntity().getStateData().isEmpty()) {\r
@@ -145,7 +138,7 @@ public class UseRecordDetailElement extends
                                        String testString = statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText();\r
                                        if(testString.equals(comboCategory)) {\r
                                                if(statedata.getState() !=null) {\r
-                                                       return statedata.getState();\r
+                                                       return CdmBase.deproxy(statedata.getState(), State.class);\r
                                                }\r
                                        }\r
                                }\r
@@ -155,14 +148,10 @@ public class UseRecordDetailElement extends
                        return null;\r
                }\r
                return null;\r
-\r
        }\r
 \r
        /**\r
         * This function sets the combo terms (Besides EthnicGroup\r
-        * @param listOfTerms\r
-        * @param modType\r
-        * @return\r
         */\r
        private List<DefinedTerm> setModifierComboTerms(List<DefinedTerm> listOfTerms, String modType) {\r
                List<DefinedTerm> termsToAdd = new ArrayList<DefinedTerm>();\r
@@ -179,17 +168,13 @@ public class UseRecordDetailElement extends
                return termsToAdd;\r
        }\r
 \r
-\r
        /**\r
         * This function sets the Use Category combo term\r
-        * @param listOfTerms\r
-        * @return\r
         */\r
        private List<State> setUseCategoryComboTerms(List<State> listOfTerms) {\r
-               List<State> termsToAdd = new ArrayList<State>();\r
+        List<State> termsToAdd = new ArrayList<>();\r
                for (State term : listOfTerms) {\r
-\r
-                       if ((term.getPartOf() != null) && (term.getPartOf().getUuid().equals( UsageTermCollection.uuidUseCategoryVocabulary))) {\r
+                   if ((term.getPartOf() != null) && (term.getPartOf().getUuid().equals( UsageTermCollection.uuidUseCategoryVocabulary))) {\r
                                termsToAdd.add(term);\r
                        }\r
                        else if ((term.getVocabulary() !=null) && (term.getPartOf() == null) && (term.getVocabulary().getUuid().equals(UsageTermCollection.uuidUseCategoryVocabulary))) {\r
@@ -197,18 +182,15 @@ public class UseRecordDetailElement extends
                        }\r
                }\r
                return termsToAdd;\r
-\r
        }\r
 \r
        /**\r
         * This function sets the Use SubCategory combo term\r
-        * @param listOfTerms\r
-        * @param selectedUseCategory\r
-        * @return\r
         */\r
        private List<State> setUseCategoryComboTerms(List<State> listOfTerms,\r
                        State selectedUseCategory) {\r
-               List<State> termsToAdd = new ArrayList<State>();\r
+\r
+               List<State> termsToAdd = new ArrayList<>();\r
                if (combo_UseCategory.getSelection() != null) {\r
 \r
                        for (State term : listOfTerms) {\r
@@ -236,9 +218,7 @@ public class UseRecordDetailElement extends
                                        }\r
                                }\r
                        }\r
-\r
                }\r
-\r
                else {\r
                        return null;\r
                }\r
@@ -249,9 +229,6 @@ public class UseRecordDetailElement extends
 \r
        /**\r
         * This function sets the EthnicGroup combo term\r
-        * @param listOfTerms\r
-        * @param selectedHumangroup\r
-        * @return\r
         */\r
        private List<DefinedTerm> setEthnicGroupComboTerms(List<DefinedTerm> listOfTerms,\r
                        DefinedTerm selectedHumangroup) {\r
@@ -291,8 +268,6 @@ public class UseRecordDetailElement extends
                return termsToAdd;\r
        }\r
 \r
-\r
-       /** {@inheritDoc} */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
                if (eventSource == combo_UseCategory) {\r
@@ -332,7 +307,6 @@ public class UseRecordDetailElement extends
                                        }\r
                                }\r
 \r
-\r
                                if (isChanged == false) {\r
                                        StateData stateData = StateData\r
                                                        .NewInstance(combo_UseCategory.getSelection());\r
@@ -342,16 +316,15 @@ public class UseRecordDetailElement extends
                                }\r
 \r
                                combo_UseSubCategory.setEnabled(true);\r
-\r
                        }\r
                        else {\r
                                if (!getEntity().getStateData().isEmpty()) {\r
                                        Iterator<StateData> itr = getEntity().getStateData().iterator();\r
                                        while(itr.hasNext()) {\r
-                                               StateData stateToRemove = itr.next();\r
+                                               itr.next();\r
                                                itr.remove();\r
                                        }\r
-                                       List<State> termsSubCategory = new ArrayList<State>();\r
+                                       List<State> termsSubCategory = new ArrayList<>();\r
                                        State emptyState = State.NewInstance();\r
                                        termsSubCategory.add(emptyState);\r
                                        combo_UseSubCategory.setTerms(termsSubCategory);\r
@@ -391,7 +364,6 @@ public class UseRecordDetailElement extends
                                        stateData.putModifyingText(CdmStore.getDefaultLanguage(), UsageTermCollection.useSubCategoryVocabularyLabel);\r
                                        getEntity().addStateData(stateData);\r
                                }\r
-\r
                        } else {\r
                                if (!getEntity().getStateData().isEmpty()) {\r
                                        Iterator<StateData> itrStateData = getEntity().getStateData().iterator();\r
@@ -417,7 +389,6 @@ public class UseRecordDetailElement extends
                                        if(GetVocabularyType(modifier, UsageTermCollection.plantPartLabel)) {\r
                                                itrExistingModifiers.remove();\r
                                        }\r
-\r
                                }\r
                                DefinedTerm plantPart = combo_PlantPart.getSelection();\r
                                getEntity().addModifier(plantPart);\r
@@ -432,7 +403,6 @@ public class UseRecordDetailElement extends
                                                }\r
                                        }\r
                                }\r
-\r
                        }\r
                }\r
                if (eventSource == combo_Country) {\r
@@ -443,7 +413,6 @@ public class UseRecordDetailElement extends
                                        if(GetVocabularyType(modifier, UsageTermCollection.countryLabel)) {\r
                                                itrExistingModifiers.remove();\r
                                        }\r
-\r
                                }\r
                                DefinedTerm country = combo_Country.getSelection();\r
                                getEntity().addModifier(country);\r
@@ -466,9 +435,7 @@ public class UseRecordDetailElement extends
                                for (DefinedTerm modToCheck: getEntity().getModifiers()) {\r
                                        if(modToCheck.equals(combo_HumanGroup.getSelection()) && (GetVocabularyType(modToCheck, UsageTermCollection.humanGroupLabel))) {\r
                                                isHumanGroupChanged = false;\r
-                               }\r
-\r
-\r
+                                       }\r
                                }\r
                                Iterator<DefinedTerm> itrExistingModifiers = getEntity().getModifiers().iterator();\r
                                while (itrExistingModifiers.hasNext()) {\r
@@ -476,7 +443,6 @@ public class UseRecordDetailElement extends
                                        if((GetVocabularyType(modifier, UsageTermCollection.humanGroupLabel) || GetVocabularyType(modifier, UsageTermCollection.ethnicGroupLabel)) && isHumanGroupChanged) {\r
                                                itrExistingModifiers.remove();\r
                                        }\r
-\r
                                }\r
                                if(isHumanGroupChanged){\r
                                        DefinedTerm humanGroup = combo_HumanGroup.getSelection();\r
@@ -499,11 +465,9 @@ public class UseRecordDetailElement extends
 //                             DefinedTerm emptyMod = DefinedTerm.NewInstance();\r
                                DefinedTerm emptyMod = null;\r
 \r
-\r
                                emptyListToResetComboBox.add(emptyMod);\r
                                combo_EthnicGroup.setTerms(emptyListToResetComboBox);\r
                                combo_EthnicGroup.setEnabled(false);\r
-\r
                        }\r
                }\r
                if (eventSource == combo_EthnicGroup) {\r
@@ -514,7 +478,6 @@ public class UseRecordDetailElement extends
                                                if(GetVocabularyType(modifier, combo_HumanGroup.getSelection().getTitleCache())) {\r
                                                        itrExistingModifiers.remove();\r
                                                }\r
-\r
                                        }\r
                                        DefinedTerm ethnicGroup = combo_EthnicGroup.getSelection();\r
                                        getEntity().addModifier(ethnicGroup);\r
@@ -529,19 +492,13 @@ public class UseRecordDetailElement extends
                                                        itr.remove();\r
                                                }\r
                                        }\r
-\r
                                }\r
                        }\r
                }\r
        }\r
 \r
-\r
-\r
        /**\r
         * This function Checks the vocabulary type\r
-        * @param term\r
-        * @param vocabularyExpected\r
-        * @return\r
         */\r
        private boolean GetVocabularyType(DefinedTerm term, String vocabularyExpected) {\r
                if ((term.getPartOf() != null)  && (term.getPartOf().getTitleCache().equals(vocabularyExpected))) {\r
@@ -556,15 +513,11 @@ public class UseRecordDetailElement extends
        return false;\r
        }\r
 \r
-\r
-\r
-       /** {@inheritDoc} */\r
        @Override\r
        public void setEntity(CategoricalData entity) {\r
                super.setEntity(entity);\r
        }\r
 \r
-       /** {@inheritDoc} */\r
        @Override\r
        public void widgetSelected(SelectionEvent e) {\r
                Object eventSource = e.getSource();\r
@@ -604,17 +557,26 @@ public class UseRecordDetailElement extends
                                                        }\r
                                                }\r
                                        }\r
-\r
                                }\r
                        }\r
                }\r
        }\r
 \r
-       /** {@inheritDoc} */\r
        @Override\r
        public void widgetDefaultSelected(SelectionEvent e) {\r
                // TODO Auto-generated method stub\r
+       }\r
+
 \r
+       @Override\r
+       public void fillFields() {\r
+               // TODO \r
+               //combo_UseCategory;\r
+               //combo_UseSubCategory;\r
+               //combo_PlantPart;\r
+               //combo_Country;\r
+               //combo_HumanGroup;\r
+               //combo_EthnicGroup;\r
        }\r
 \r
-}\r
+}
index 01b8ce6e5aa6cae218f36dcf69efd83a438d3327..602f9446758170aba0f14a8622d35dbb46d39704 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.userecords;
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\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.element.CdmFormFactory;\r
@@ -26,38 +25,24 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
  */\r
 public class UseRecordDetailSection extends AbstractCdmDetailSection<DescriptionElementBase> {\r
 \r
-       /**Constructor for class UseRecordDetailSection\r
-        *\r
-        * @param cdmFormFactory\r
-        * @param conversation\r
-        * @param parentElement\r
-        * @param selectionProvider\r
-        * @param style\r
-        */\r
-       public UseRecordDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,\r
+       public UseRecordDetailSection(CdmFormFactory cdmFormFactory,\r
                        ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {\r
-               super(cdmFormFactory, conversation, parentElement, selectionProvider, style);\r
+               super(cdmFormFactory, parentElement, selectionProvider, style);\r
        }\r
 \r
-       /** {@inheritDoc} */\r
        @Override\r
        public String getHeading() {\r
                return "Use Record";\r
        }\r
 \r
-       /** {@inheritDoc} */\r
        @Override\r
        protected void setSectionTitle() {\r
                this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));\r
                setTextClient(createToolbar());\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement createCdmDetailElement(AbstractCdmDetailSection<DescriptionElementBase> parentElement, int style) {\r
            return formFactory.createUseRecordDetailElement(parentElement);\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 4cf0c6f825f78a8f28bd3b350cd17a41529e765f..a905852bec0becc63e139ac9b8bef4c61c17d6fd 100644 (file)
@@ -8,12 +8,9 @@
 */\r
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
-import org.eclipse.swt.widgets.Button;\r
-\r
 import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.term.Representation;\r
 import eu.etaxonomy.cdm.model.term.TermBase;\r
-import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
@@ -25,14 +22,11 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 /**\r
  * @author l.morris\r
  * @date 20 Dec 2011\r
- *\r
  */\r
 public abstract class AbstractTermBaseDetailElement<T extends TermBase> extends AbstractCdmDetailElement<T> {\r
 \r
-       protected UriWithLabelElement uri_uri;\r
-       protected RepresentationElement element_Representation;\r
-       private Button button;\r
-\r
+       private UriWithLabelElement uri_uri;\r
+       private RepresentationElement element_Representation;\r
 \r
        public AbstractTermBaseDetailElement(CdmFormFactory formFactory,\r
                        ICdmFormElement formElement) {\r
@@ -71,7 +65,4 @@ public abstract class AbstractTermBaseDetailElement<T extends TermBase> extends
             getEntity().setTitleCache(null);\r
         }\r
     }\r
-\r
-       public abstract TermVocabulary getVocabulary();\r
-\r
-}\r
+}
\ No newline at end of file
index 22f67eb526651a1580b9550774bc73c15467648b..2c2a8594b726cf33261974e367f888c02f18ba40 100644 (file)
@@ -9,11 +9,8 @@
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
 import org.apache.commons.lang3.StringUtils;\r
-import org.eclipse.swt.widgets.Composite;\r
 \r
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
-import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
-import eu.etaxonomy.cdm.persistence.permission.TargetEntityStates;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelAndSetNullElement;\r
@@ -23,7 +20,7 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
  * @author l.morris\r
  * @date 20 Dec 2011\r
  */\r
-public class DefinedTermDetailElement<T extends DefinedTermBase> \r
+public class DefinedTermDetailElement<T extends DefinedTermBase>\r
                        extends AbstractTermBaseDetailElement<T> {\r
 \r
     protected TextWithLabelElement textIdInVocabulary;\r
@@ -32,10 +29,6 @@ public class DefinedTermDetailElement<T extends DefinedTermBase>
 \r
     protected TextWithLabelAndSetNullElement textSymbol2;\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param formElement\r
-        */\r
        public DefinedTermDetailElement(CdmFormFactory formFactory,\r
                        ICdmFormElement formElement) {\r
                super(formFactory, formElement);\r
@@ -55,7 +48,7 @@ public class DefinedTermDetailElement<T extends DefinedTermBase>
            }\r
            textSymbol = formFactory.createTextWithLabelAndSetNullElement(formElement, "Symbol", symbolString, style);\r
            textSymbol2 = formFactory.createTextWithLabelAndSetNullElement(formElement, "Symbol 2", symbolString2, style);\r
-       };\r
+       }\r
 \r
        @Override\r
        public void handleEvent(Object eventSource) {\r
@@ -66,8 +59,8 @@ public class DefinedTermDetailElement<T extends DefinedTermBase>
                        }else{\r
                                getEntity().setIdInVocabulary(textIdInVocabulary.getText());\r
                        }\r
-\r
                }\r
+\r
                if(eventSource==textSymbol){\r
                        if (textSymbol.getText().equals("[NULL]")){\r
                                getEntity().setSymbol(null);\r
@@ -81,14 +74,12 @@ public class DefinedTermDetailElement<T extends DefinedTermBase>
                                getEntity().setSymbol2(null);\r
                        }else {\r
                                getEntity().setSymbol2(textSymbol2.getText());\r
-                       }            \r
-\r
+                       }\r
         }\r
        }\r
 \r
        @Override\r
-       public TermVocabulary getVocabulary() {\r
-               return getEntity() != null ? getEntity().getVocabulary() : null;\r
+       public void fillFields() {\r
+               // TODO Auto-generated method stub\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 0125bc55543ecf027d564a47917d78609465e7be..1f9351d9b7a719d0e93ec8e56c22eb3d1ae2d037 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -20,27 +19,15 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**\r
  * @author l.morris\r
  * @date 4 Jan 2012\r
- *\r
  */\r
 public class DefinedTermDetailSection<T extends DefinedTermBase> extends AbstractCdmDetailSection<T> {\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param definedTermClass\r
-        * @param conversation\r
-        * @param parentElement\r
-        * @param selectionProvider\r
-        * @param style\r
-        */\r
        public DefinedTermDetailSection(CdmFormFactory formFactory,\r
-                       Class<T> definedTermClass, ConversationHolder conversation, ICdmFormElement parentElement,\r
+                       Class<T> definedTermClass, ICdmFormElement parentElement,\r
                        ISelectionProvider selectionProvider, int style) {\r
-               super(formFactory, definedTermClass, conversation, parentElement, selectionProvider, style);\r
+               super(formFactory, definedTermClass, parentElement, selectionProvider, style);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
-        */\r
        @Override\r
        public String getHeading() {\r
                /*String result = null;\r
@@ -48,25 +35,18 @@ public class DefinedTermDetailSection<T extends DefinedTermBase> extends Abstrac
                if (result == null){\r
                        result = getEntity().getTitleCache();\r
                } */\r
-               \r
+\r
                return "Defined Term ";//+ result;\r
        }\r
 \r
        //FIXME clean up create element methods\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElementByType(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, java.lang.Class, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement createCdmDetailElementByType(AbstractCdmDetailSection<T> parentElement, Class<T> entityClass, int style) {\r
            return formFactory.createDefinedTermDetailElement(entityClass, parentElement, style);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement<T> createCdmDetailElement(AbstractCdmDetailSection<T> parentElement, int style) {\r
            return null;\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 7daaf756e3461da61faef93301170e71f6c5db1a..567cb63513dc17b6b4299627382dbab77017969b 100644 (file)
@@ -14,6 +14,7 @@ import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;\r
+import eu.etaxonomy.taxeditor.ui.element.FloatWithLabelElement;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
 import eu.etaxonomy.taxeditor.ui.element.LabelElement;\r
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;\r
@@ -21,7 +22,6 @@ import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 /**\r
  * @author l.morris\r
  * @date 20 Dec 2011\r
- *\r
  */\r
 public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {\r
 \r
@@ -43,33 +43,31 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
 \r
     private CheckboxElement supportsTemporalData;\r
 \r
-    private StateVocabularyCollectionSection sectionStateVocabularies;\r
+    private RecommendedStateCollectionSection sectionStateVocabularies;\r
 \r
     private MeasurementUnitCollectionSection sectionMeasurementUnits;\r
 \r
     private StatisticalMeasureCollectionSection sectionStatisticalMeasures;\r
 \r
-    private RecommendedModifierVocabulariesCollectionSection sectionModifierVocabularies;\r
+    private RecommendedModifierCollectionsCollectionSection sectionModifierVocabularies;\r
     private CheckboxElement availableForTaxon;\r
     private CheckboxElement availableForTaxonName;\r
     private CheckboxElement availableForSpecimenOrObservation;\r
 \r
-    /**\r
-        * @param formFactory\r
-        * @param formElement\r
-        */\r
+    private FloatWithLabelElement maxPerDataset;\r
+    private FloatWithLabelElement maxStates;\r
+\r
        public FeatureDetailElement(CdmFormFactory formFactory,\r
                        ICdmFormElement formElement) {\r
                super(formFactory, formElement);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, eu.etaxonomy.cdm.model.term.TermBase, int)\r
-        */\r
        @Override\r
        protected void createControls(ICdmFormElement formElement, Feature entity, int style) {\r
            super.createControls(formElement, entity, style);\r
            this.parentFormElement = formElement;\r
+           //Layout\r
+\r
            LabelElement supportsLabel = formFactory.createLabel(formElement, "Supports");\r
            supportsLabel.setBold();\r
            supportsTextData = formFactory.createCheckbox(formElement, "Text Data", entity.isSupportsTextData(), style);\r
@@ -81,27 +79,32 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
            supportsCommonTaxonName = formFactory.createCheckbox(formElement, "Common Taxon Name", entity.isSupportsCommonTaxonName(), style);\r
            supportsTemporalData = formFactory.createCheckbox(formElement, "Temporal Data", entity.isSupportsTemporalData(), style);\r
 \r
+           //categorical data\r
         if (supportsCategoricalData.getSelection()) {\r
-            sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),\r
-                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+            maxStates = formFactory.createFloatTextWithLabelElement(formElement, "Max n states", entity.getMaxStates(), style);\r
+            sectionStateVocabularies = formFactory.createStateVocabulariesSection(\r
+                    parentFormElement, StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStateVocabularies.setEntity(getEntity());\r
-\r
         }\r
+\r
+        //quantitative data\r
         if (supportsQuantitativeData.getSelection()) {\r
-            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),\r
+            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(\r
                     parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionMeasurementUnits.setEntity(getEntity());\r
 \r
-            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(getConversationHolder(),\r
+            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(\r
                     parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionStatisticalMeasures.setEntity(getEntity());\r
         }\r
+\r
+        //both\r
         if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {\r
             sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                    getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+                    parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
             sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
             sectionModifierVocabularies.setEntity(getEntity());\r
         }\r
@@ -111,17 +114,21 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
         TableWrapData data = LayoutConstants.FILL_HORIZONTALLY(2, 1);\r
         data.maxHeight = 3;\r
         noLabel.setLayout(data);\r
+\r
         LabelElement availableLabel = formFactory.createLabel(formElement, "Available for");\r
         availableLabel.setBold();\r
 \r
         availableForTaxon = formFactory.createCheckbox(formElement, "Taxon", entity.isAvailableForTaxon(), style);\r
         availableForTaxonName = formFactory.createCheckbox(formElement, "Taxon Name", entity.isAvailableForTaxonName(), style);\r
         availableForSpecimenOrObservation = formFactory.createCheckbox(formElement, "Occurrence", entity.isAvailableForOccurrence(), style);\r
+        LabelElement noLabel2 = formFactory.createLabel(formElement, "");\r
+        data = LayoutConstants.FILL_HORIZONTALLY(2, 1);\r
+        data.maxHeight = 3;\r
+        noLabel2.setLayout(data);\r
+        maxPerDataset = formFactory.createFloatTextWithLabelElement(formElement, "Max n per dataset", entity.getMaxPerDataset(), style);\r
+        //maxPerDataset.setTextLimit(1);\r
     }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement#handleEvent(java.lang.Object)\r
-        */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
            super.handleEvent(eventSource);\r
@@ -165,17 +172,19 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
         }\r
            else if(eventSource == availableForSpecimenOrObservation){\r
             getEntity().setAvailableForOccurrence(availableForSpecimenOrObservation.getSelection());\r
-            \r
         }\r
            else if(eventSource == availableForTaxon){\r
             getEntity().setAvailableForTaxon(availableForTaxon.getSelection());\r
-            \r
         }\r
            else if(eventSource == availableForTaxonName){\r
             getEntity().setAvailableForTaxonName(availableForTaxonName.getSelection());\r
-            \r
         }\r
-\r
+           else if(eventSource == maxPerDataset){\r
+            getEntity().setMaxPerDataset(maxPerDataset.getInteger());\r
+        }\r
+           else if(eventSource == maxStates){\r
+            getEntity().setMaxStates(maxStates.getInteger());\r
+        }\r
         StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);\r
        }\r
 \r
@@ -186,20 +195,20 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
         removeCategoricalWidgets();\r
 \r
         //measurement units\r
-        sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),\r
-                parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+        sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(parentFormElement,\r
+                StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionMeasurementUnits.setEntity(getEntity());\r
 \r
         //statistical measures\r
         sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(\r
-                getConversationHolder(), parentFormElement,StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+                parentFormElement,StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionStatisticalMeasures.setEntity(getEntity());\r
 \r
         //modifiers\r
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionModifierVocabularies.setEntity(getEntity());\r
     }\r
@@ -218,24 +227,26 @@ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
         getEntity().setSupportsQuantitativeData(false);\r
         removeQuantitativeWidgets();\r
 \r
+        maxStates = formFactory.createFloatTextWithLabelElement(parentFormElement, "Max n states", getEntity().getMaxStates(), StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         //states\r
-        sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),\r
-                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+        sectionStateVocabularies = formFactory.createStateVocabulariesSection(\r
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedStateCollectionSection.class, getEntity().getClass().getCanonicalName()), getEntity().getMaxStates());\r
         sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionStateVocabularies.setEntity(getEntity());\r
 \r
+\r
         //modifiers\r
         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(\r
-                getConversationHolder(), parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
+                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierCollectionsCollectionSection.class, getEntity().getClass().getCanonicalName()));\r
         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));\r
         sectionModifierVocabularies.setEntity(getEntity());\r
     }\r
 \r
     private void removeCategoricalWidgets(){\r
         if(sectionStateVocabularies!=null){\r
+            removeElementsAndControls(maxStates);\r
             removeElementsAndControls(sectionStateVocabularies);\r
             removeElementsAndControls(sectionModifierVocabularies);\r
         }\r
     }\r
-\r
-}\r
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index f4e8527..533a72c
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import org.apache.commons.lang3.StringUtils;
 
 import eu.etaxonomy.cdm.model.common.Language;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
@@ -22,22 +21,16 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
  */
 public class LanguageDetailElement extends AbstractTermBaseDetailElement<Language> {
 
-    protected TextWithLabelElement textIdInVocabulary;
+    private TextWithLabelElement textIdInVocabulary;
 
-    protected TextWithLabelElement textISO_639_1;
+    private TextWithLabelElement textISO_639_1;
 
-    protected TextWithLabelElement textSymbol;
+    private TextWithLabelElement textSymbol;
 
-    protected TextWithLabelElement textSymbol2;
+    private TextWithLabelElement textSymbol2;
 
-
-    /**
-     * @param formFactory
-     * @param formElement
-     */
     public LanguageDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
-
     }
 
     @Override
@@ -47,7 +40,7 @@ public class LanguageDetailElement extends AbstractTermBaseDetailElement<Languag
         textISO_639_1 = formFactory.createTextWithLabelElement(formElement, "ID in ISO 639-1", entity.getIdInVocabulary(), style);
         textSymbol = formFactory.createTextWithLabelElement(formElement, "Symbol", entity.getSymbol(), style);
         textSymbol2 = formFactory.createTextWithLabelElement(formElement, "Symbol 2", entity.getSymbol2(), style);
-    };
+    }
 
     @Override
     public void handleEvent(Object eventSource) {
@@ -59,15 +52,14 @@ public class LanguageDetailElement extends AbstractTermBaseDetailElement<Languag
             }else{
                 getEntity().setIdInVocabulary(textIdInVocabulary.getText());
             }
-
         }
+
         if(eventSource==textSymbol){
             if (StringUtils.isBlank(textSymbol.getText())){
                 getEntity().setSymbol(null);
             }else{
                 getEntity().setSymbol(textSymbol.getText());
             }
-
         }
 
         if(eventSource==textSymbol2){
@@ -76,8 +68,8 @@ public class LanguageDetailElement extends AbstractTermBaseDetailElement<Languag
             }else{
                 getEntity().setSymbol2(textSymbol2.getText());
             }
-
         }
+
         if (eventSource == textISO_639_1){
             if (StringUtils.isBlank(textISO_639_1.getText())){
                 getEntity().setIso639_1(null);
@@ -87,10 +79,8 @@ public class LanguageDetailElement extends AbstractTermBaseDetailElement<Languag
         }
     }
 
-    @Override
-    public TermVocabulary getVocabulary() {
-        return getEntity() != null ? getEntity().getVocabulary() : null;
-    }
-
-
-}
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+       }
+}
\ No newline at end of file
index f6def5dbdfaf1d47054b1104babaa338d3e591ce..43d6e2f0a270ce8b4b254230ba773f8602883499 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -22,19 +21,14 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
 public class MeasurementUnitCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, MeasurementUnit> {
 
     public MeasurementUnitCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Recommended measurement units", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Recommended measurement units", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
     protected Collection<MeasurementUnit> getEntityCollection(Feature entity) {
         return entity.getRecommendedMeasurementUnits();
@@ -45,67 +39,40 @@ public class MeasurementUnitCollectionSection extends AbstractUnboundEntityColle
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
     @Override
     public MeasurementUnit createNewElement() {
         return MeasurementUnit.NewInstance();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(MeasurementUnit element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void removeElement(MeasurementUnit element) {
         getEntity().removeRecommendedMeasurementUnit(element);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No recommended measurement units yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a measurement unit";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public MeasurementUnit addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index f41c517e3dfb0035445ae84c0bd3953fc5c7213b..1f3d5f942112dd1b36a21fa965d7f4bed1ce9782 100755 (executable)
@@ -12,7 +12,6 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashSet;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.MeasurementUnit;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
@@ -23,19 +22,14 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
 public class MeasurementUnitDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermDto> {
 
     public MeasurementUnitDtoCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Recommended measurement units", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Recommended measurement units", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
     protected Collection<TermDto> getEntityCollection(FeatureDto entity) {
         if (entity.getRecommendedMeasurementUnits() == null){
@@ -64,28 +58,16 @@ public class MeasurementUnitDtoCollectionSection extends AbstractUnboundEntityCo
         };
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
     @Override
     public TermDto createNewElement() {
         return TermDto.fromTerm(MeasurementUnit.NewInstance());
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(TermDto element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void removeElement(TermDto element) {
         if (element == null){
@@ -101,40 +83,25 @@ public class MeasurementUnitDtoCollectionSection extends AbstractUnboundEntityCo
         getEntity().getRecommendedMeasurementUnits().remove(remove);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No recommended measurement units yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a measurement unit";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public TermDto addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index b303c9c31c1d1deac8c522dad4e58cd68863729e..5c1ca4230a20fed808238b0c3126a1e226e3f177 100644 (file)
@@ -8,10 +8,10 @@
 */\r
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;\r
 \r
-import eu.etaxonomy.cdm.model.term.TermType;\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.cdm.model.term.TermType;\r
 import eu.etaxonomy.taxeditor.ui.combo.term.TermComboElement;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -20,7 +20,6 @@ import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 /**\r
  * @author l.morris\r
  * @date 20 Dec 2011\r
- *\r
  */\r
 public class NamedAreaDetailElement extends DefinedTermDetailElement<NamedArea> {\r
 \r
@@ -31,10 +30,6 @@ public class NamedAreaDetailElement extends DefinedTermDetailElement<NamedArea>
        // validPeriod\r
        private TimePeriodElement timePeriod_validPeriod;\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param formElement\r
-        */\r
        public NamedAreaDetailElement(CdmFormFactory formFactory,\r
                        ICdmFormElement formElement) {\r
                super(formFactory, formElement);\r
@@ -47,12 +42,8 @@ public class NamedAreaDetailElement extends DefinedTermDetailElement<NamedArea>
                timePeriod_validPeriod = formFactory.createTimePeriodElement(formElement, "Valid Period", getEntity().getValidPeriod(), style);\r
                combo_namedAreaType = formFactory.createDefinedTermComboElement(TermType.NamedAreaType, formElement, "Named Area Type", getEntity().getType(), style);\r
                combo_namedAreaLevel = formFactory.createDefinedTermComboElement(TermType.NamedAreaLevel, formElement, "Named Area Level", getEntity().getLevel(), style);\r
-\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)\r
-        */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
         super.handleEvent(eventSource);\r
@@ -63,9 +54,5 @@ public class NamedAreaDetailElement extends DefinedTermDetailElement<NamedArea>
                } else if (eventSource == combo_namedAreaLevel) {\r
                        getEntity().setLevel(combo_namedAreaLevel.getSelection());\r
                }\r
-\r
-\r
        }\r
-\r
-\r
-}\r
+}
\ No newline at end of file
index 79470c1e6163800908f64fcca98a0aabb7a8942f..e0fc6accf5da1ef65f7c9db2c48e32babae6db01 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.location.NamedArea;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -20,39 +19,22 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**\r
  * @author l.morris\r
  * @date 20 Dec 2011\r
- *\r
  */\r
 public class NamedAreaDetailSection extends AbstractCdmDetailSection<NamedArea> {\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param conversation\r
-        * @param parentElement\r
-        * @param selectionProvider\r
-        * @param style\r
-        */\r
        public NamedAreaDetailSection(CdmFormFactory formFactory,\r
-                       ConversationHolder conversation, ICdmFormElement parentElement,\r
+                       ICdmFormElement parentElement,\r
                        ISelectionProvider selectionProvider, int style) {\r
-               super(formFactory, conversation, parentElement, selectionProvider, style);\r
-\r
+               super(formFactory, parentElement, selectionProvider, style);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
-        */\r
        @Override\r
        public String getHeading() {\r
-\r
                return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement<NamedArea> createCdmDetailElement(AbstractCdmDetailSection<NamedArea> parentElement, int style) {\r
            return formFactory.createNamedAreaDetailElement(parentElement);\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 7af628fa543e55f01f3c57416ed1cf5715b4e893..4a297b9f608b7bc8b338073c55b53aa230eb5f7a 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -20,32 +19,20 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**\r
  * @author l.morris\r
  * @date 4 Jan 2012\r
- *\r
  */\r
 public class NamedAreaLevelDetailSection extends AbstractCdmDetailSection<NamedAreaLevel> {\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param parentElement\r
-        * @param style\r
-        */\r
        public NamedAreaLevelDetailSection(CdmFormFactory formFactory,\r
-                       ConversationHolder conversation, ICdmFormElement parentElement,\r
+               ICdmFormElement parentElement,\r
                        ISelectionProvider selectionProvider, int style) {\r
-               super(formFactory, conversation, parentElement, selectionProvider, style);\r
+               super(formFactory, parentElement, selectionProvider, style);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
-        */\r
        @Override\r
        public String getHeading() {\r
                return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement<NamedAreaLevel> createCdmDetailElement(AbstractCdmDetailSection<NamedAreaLevel> parentElement, int style) {\r
            return formFactory.createNamedAreaLevelElement(parentElement);\r
index 1c68e7211308c69932a65686a302e5bd7ca98297..b9525ebd7d5209d34c8a879aaaca36a6a806a70f 100644 (file)
@@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -35,10 +34,8 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 
 /**
- *
  * @author pplitzner
  * @date Nov 24, 2016
- *
  */
 public class PresenceAbsenceTermDetailElement extends DefinedTermDetailElement<PresenceAbsenceTerm> implements SelectionListener{
 
@@ -48,8 +45,6 @@ public class PresenceAbsenceTermDetailElement extends DefinedTermDetailElement<P
 
     private Button btnColorChooser;
 
-    private Label isAbsentLabel;
-
     private Button btnIsAbsent;
 
        public PresenceAbsenceTermDetailElement(CdmFormFactory formFactory,
@@ -110,14 +105,6 @@ public class PresenceAbsenceTermDetailElement extends DefinedTermDetailElement<P
            super.handleEvent(eventSource);
        }
 
-       @Override
-       public TermVocabulary getVocabulary() {
-               return getEntity() != null ? getEntity().getVocabulary() : null;
-       }
-
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetSelected(SelectionEvent e) {
         if (e.getSource().equals(btnColorChooser)){
@@ -145,11 +132,7 @@ public class PresenceAbsenceTermDetailElement extends DefinedTermDetailElement<P
         firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetDefaultSelected(SelectionEvent e) {
     }
-
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsCollectionSection.java
new file mode 100644 (file)
index 0000000..0eef699
--- /dev/null
@@ -0,0 +1,82 @@
+/**
+* Copyright (C) 2015 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.vocabulary;
+
+import java.util.Collection;
+import java.util.Comparator;
+
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermCollection;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ */
+public class RecommendedModifierCollectionsCollectionSection
+        extends AbstractUnboundEntityCollectionSection<Feature, TermCollection<DefinedTerm,?>> {
+
+    public RecommendedModifierCollectionsCollectionSection(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Recommended modifier collections", style);
+    }
+
+    @Override
+    protected Collection<TermCollection<DefinedTerm,?>> getEntityCollection(Feature entity) {
+        return entity.getRecommendedModifierEnumeration();
+    }
+
+    @Override
+    public Comparator<TermCollection<DefinedTerm,?>> getComparator() {
+        return new DefaultCdmBaseComparator<>();
+    }
+
+    @Override
+    public TermVocabulary<DefinedTerm> createNewElement() {
+        return TermVocabulary.NewInstance(TermType.Modifier);
+    }
+
+    @Override
+    public void addElement(TermCollection<DefinedTerm,?> element) {
+        //never gets called
+    }
+
+    @Override
+    public void removeElement(TermCollection<DefinedTerm,?> element) {
+        getEntity().removeRecommendedModifierEnumeration(element);
+    }
+
+    @Override
+    public String getEmptyString() {
+        return "No modifier collection yet.";
+    }
+
+    @Override
+    protected String getTooltipString() {
+        return "Add a modifier collection";
+    }
+
+    @Override
+    public TermCollection<DefinedTerm,?> addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsDtoCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierCollectionsDtoCollectionSection.java
new file mode 100755 (executable)
index 0000000..f46d904
--- /dev/null
@@ -0,0 +1,109 @@
+/**
+* Copyright (C) 2015 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.vocabulary;
+
+import java.util.Collection;
+import java.util.Comparator;
+
+import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ */
+public class RecommendedModifierCollectionsDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermCollectionDto> {
+
+    public RecommendedModifierCollectionsDtoCollectionSection(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Recommended modifier collections", style);
+    }
+
+    @Override
+    protected Collection<TermCollectionDto> getEntityCollection(FeatureDto entity) {
+        return entity.getRecommendedModifierEnumeration();
+    }
+
+    @Override
+    public Comparator<TermCollectionDto> getComparator() {
+        return new Comparator<TermCollectionDto>() {
+            @Override
+            public int compare(TermCollectionDto o1, TermCollectionDto o2) {
+                if(o1==null){
+                    return -1;
+                }
+                if(o2==null){
+                    return 1;
+                }
+                int diff = o1.getTitleCache().compareTo(o2.getTitleCache());
+                if(diff==0){
+                    diff = o1.getUuid().compareTo(o2.getUuid());
+                }
+                return diff;
+            }
+        };
+    }
+
+    //TODO should not be implemented here as we do not want to create vocabularies/term collections here
+    @Override
+    public TermCollectionDto createNewElement() {
+        TermVocabulary<DefinedTerm> voc = TermVocabulary.NewInstance(TermType.Modifier);
+        return new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType(), voc.getTitleCache(), voc.isAllowDuplicates(), voc.isOrderRelevant(), voc.isFlat());
+    }
+
+    @Override
+    public void addElement(TermCollectionDto element) {
+        //never gets called
+    }
+
+    @Override
+    public void removeElement(TermCollectionDto element) {
+        if (element == null){
+            return;
+        }
+        TermCollectionDto remove = null;
+        for (TermCollectionDto voc: getEntity().getRecommendedModifierEnumeration()) {
+            if (voc.getUuid().equals(element.getUuid())){
+                remove = voc;
+                break;
+            }
+        }
+
+        getEntity().getRecommendedModifierEnumeration().remove(remove);
+    }
+
+    @Override
+    public String getEmptyString() {
+        return "No modifiers collections yet.";
+    }
+
+    @Override
+    protected String getTooltipString() {
+        return "Add a modifier collection";
+    }
+
+    @Override
+    public TermCollectionDto addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+}
\ No newline at end of file
@@ -11,11 +11,11 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 
+import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.taxeditor.ui.combo.TermCollectionComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,59 +24,46 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
-public class RecommendedModifierVocabulariesElement extends AbstractEntityCollectionElement<TermVocabulary<DefinedTerm>> {
-
+public class RecommendedModifierCollectionsElement extends AbstractEntityCollectionElement<TermCollection<DefinedTerm,?>> {
 
-    private VocabularyComboElement<DefinedTerm, TermVocabulary<DefinedTerm>> comboStateVocabulary;
+    private TermCollectionComboElement<DefinedTerm, TermCollection<DefinedTerm,?>> comboStateTermCollection;
 
-    /**
-     * @param formFactory
-     * @param section
-     * @param entity
-     * @param removeListener
-     * @param isChoosableEntity
-     * @param backgroundColor
-     * @param style
-     */
-    public RecommendedModifierVocabulariesElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<DefinedTerm> entity,
+    public RecommendedModifierCollectionsElement(CdmFormFactory formFactory, AbstractFormSection section, TermCollection<DefinedTerm,?> entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
-
     }
 
     @Override
     public void createControls(ICdmFormElement element, int style) {
-        comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.Modifier, "Modifier Vocabulary", null, element, style);
+        comboStateTermCollection = formFactory.createTermCollectionComboElement(TermType.Modifier, "Modifier Term Collections", null, element, style);
         if (entity != null){
                setEntity(entity);
         }
     }
 
     @Override
-    public void setEntity(TermVocabulary<DefinedTerm> entity) {
+    public void setEntity(TermCollection<DefinedTerm,?> entity) {
         this.entity = entity;
-        if(entity.getId()!=0 && comboStateVocabulary != null){
-            comboStateVocabulary.setSelection(entity);
-            comboStateVocabulary.removeEmptyElement();
+        if(entity.getId()!=0 && comboStateTermCollection != null){
+            comboStateTermCollection.setSelection(entity);
+            comboStateTermCollection.removeEmptyElement();
         }
     }
 
     @Override
     public void handleEvent(Object eventSource) {
-        if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
-            if(getParentElement() instanceof RecommendedModifierVocabulariesCollectionSection){
-                RecommendedModifierVocabulariesCollectionSection parentElement = (RecommendedModifierVocabulariesCollectionSection) getParentElement();
+        if(eventSource==comboStateTermCollection && comboStateTermCollection.getSelection()!=null){
+            if(getParentElement() instanceof RecommendedModifierCollectionsCollectionSection){
+                RecommendedModifierCollectionsCollectionSection parentElement = (RecommendedModifierCollectionsCollectionSection) getParentElement();
                 Feature feature = parentElement.getEntity();
                 feature.removeRecommendedModifierEnumeration(entity);
-                TermVocabulary<DefinedTerm> vocabulary = comboStateVocabulary.getSelection();
-                feature.addRecommendedModifierEnumeration(vocabulary);
-                entity = vocabulary;
+                TermCollection<DefinedTerm,?> termCollection = comboStateTermCollection.getSelection();
+                feature.addRecommendedModifierEnumeration(termCollection);
+                entity = termCollection;
                 //update the parent section to re-set the listeners to the persisted measurement unit
                 parentElement.removeElementAndUpdate(null);
             }
         }
     }
-
-}
+}
\ No newline at end of file
@@ -12,11 +12,11 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
+import eu.etaxonomy.taxeditor.ui.combo.TermCollectionComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,62 +25,50 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
-public class RecommendedModifierDtoVocabulariesElement extends AbstractEntityCollectionElement<TermVocabularyDto> {
+public class RecommendedModifierDtoCollectionsElement extends AbstractEntityCollectionElement<TermCollectionDto> {
 
+    private TermCollectionComboElement<DefinedTerm, TermCollection<DefinedTerm,?>> comboStateTermCollection;
 
-    private VocabularyComboElement<DefinedTerm, TermVocabulary<DefinedTerm>> comboStateVocabulary;
-
-    /**
-     * @param formFactory
-     * @param section
-     * @param entity
-     * @param removeListener
-     * @param isChoosableEntity
-     * @param backgroundColor
-     * @param style
-     */
-    public RecommendedModifierDtoVocabulariesElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabularyDto entity,
+    public RecommendedModifierDtoCollectionsElement(CdmFormFactory formFactory, AbstractFormSection section, TermCollectionDto entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
-
     }
 
     @Override
     public void createControls(ICdmFormElement element, int style) {
-        comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.Modifier, "Modifier Vocabulary", null, element, style);
+        comboStateTermCollection = formFactory.createTermCollectionComboElement(TermType.Modifier, "Modifier collection", null, element, style);
         if (entity != null){
                setEntity(entity);
         }
     }
 
     @Override
-    public void setEntity(TermVocabularyDto entity) {
+    public void setEntity(TermCollectionDto entity) {
         this.entity = entity;
-        if(comboStateVocabulary != null){
-            comboStateVocabulary.setSelectionDto(entity);
-            comboStateVocabulary.removeEmptyElement();
+        if(comboStateTermCollection != null){
+            comboStateTermCollection.setSelectionDto(entity);
+            comboStateTermCollection.removeEmptyElement();
         }
     }
 
 
     @Override
     public void handleEvent(Object eventSource) {
-        if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
-            if(getParentElement() instanceof RecommendedModifierVocabulariesDtoCollectionSection){
-                RecommendedModifierVocabulariesDtoCollectionSection parentElement = (RecommendedModifierVocabulariesDtoCollectionSection) getParentElement();
+        if(eventSource==comboStateTermCollection && comboStateTermCollection.getSelection()!=null){
+            if(getParentElement() instanceof RecommendedModifierCollectionsDtoCollectionSection){
+                RecommendedModifierCollectionsDtoCollectionSection parentElement = (RecommendedModifierCollectionsDtoCollectionSection) getParentElement();
                 FeatureDto feature = parentElement.getEntity();
-                TermVocabularyDto remove = null;
-                for (TermVocabularyDto voc: feature.getRecommendedModifierEnumeration()){
+                TermCollectionDto remove = null;
+                for (TermCollectionDto voc: feature.getRecommendedModifierEnumeration()){
                     if (voc.getUuid().equals(getEntity().getUuid())){
                         remove = voc;
                         break;
                     }
                 }
                 feature.getRecommendedModifierEnumeration().remove(remove);
-                TermVocabulary<DefinedTerm> vocabulary = comboStateVocabulary.getSelection();
-                entity = TermVocabularyDto.fromVocabulary(vocabulary);
+                TermCollection<DefinedTerm,?> termCollection = comboStateTermCollection.getSelection();
+                entity = TermCollectionDto.fromCdmBase(termCollection);
                 feature.getRecommendedModifierEnumeration().add(entity);
                 //update the parent section to re-set the listeners to the persisted measurement unit
 //                parentElement.removeElementAndUpdate(null);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesCollectionSection.java
deleted file mode 100644 (file)
index 891901c..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
-* Copyright (C) 2015 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.vocabulary;
-
-import java.util.Collection;
-import java.util.Comparator;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.term.DefinedTerm;
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
-
-/**
- * @author pplitzner
- * @date Apr 27, 2015
- *
- */
-public class RecommendedModifierVocabulariesCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<DefinedTerm>> {
-
-    public RecommendedModifierVocabulariesCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Recommended modifier vocabularies", style);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected Collection<TermVocabulary<DefinedTerm>> getEntityCollection(Feature entity) {
-        return entity.getRecommendedModifierEnumeration();
-    }
-
-    @Override
-    public Comparator<TermVocabulary<DefinedTerm>> getComparator() {
-        return new DefaultCdmBaseComparator<>();
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public TermVocabulary<DefinedTerm> createNewElement() {
-        return TermVocabulary.NewInstance(TermType.Modifier);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void addElement(TermVocabulary<DefinedTerm> element) {
-        //never gets called
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void removeElement(TermVocabulary<DefinedTerm> element) {
-        getEntity().removeRecommendedModifierEnumeration(element);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public String getEmptyString() {
-        return "No modifiers vocabularies yet.";
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected String getTooltipString() {
-        return "Add a modifier vocabulary";
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public TermVocabulary<DefinedTerm> addExisting() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean allowAddExisting() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesDtoCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedModifierVocabulariesDtoCollectionSection.java
deleted file mode 100755 (executable)
index 01119b4..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
-* Copyright (C) 2015 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.vocabulary;
-
-import java.util.Collection;
-import java.util.Comparator;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.description.State;
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
-import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
-
-/**
- * @author pplitzner
- * @date Apr 27, 2015
- *
- */
-public class RecommendedModifierVocabulariesDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermVocabularyDto> {
-
-    public RecommendedModifierVocabulariesDtoCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Recommended modifier vocabularies", style);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected Collection<TermVocabularyDto> getEntityCollection(FeatureDto entity) {
-        return entity.getRecommendedModifierEnumeration();
-    }
-
-    @Override
-    public Comparator<TermVocabularyDto> getComparator() {
-        return new Comparator<TermVocabularyDto>() {
-            @Override
-            public int compare(TermVocabularyDto o1, TermVocabularyDto o2) {
-                if(o1==null){
-                    return -1;
-                }
-                if(o2==null){
-                    return 1;
-                }
-                int diff = o1.getTitleCache().compareTo(o2.getTitleCache());
-                if(diff==0){
-                    diff = o1.getUuid().compareTo(o2.getUuid());
-                }
-                return diff;
-            }
-        };
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public TermVocabularyDto createNewElement() {
-        TermVocabulary<State> voc = TermVocabulary.NewInstance(TermType.Modifier);
-        return new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType(), voc.getTitleCache(), voc.isAllowDuplicates(), voc.isOrderRelevant(), voc.isFlat());
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void addElement(TermVocabularyDto element) {
-        //never gets called
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void removeElement(TermVocabularyDto element) {
-        if (element == null){
-            return;
-        }
-        TermVocabularyDto remove = null;
-        for (TermVocabularyDto voc: getEntity().getSupportedCategoricalEnumerations()){
-            if (voc.getUuid().equals(element.getUuid())){
-                remove = voc;
-                break;
-            }
-        }
-        getEntity().getSupportedCategoricalEnumerations().remove(remove);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public String getEmptyString() {
-        return "No modifiers vocabularies yet.";
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected String getTooltipString() {
-        return "Add a modifier vocabulary";
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public TermVocabularyDto addExisting() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean allowAddExisting() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-
-
-}
@@ -11,11 +11,11 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.State;
-import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.taxeditor.ui.combo.TermCollectionComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,59 +24,47 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
-public class StateVocabularyCollectionElement extends AbstractEntityCollectionElement<TermVocabulary<State>> {
-
+public class RecommendedStateCollectionElement<T extends DefinedTermBase<T>>
+        extends AbstractEntityCollectionElement<TermCollection<T,?>> {
 
-    private VocabularyComboElement<State, TermVocabulary<State>> comboStateVocabulary;
+    private TermCollectionComboElement<T, TermCollection<T,?>> comboStateCollection;
 
-    /**
-     * @param formFactory
-     * @param section
-     * @param entity
-     * @param removeListener
-     * @param isChoosableEntity
-     * @param backgroundColor
-     * @param style
-     */
-    public StateVocabularyCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<State> entity,
+    public RecommendedStateCollectionElement(CdmFormFactory formFactory, AbstractFormSection<T> section, TermCollection<T,?> entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
-
     }
 
     @Override
     public void createControls(ICdmFormElement element, int style) {
-        comboStateVocabulary = formFactory.createVocabularyComboElement(TermType.State, "State vocabulary", null, element, style);
+        comboStateCollection = formFactory.createTermCollectionComboElement(TermType.State, "State collection", null, element, style);
         if (entity != null){
                setEntity(entity);
         }
     }
 
     @Override
-    public void setEntity(TermVocabulary<State> entity) {
+    public void setEntity(TermCollection<T,?> entity) {
         this.entity = entity;
-        if(entity.getId()!=0 && comboStateVocabulary != null){
-            comboStateVocabulary.setSelection(entity);
-            comboStateVocabulary.removeEmptyElement();
+        if(entity.getId()!=0 && comboStateCollection != null){
+            comboStateCollection.setSelection(entity);
+            comboStateCollection.removeEmptyElement();
         }
     }
 
     @Override
     public void handleEvent(Object eventSource) {
-        if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
-            if(getParentElement() instanceof StateVocabularyCollectionSection){
-                StateVocabularyCollectionSection parentElement = (StateVocabularyCollectionSection) getParentElement();
+        if(eventSource==comboStateCollection && comboStateCollection.getSelection()!=null){
+            if(getParentElement() instanceof RecommendedStateCollectionSection){
+                RecommendedStateCollectionSection parentElement = (RecommendedStateCollectionSection) getParentElement();
                 Feature feature = parentElement.getEntity();
                 feature.removeSupportedCategoricalEnumeration(entity);
-                TermVocabulary<State> vocabulary = comboStateVocabulary.getSelection();
-                feature.addSupportedCategoricalEnumeration(vocabulary);
-                entity = vocabulary;
+                TermCollection<T,?> termCollection = comboStateCollection.getSelection();
+                feature.addSupportedCategoricalEnumeration(termCollection);
+                entity = termCollection;
                 //update the parent section to re-set the listeners to the persisted measurement unit
                 parentElement.removeElementAndUpdate(null);
             }
         }
     }
-
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/RecommendedStateCollectionSection.java
new file mode 100644 (file)
index 0000000..31e6a63
--- /dev/null
@@ -0,0 +1,94 @@
+/**
+* Copyright (C) 2015 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.vocabulary;
+
+import java.util.Collection;
+import java.util.Comparator;
+
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
+import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
+
+/**
+ * @author pplitzner
+ * @date Apr 27, 2015
+ */
+public class RecommendedStateCollectionSection
+        extends AbstractUnboundEntityCollectionSection<Feature, TermCollection<? extends DefinedTermBase,?>> {
+
+    public RecommendedStateCollectionSection(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Recommended state collections", style);
+    }
+
+    public RecommendedStateCollectionSection(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, int style, Integer maxStates) {
+        super(formFactory, parentElement, "Recommended state collections", style);
+    }
+
+    @Override
+    protected Collection<TermCollection<? extends DefinedTermBase,?>> getEntityCollection(Feature entity) {
+        return entity.getSupportedCategoricalEnumerations();
+    }
+
+    @Override
+    public Comparator<TermCollection<? extends DefinedTermBase,?>> getComparator() {
+        return new DefaultCdmBaseComparator<>();
+    }
+
+    //TODO should not be implemented as we do not want to create vocabularies/term collections here
+    @Override
+    public TermCollection<State,?> createNewElement() {
+        //FIXME 10196
+
+        return TermVocabulary.NewInstance(TermType.State);
+    }
+
+    @Override
+    public void addElement(TermCollection<? extends DefinedTermBase,?> element) {
+        //never gets called
+    }
+
+    @Override
+    public void removeElement(TermCollection<? extends DefinedTermBase,?> element) {
+        getEntity().removeSupportedCategoricalEnumeration(element);
+    }
+
+    @Override
+    public String getEmptyString() {
+        return "No state collections yet.";
+    }
+
+    @Override
+    protected String getTooltipString() {
+        return "Add a state collection";
+    }
+
+    @Override
+    public TermCollection<State,?> addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+
+}
\ No newline at end of file
@@ -8,15 +8,17 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 
+import java.util.EnumSet;
+
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
 
-import eu.etaxonomy.cdm.model.description.State;
+import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.model.term.TermCollection;
 import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
-import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
+import eu.etaxonomy.taxeditor.ui.combo.TermCollectionComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -25,61 +27,51 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
-public class StateVocabularyDtoCollectionElement extends AbstractEntityCollectionElement<TermVocabularyDto> {
-
+public class RecommendedStateCollectionsDtoElement<T extends DefinedTermBase<T>>
+        extends AbstractEntityCollectionElement<TermCollectionDto> {
 
-    private VocabularyComboElement<State, TermVocabulary<State>> comboStateVocabulary;
+    private TermCollectionComboElement<T, TermCollection<T,?>> comboStateCollection;
 
-    /**
-     * @param formFactory
-     * @param section
-     * @param entity
-     * @param removeListener
-     * @param isChoosableEntity
-     * @param backgroundColor
-     * @param style
-     */
-    public StateVocabularyDtoCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabularyDto entity,
+    public RecommendedStateCollectionsDtoElement(CdmFormFactory formFactory, AbstractFormSection section, TermCollectionDto entity,
             SelectionListener removeListener, Color backgroundColor, int style) {
         super(formFactory, section, entity, removeListener, backgroundColor, style);
-
     }
 
     @Override
     public void createControls(ICdmFormElement element, int style) {
-        comboStateVocabulary = formFactory.createVocabularyDtoComboElement(TermType.State, "State vocabulary", null, element, style);
+        //for now we allow State and Structure here
+        comboStateCollection = formFactory.createTermCollectionDtoComboElement(EnumSet.of(TermType.State, TermType.Structure), "State term collection", null, element, style);
         if (entity != null){
                setEntity(entity);
         }
     }
 
     @Override
-    public void setEntity(TermVocabularyDto entity) {
+    public void setEntity(TermCollectionDto entity) {
         this.entity = entity;
-        if(comboStateVocabulary != null){
-            comboStateVocabulary.setSelectionDto(entity);
-            comboStateVocabulary.removeEmptyElement();
+        if(comboStateCollection != null){
+            comboStateCollection.setSelectionDto(entity);
+            comboStateCollection.removeEmptyElement();
         }
     }
 
     @Override
     public void handleEvent(Object eventSource) {
-        if(eventSource==comboStateVocabulary && comboStateVocabulary.getSelection()!=null){
-            if(getParentElement() instanceof StateVocabularyDtoCollectionSection){
-                StateVocabularyDtoCollectionSection parentElement = (StateVocabularyDtoCollectionSection) getParentElement();
+        if(eventSource==comboStateCollection && comboStateCollection.getSelection()!=null){
+            if(getParentElement() instanceof RecommendedStateDtoCollectionSection){
+                RecommendedStateDtoCollectionSection parentElement = (RecommendedStateDtoCollectionSection) getParentElement();
                 FeatureDto feature = parentElement.getEntity();
-                TermVocabularyDto remove = null;
-                for (TermVocabularyDto voc: feature.getSupportedCategoricalEnumerations()){
+                TermCollectionDto remove = null;
+                for (TermCollectionDto voc: feature.getSupportedCategoricalEnumerations()){
                     if (voc.getUuid().equals(getEntity().getUuid())){
                         remove = voc;
                         break;
                     }
                 }
                 feature.getSupportedCategoricalEnumerations().remove(remove);
-                TermVocabulary<State> vocabulary = comboStateVocabulary.getSelection();
-                TermVocabularyDto dto = new TermVocabularyDto(vocabulary.getUuid(), vocabulary.getRepresentations(), vocabulary.getTermType(), vocabulary.getTitleCache(), vocabulary.isAllowDuplicates(), vocabulary.isOrderRelevant(), vocabulary.isFlat());
+                TermCollection<T,?> termCollection = comboStateCollection.getSelection();
+                TermCollectionDto dto = TermCollectionDto.fromCdmBase(termCollection);
                 feature.getSupportedCategoricalEnumerations().add(dto);
                 entity = dto;
                 //update the parent section to re-set the listeners to the persisted measurement unit
@@ -87,5 +79,4 @@ public class StateVocabularyDtoCollectionElement extends AbstractEntityCollectio
             }
         }
     }
-
-}
+}
\ No newline at end of file
@@ -11,11 +11,11 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.State;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
+import eu.etaxonomy.cdm.persistence.dto.TermCollectionDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -24,29 +24,24 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
-public class StateVocabularyDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermVocabularyDto> {
+public class RecommendedStateDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermCollectionDto> {
 
-    public StateVocabularyDtoCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Supported state vocabularies", style);
+    public RecommendedStateDtoCollectionSection(CdmFormFactory formFactory,
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Supported state collections", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
-    protected Collection<TermVocabularyDto> getEntityCollection(FeatureDto entity) {
+    protected Collection<TermCollectionDto> getEntityCollection(FeatureDto entity) {
         return entity.getSupportedCategoricalEnumerations();
     }
 
     @Override
-    public Comparator<TermVocabularyDto> getComparator() {
-        return new Comparator<TermVocabularyDto>() {
+    public Comparator<TermCollectionDto> getComparator() {
+        return new Comparator<TermCollectionDto>() {
             @Override
-            public int compare(TermVocabularyDto o1, TermVocabularyDto o2) {
+            public int compare(TermCollectionDto o1, TermCollectionDto o2) {
                 if(o1==null){
                     return -1;
                 }
@@ -62,36 +57,26 @@ public class StateVocabularyDtoCollectionSection extends AbstractUnboundEntityCo
         };
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
+    //TODO should not be implemented as we do not want to create new vocabularies/term collections here
     @Override
-    public TermVocabularyDto createNewElement() {
+    public TermCollectionDto createNewElement() {
+        //FIXME 10196
         TermVocabulary<State> voc = TermVocabulary.NewInstance(TermType.State);
         return new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType(), voc.getTitleCache(), voc.isAllowDuplicates(), voc.isOrderRelevant(), voc.isFlat());
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
-    public void addElement(TermVocabularyDto element) {
+    public void addElement(TermCollectionDto element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
-    public void removeElement(TermVocabularyDto element) {
+    public void removeElement(TermCollectionDto element) {
         if (element == null){
             return;
         }
-        TermVocabularyDto remove = null;
-        for (TermVocabularyDto voc: getEntity().getSupportedCategoricalEnumerations()){
+        TermCollectionDto remove = null;
+        for (TermCollectionDto voc: getEntity().getSupportedCategoricalEnumerations()){
             if (voc.getUuid().equals(element.getUuid())){
                 remove = voc;
                 break;
@@ -100,41 +85,25 @@ public class StateVocabularyDtoCollectionSection extends AbstractUnboundEntityCo
         getEntity().getSupportedCategoricalEnumerations().remove(remove);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
-        return "No state vocabularies yet.";
+        return "No state collections yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
-        return "Add a state vocabulary";
+        return "Add a state collection";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
-    public TermVocabularyDto addExisting() {
+    public TermCollectionDto addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/StateVocabularyCollectionSection.java
deleted file mode 100644 (file)
index 153ba8f..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
-* Copyright (C) 2015 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.vocabulary;
-
-import java.util.Collection;
-import java.util.Comparator;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.term.TermType;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.State;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection;
-
-/**
- * @author pplitzner
- * @date Apr 27, 2015
- *
- */
-public class StateVocabularyCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, TermVocabulary<State>> {
-
-    public StateVocabularyCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Supported state vocabularies", style);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected Collection<TermVocabulary<State>> getEntityCollection(Feature entity) {
-        return entity.getSupportedCategoricalEnumerations();
-    }
-
-    @Override
-    public Comparator<TermVocabulary<State>> getComparator() {
-        return new DefaultCdmBaseComparator<>();
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public TermVocabulary<State> createNewElement() {
-        return TermVocabulary.NewInstance(TermType.State);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void addElement(TermVocabulary<State> element) {
-        //never gets called
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
-    @Override
-    public void removeElement(TermVocabulary<State> element) {
-        getEntity().removeSupportedCategoricalEnumeration(element);
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    public String getEmptyString() {
-        return "No state vocabularies yet.";
-    }
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
-    @Override
-    protected String getTooltipString() {
-        return "Add a state vocabulary";
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public TermVocabulary<State> addExisting() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean allowAddExisting() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-
-}
index fabe44198ae25eb205629cec4f9cdce58e534a72..a63f777e07d2bd12ef12845893c93e24b91ae775 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -22,19 +21,14 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
 public class StatisticalMeasureCollectionSection extends AbstractUnboundEntityCollectionSection<Feature, StatisticalMeasure> {
 
     public StatisticalMeasureCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Statistical measures", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Statistical measures", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
     protected Collection<StatisticalMeasure> getEntityCollection(Feature entity) {
         return entity.getRecommendedStatisticalMeasures();
@@ -45,67 +39,40 @@ public class StatisticalMeasureCollectionSection extends AbstractUnboundEntityCo
         return new DefaultCdmBaseComparator<>();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
     @Override
     public StatisticalMeasure createNewElement() {
         return StatisticalMeasure.NewInstance();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(StatisticalMeasure element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void removeElement(StatisticalMeasure element) {
         getEntity().removeRecommendedStatisticalMeasure(element);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No statistical measures yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a statistical measure";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public StatisticalMeasure addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index bf351019ad347ec3d584bafb8346b279138c4463..2aeff4cecabb0f390a9975c9a4dd4e0e477d216a 100755 (executable)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
 import eu.etaxonomy.cdm.persistence.dto.FeatureDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
@@ -22,19 +21,14 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCol
 /**
  * @author pplitzner
  * @date Apr 27, 2015
- *
  */
 public class StatisticalMeasureDtoCollectionSection extends AbstractUnboundEntityCollectionSection<FeatureDto, TermDto> {
 
     public StatisticalMeasureDtoCollectionSection(CdmFormFactory formFactory,
-            ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-        super(formFactory, conversation, parentElement, "Statistical measures", style);
+            ICdmFormElement parentElement, int style) {
+        super(formFactory, parentElement, "Statistical measures", style);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractNullEntityCollectionSection#getEntityCollection(java.lang.Object)
-     */
-    /** {@inheritDoc} */
     @Override
     protected Collection<TermDto> getEntityCollection(FeatureDto entity) {
         return entity.getRecommendedStatisticalMeasures();
@@ -60,28 +54,16 @@ public class StatisticalMeasureDtoCollectionSection extends AbstractUnboundEntit
         };
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
-     */
-    /** {@inheritDoc} */
     @Override
     public TermDto createNewElement() {
         return TermDto.fromTerm(StatisticalMeasure.NewInstance());
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void addElement(TermDto element) {
         //never gets called
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
-     */
-    /** {@inheritDoc} */
     @Override
     public void removeElement(TermDto element) {
         if (element == null){
@@ -97,40 +79,25 @@ public class StatisticalMeasureDtoCollectionSection extends AbstractUnboundEntit
         getEntity().getRecommendedStatisticalMeasures().remove(remove);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
-     */
-    /** {@inheritDoc} */
     @Override
     public String getEmptyString() {
         return "No statistical measures yet.";
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
-     */
-    /** {@inheritDoc} */
     @Override
     protected String getTooltipString() {
         return "Add a statistical measure";
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public TermDto addExisting() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean allowAddExisting() {
         // TODO Auto-generated method stub
         return false;
     }
-
-}
+}
\ No newline at end of file
index 6a81862e7c4eab03c0547e8af159787bbff62198..84add773350b5baf771505ce2e96f82c59a8b102 100644 (file)
@@ -6,9 +6,9 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 import java.util.Collection;
 import java.util.Comparator;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
@@ -16,15 +16,14 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
- *
  * @author pplitzner
  * @since May 17, 2019
- *
  */
 public class TermMediaSection extends AbstractEntityCollectionSection<DefinedTermBase, Media>{
 
-       public TermMediaSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, int style) {
-               super(cdmFormFactory, conversation, parentElement, "Media", style);
+       public TermMediaSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, int style) {
+               super(cdmFormFactory, parentElement, "Media", style);
+               
        }
 
        @Override
@@ -71,5 +70,10 @@ public class TermMediaSection extends AbstractEntityCollectionSection<DefinedTer
     public boolean allowAddExisting() {
         return true;
     }
-
-}
+    
+    @Override
+    public void setEntity(DefinedTermBase entity) {
+        super.setEntity(entity);
+        setEnabled(TermBasePropertyTester.isModifiable(entity));        
+    }
+}
\ No newline at end of file
index b88486c755d191cab1f7bc2e380f8b251b23d2eb..fc4c162ef0205e0b9a4414064cd18986b545e424 100644 (file)
@@ -43,8 +43,8 @@ public class TermVocabularyDetailElement extends AbstractTermBaseDetailElement<T
        }\r
 \r
        @Override\r
-       public TermVocabulary getVocabulary() {\r
-               return getEntity();\r
+       public void fillFields() {\r
+               // TODO\r
+               //uri_uriTermSource\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 90fe16f59a274671ab50ea1b57cdb67f4be50452..8883b7444bb1ee625f9e78f6dfddcac9cd9b8a4c 100644 (file)
@@ -10,7 +10,6 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 \r
 import org.eclipse.jface.viewers.ISelectionProvider;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.model.term.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
@@ -20,45 +19,26 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 /**\r
  * @author l.morris\r
  * @date 20 Dec 2011\r
- *\r
  */\r
 public class TermVocabularyDetailSection extends\r
                AbstractCdmDetailSection<TermVocabulary> {\r
 \r
-       /**\r
-        * @param formFactory\r
-        * @param conversation\r
-        * @param parentElement\r
-        * @param selectionProvider\r
-        * @param style\r
-        */\r
        public TermVocabularyDetailSection(CdmFormFactory formFactory,\r
-                       ConversationHolder conversation, ICdmFormElement parentElement,\r
+                       ICdmFormElement parentElement,\r
                        ISelectionProvider selectionProvider, int style) {\r
-               super(formFactory, conversation, parentElement, selectionProvider, style);\r
-               // TODO Auto-generated constructor stub\r
+               super(formFactory, parentElement, selectionProvider, style);\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()\r
-        */\r
        @Override\r
        public String getHeading() {\r
-\r
                return "Vocabulary: "+ (getEntity() != null ? getEntity().getLabel() : "");\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#setSectionTitle()\r
-        */\r
        @Override\r
        protected void setSectionTitle() {\r
                setText(getHeading());\r
        }\r
 \r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)\r
-        */\r
        @Override\r
        protected AbstractCdmDetailElement<TermVocabulary> createCdmDetailElement(AbstractCdmDetailSection<TermVocabulary> parentElement, int style) {\r
            return formFactory.createTermVocabularyDetailElement(parentElement);\r
index 872846befeda12a527960f1195bf786f711d1e12..5d84cbaf760f66e2ae21fbf0182cd38430b1c428 100644 (file)
@@ -1,3 +1,11 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.selection;
 
 import eu.etaxonomy.cdm.model.taxon.Classification;
@@ -6,14 +14,12 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 public class ClassificationSelectionElement extends EntitySelectionElement<Classification> {
 
-       public ClassificationSelectionElement(CdmFormFactory formFactory,//ConversationHolder conversation, #
+       public ClassificationSelectionElement(CdmFormFactory formFactory,
                ICdmFormElement parentElement,
                        Class<Classification> clazz, String labelString,
                        Classification entity, int mode, int style) {
-               super(formFactory, //conversation,
+               super(formFactory,
                        parentElement, clazz, labelString, entity,
                                mode, style);
-
        }
-
-}
+}
\ No newline at end of file
index 95cb2b600bce3074191560eef7253a5d8e4ae852..b2790b02ed4a8747ed74f0d7f34b5a83af2fe0ac 100644 (file)
@@ -6,35 +6,24 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 public class CollectorSelectionElement extends EntitySelectionElement<AgentBase> {
-       
-       Team collectorTeam;
-       /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param clazz
-     * @param labelString
-     * @param entity
-     * @param mode
-     * @param style
-     */
-    public CollectorSelectionElement(CdmFormFactory formFactory,// ConversationHolder conversation,
+
+       private Team collectorTeam;
+
+       public CollectorSelectionElement(CdmFormFactory formFactory,
             ICdmFormElement parentElement, String labelString, AgentBase entity, int mode, int style) {
-       super(formFactory, //conversation,
-        parentElement, AgentBase.class,
-        labelString, entity, mode, style);
+       super(formFactory,parentElement, AgentBase.class,
+               labelString, entity, mode, style);
     }
-    public CollectorSelectionElement(CdmFormFactory formFactory,// ConversationHolder conversation,
+
+       public CollectorSelectionElement(CdmFormFactory formFactory,
             ICdmFormElement parentElement, String labelString, AgentBase entity, Person primaryCollector, int mode, int style) {
-       super(formFactory, //conversation,
+       super(formFactory,
         parentElement, AgentBase.class,
         labelString, primaryCollector, mode, style);
        if (entity instanceof Team){
@@ -46,7 +35,7 @@ public class CollectorSelectionElement extends EntitySelectionElement<AgentBase>
     protected String getTitle() {
                if (entity != null){
                        if (entity instanceof TeamOrPersonBase){
-                               return ((TeamOrPersonBase)entity).getCollectorTitleCache();               
+                               return ((TeamOrPersonBase)entity).getCollectorTitleCache();
                        }else{
                                return entity.getTitleCache();
                        }
@@ -59,14 +48,15 @@ public class CollectorSelectionElement extends EntitySelectionElement<AgentBase>
        public void setCollectorTeam(Team collectorTeam) {
                this.collectorTeam = collectorTeam;
        }
-       
-       public void widgetSelected(SelectionEvent e) {
+
+       @Override
+    public void widgetSelected(SelectionEvent e) {
            if (e.getSource().equals(button_selection) ){
                AgentBase selection = null;
                if (this.collectorTeam != null){
                        selection = SelectionDialogFactory.getSelectionFromDialog(AgentBase.class, getShell(),
                                collectorTeam, this);
-               }else{          
+               }else{
                        selection = SelectionDialogFactory.getSelectionFromDialog(AgentBase.class, getShell(),
                        getEntity(), getParentElement());
                }
@@ -76,4 +66,4 @@ public class CollectorSelectionElement extends EntitySelectionElement<AgentBase>
             }
            }
        }
-}
+}
\ No newline at end of file
index 222d470b43925a7d66f8e3d1e1e6783cbc2fe8f3..6f1ada9e78cf83931770b600e6bb7c8603f04c69 100644 (file)
@@ -18,15 +18,14 @@ import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.api.service.IService;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.model.molecular.Amplification;
 import eu.etaxonomy.cdm.model.molecular.Primer;
@@ -36,6 +35,7 @@ import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
@@ -65,8 +65,9 @@ import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
  * @author n.hoffmann
  * @created Jun 1, 2010
  */
-public class EditFromSelectionWizard extends Wizard implements
-               SelectionListener, ICdmEntitySessionEnabled<CdmBase> {
+public class EditFromSelectionWizard
+        extends Wizard
+        implements SelectionListener, ICdmEntitySessionEnabled<CdmBase> {
 
     private ICdmEntitySession cdmEntitySession;
     private ICdmEntitySession previousCdmEntitySession;
@@ -99,30 +100,27 @@ public class EditFromSelectionWizard extends Wizard implements
                }
                if (rootElement.isInstanceOf(Reference.class)&& selectionElement instanceof EntitySelectionElementWithAbbreviatedTitle<?>) {
                        addPage(new ReferenceWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(),
                                        HibernateProxyHelper.deproxy(rootElement, Reference.class), true));
                } else if (rootElement.isInstanceOf(Reference.class) ) {
                        addPage(new ReferenceWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Reference.class), false));
+                                       HibernateProxyHelper.deproxy(rootElement, Reference.class), false));
                } else if (rootElement.isInstanceOf(Team.class) && (selectionElement instanceof EntitySelectionElementWithAbbreviatedTitle<?> )) {
                        addPage(new TeamWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Team.class), true, false));
+                                       HibernateProxyHelper.deproxy(rootElement, Team.class), true, false));
                } else if (rootElement.isInstanceOf(Team.class) && (selectionElement.getClass().equals(CollectorSelectionElement.class)) ){
                        addPage(new TeamWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Team.class), false, true));
+                                       HibernateProxyHelper.deproxy(rootElement, Team.class), false, true));
                } else if (rootElement.isInstanceOf(Team.class) && (selectionElement instanceof EntitySelectionElement<?>)) {
             addPage(new TeamWizardPage(formFactory,
-                    selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Team.class), false, false));
+                    HibernateProxyHelper.deproxy(rootElement, Team.class), false, false));
         } else if (rootElement.isInstanceOf(Person.class)) {
                        addPage(new PersonWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), HibernateProxyHelper.deproxy(rootElement, Person.class)));
+                                       HibernateProxyHelper.deproxy(rootElement, Person.class)));
                } else if (rootElement.isInstanceOf(TaxonName.class)) {
                        addPage(new NonViralNameWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(),
                                        HibernateProxyHelper.deproxy(rootElement, TaxonName.class)));
                } else if (rootElement.isInstanceOf(TaxonBase.class)) {
             addPage(new TaxonWizardPage(formFactory,
-                    selectionElement.getConversationHolder(),
                     HibernateProxyHelper.deproxy(rootElement, TaxonBase.class)));
         }  else if (rootElement.isInstanceOf(SpecimenOrObservationBase.class)) {
 
@@ -144,39 +142,29 @@ public class EditFromSelectionWizard extends Wizard implements
                                throw new IllegalStateException();
                        }
 
-                       addPage(new DerivedUnitGeneralWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), facade));
-                       addPage(new GatheringEventWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), facade));
-                       addPage(new FieldUnitWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(), facade));
+                       addPage(new DerivedUnitGeneralWizardPage(formFactory,facade));
+                       addPage(new GatheringEventWizardPage(formFactory, facade));
+                       addPage(new FieldUnitWizardPage(formFactory, facade));
                        if(facade.innerDerivedUnit()!=null){
-                           addPage(new DerivedUnitBaseWizardPage(formFactory,
-                                   selectionElement.getConversationHolder(), facade));
+                           addPage(new DerivedUnitBaseWizardPage(formFactory, facade));
                        }
                } else if (rootElement.isInstanceOf(Collection.class)) {
                        addPage(new CollectionWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(),
                                        HibernateProxyHelper.deproxy(rootElement, Collection.class)));
                } else if (rootElement instanceof Institution) {
                        addPage(new InstitutionWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(),
                                        HibernateProxyHelper.deproxy(rootElement, Institution.class)));
                } else if (rootElement instanceof User) {
                        addPage(new UserDetailWizardPage(formFactory,
-                                       selectionElement.getConversationHolder(),
                                        HibernateProxyHelper.deproxy(rootElement, User.class)));
                } else if (rootElement instanceof Primer) {
             addPage(new PrimerWizardPage(formFactory,
-                    selectionElement.getConversationHolder(),
                     HibernateProxyHelper.deproxy(rootElement, Primer.class)));
         } else if (rootElement instanceof Amplification) {
             addPage(new AmplificationGeneralWizardPage(formFactory,
-                    selectionElement.getConversationHolder(),
                     HibernateProxyHelper.deproxy(rootElement, Amplification.class)));
         } else if (rootElement instanceof PolytomousKey) {
             addPage(new PolytomousKeyWizardPage(formFactory,
-                    selectionElement.getConversationHolder(),
                     HibernateProxyHelper.deproxy(rootElement, PolytomousKey.class)));
         } else {
                        MessagingUtils.warningDialog("Missing interface", this,
index 5a39e8433f24f809fd9a1f087ad3fb763f25e230..9f3d0af945924b254b00fc4b19aba563e995e18d 100644 (file)
@@ -27,8 +27,6 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.TableWrapData;\r
 import org.springframework.security.core.GrantedAuthority;\r
 \r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
 import eu.etaxonomy.cdm.api.service.IService;\r
 import eu.etaxonomy.cdm.common.CdmUtils;\r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
@@ -392,7 +390,7 @@ public class EntitySelectionElement<T extends CdmBase>
                                //if the edited entity has already been persisted\r
                                //but the transient entity is still set in this\r
                                //EntitySelectionElement, re-load it and set it\r
-                               if(!entity.isPersited()){\r
+                               if(!entity.isPersisted()){\r
                                    IService<T> service = CdmStore.getService(entity);\r
                                        T loadedEntity = service.load(entity.getUuid());\r
                                        if(loadedEntity != null){\r
@@ -408,13 +406,7 @@ public class EntitySelectionElement<T extends CdmBase>
        public void widgetDefaultSelected(SelectionEvent e) {\r
        }\r
 \r
-//     @Override\r
-       public ConversationHolder getConversationHolder() {\r
-           if(getParentElement() instanceof IConversationEnabled) {\r
-            return ((IConversationEnabled)getParentElement()).getConversationHolder();\r
-        }\r
-           return null;\r
-       }\r
+\r
 \r
        @Override\r
        public void setBackground(Color color) {\r
index c9af42f85629874c4010fa1230608734130ed782..cbefec7f20da4f09dd3320d6de3e5121e1065f12 100644 (file)
@@ -1,6 +1,11 @@
 /**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
 package eu.etaxonomy.taxeditor.ui.selection;
 
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
@@ -11,19 +16,9 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 
 public class EntitySelectionElementWithAbbreviatedTitle<T extends CdmBase> extends EntitySelectionElement<T> {
 
-       /**
-     * @param formFactory
-     * @param conversation
-     * @param parentElement
-     * @param clazz
-     * @param labelString
-     * @param entity
-     * @param mode
-     * @param style
-     */
-    public EntitySelectionElementWithAbbreviatedTitle(CdmFormFactory formFactory,// ConversationHolder conversation,
+    public EntitySelectionElementWithAbbreviatedTitle(CdmFormFactory formFactory,
             ICdmFormElement parentElement, Class<T> clazz, String labelString, T entity, int mode, int style) {
-        super(formFactory, //conversation,
+        super(formFactory,
                 parentElement, clazz, labelString, entity, mode, style);
     }
 
@@ -42,4 +37,4 @@ public class EntitySelectionElementWithAbbreviatedTitle<T extends CdmBase> exten
                }
                return "";
        }
-}
+}
\ No newline at end of file
index 316c7fa6fdc108ab522073a92c9895c8f4527073..d593bbdf2e64b61a5df4ca76b33fa0195ac132b0 100644 (file)
@@ -29,7 +29,7 @@ public class TaxonNodeSelectionElement extends EntitySelectionElement<TaxonNode>
 
 
 
-       public TaxonNodeSelectionElement(CdmFormFactory formFactory,//ConversationHolder conversation,
+       public TaxonNodeSelectionElement(CdmFormFactory formFactory,
                ICdmFormElement parentElement,
                        String labelString, TaxonNode entity, int mode, int style, Integer limit) {
                super(formFactory, //conversation,
@@ -60,7 +60,7 @@ public class TaxonNodeSelectionElement extends EntitySelectionElement<TaxonNode>
        /** {@inheritDoc} */
        @Override
        public void widgetSelected(SelectionEvent e) {
-               TaxonNode newSelection = TaxonNodeSelectionDialog.select(getShell(),//getConversationHolder(),
+               TaxonNode newSelection = TaxonNodeSelectionDialog.select(getShell(),
                        "Select parent taxon", null, null, getClassification().getUuid());
                setSelectionInternal(newSelection);
        }
index 962b6b1318d312af497611440ce9bd03efc43f1d..b6f889b5f0f7c05dbc60f74d033e8d30f3c3aae4 100644 (file)
@@ -102,6 +102,8 @@ public class TermTranslationWizardPage extends WizardPage implements IPropertyCh
                if(preferredRepresentation != null){
                        text_source.setSelectedRepresentation(preferredRepresentation);
                }
+               text_source.setEnabled(false);
+               text_source.setLanguageComboEnabled(false);
         }
 
         private void createLeftControls(ICdmFormElement element){
@@ -110,14 +112,14 @@ public class TermTranslationWizardPage extends WizardPage implements IPropertyCh
                        preferredRepresentation = term.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage());
                        text_source = formFactory.createRepresentationElement(element, preferredRepresentation,term,  TEXT_HEIGHT,  SWT.NULL, true);
                 text_source.setTerm(term, true);
+                
                }else {
                        preferredRepresentation = termDto.getPreferredRepresentation(PreferencesUtil.getGlobalLanguage());
                        text_source = formFactory.createRepresentationElement(element, preferredRepresentation,termDto,  TEXT_HEIGHT,  SWT.NULL, true);
                 text_source.setTermDto(termDto, true);
                }
-
-            
-
+               text_source.setEnabled(false);
+               text_source.setEnabled(false);
         }
 
         private void createRightControls(ICdmFormElement element){
@@ -126,6 +128,7 @@ public class TermTranslationWizardPage extends WizardPage implements IPropertyCh
                }else {
                        text_target = formFactory.createRepresentationElement(element, null, termDto, TEXT_HEIGHT, SWT.NULL, false);
                }
+               text_target.setEnabled(false);
         }
 
         @Override
index 979670c2fea6fb90e263ff7366363e867c16643d..630ef417a4034dc6af4747731d2974f0aaf4bfb0 100644 (file)
@@ -61,6 +61,9 @@ public class TaxonTreeNodeLabelProvider
                         if (taxonNode.getStatus() != null){
                             text = taxonNode.getStatus().getSymbol() + " ";
                         }
+                        if (taxonNode.getTaxon() != null && !taxonNode.getTaxon().isPublish()) {
+                            text = text + "\\u20ac";
+                        }
                         text += taxon.getName() != null ? taxon.getName().getTitleCache() : "";
                         return text;
                     }catch(Exception e){
@@ -74,9 +77,13 @@ public class TaxonTreeNodeLabelProvider
         else if (element instanceof TaxonNodeDto){
             TaxonNodeDto taxonNode = (TaxonNodeDto) element;
             String text= "";
+            if (!taxonNode.isPublish() ) {
+                text = text + "\u26D4 ";
+            }
             if (taxonNode.getStatus() != null){
                 text = taxonNode.getStatus().getSymbol() + " ";
             }
+
             //TODO if symbols contain non-ASCII this may create problems
             //     if so we may use ASCII like text +=Character.toString((char)248) + " ";
 
@@ -116,4 +123,5 @@ public class TaxonTreeNodeLabelProvider
         }
         return notGrantedStyler;
     }
+
 }
\ No newline at end of file
index 7322133e74f26a6ba6c22717848b948a3771f130..a3ee36133f2fcc45b01d6faf4ecbf23e05cc0800 100644 (file)
@@ -26,7 +26,6 @@ import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.commands.ICommandService;
 
-import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.name.NomenclaturalSource;
@@ -34,6 +33,7 @@ import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.term.DefinedTermBase;
+import eu.etaxonomy.cdm.persistence.dto.DescriptionBaseDto;
 import eu.etaxonomy.cdm.persistence.dto.ReferencingObjectDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
index e32ac3a20563fdcc60326ddfa21ba762c3f34993..17a764ef08f2dc836e2fb6845c697432c9f22fd8 100644 (file)
@@ -10,11 +10,10 @@ package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.util.Collection;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * Input for {@link DataImportEditor}. This class queries a data source for
@@ -22,22 +21,16 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  *
  * @author pplitzner
  * @date 25.02.2014
- *
  */
 public abstract class DataImportEditorInput<T> {
 
-    protected static Logger logger = LogManager.getLogger(DataImportEditorInput.class);
+    protected static Logger logger = LogManager.getLogger();
 
     private Collection<T> results;
 
-    private final ConversationHolder conversationHolder;
 
     protected OccurenceQuery query;
 
-    public DataImportEditorInput() {
-        this.conversationHolder = CdmStore.createConversation();
-    }
-
     public Collection<T> getResults() {
         return results;
     }
@@ -46,10 +39,6 @@ public abstract class DataImportEditorInput<T> {
         this.results = results;
     }
 
-    public ConversationHolder getConversationHolder() {
-        return conversationHolder;
-    }
-
     @Override
     public abstract int hashCode();
 
index a37f910c16bb2dc24ecb638aae9330af079821ca..a50bdd12d094a8a9c76781f5b1d6d7d210993b23 100644 (file)
@@ -14,7 +14,8 @@ import java.util.Collection;
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.e4.ui.di.Focus;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
@@ -37,11 +38,7 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.databaseAdmin.wizard.ImportPreferencesWizard;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
@@ -52,15 +49,15 @@ import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
 
 /**
  * View which shows a list of "data" that can be imported into the CDM
+ *
  * @author pplitzner
  * @date 22.08.2017
  *
  * @param <T> the CDM type that will be handled by this view
  */
-public abstract class DataImportView<T> implements IPartContentHasFactualData,
-IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener, IEditorAreaPart{
+public abstract class DataImportView<T> implements IPartContentHasFactualData, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener, IEditorAreaPart{
 
-    protected final Logger logger = LogManager.getLogger(DataImportView.class);
+    protected final Logger logger = LogManager.getLogger();
 
     protected Collection<T> results = new ArrayList<>();
 
@@ -68,39 +65,16 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
     protected OccurenceQuery query;
 
-    private static ConversationHolder conversationHolder;
-
     private SaveImportedSpecimenAction saveImportedSpecimenAction;
 
-//    private Text textClassification;
-
-//    private Classification classification;
-
     protected Text textReferenceString;
 
     private Button selectAllButton;
-    //private Button selectNoneButton;
 
     private Button importButton;
 
     private boolean state;
 
-    private Button openConfigurator;
-
-    private Abcd206ImportConfigurator config;
-
-//    public Classification getClassification() {
-//             return classification;
-//     }
-//
-//     public void setClassification(Classification classification) {
-//             this.classification = classification;
-//     }
-
-       private Button btnBrowseClassification;
-
-       private Button btnClear;
-
     private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
 
     private Table table;
@@ -119,12 +93,7 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
      */
     @PostConstruct
     public void createPartControl(Composite parent) {
-        if(CdmStore.isActive()){
-            initConversation();
-        }
-        else{
-            return;
-        }
+
         parent.setLayout(new GridLayout(1, false));
         Composite composite = new Composite(parent, SWT.NONE);
         composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
@@ -192,7 +161,6 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
         CheckboxTableViewer checkboxTableViewer = CheckboxTableViewer.newCheckList(composite_2, SWT.BORDER | SWT.FULL_SELECTION);
 
-
         table = checkboxTableViewer.getTable();
         table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
         table.addListener(SWT.Selection, this);
@@ -301,11 +269,6 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
     public abstract void query();
 
-    @Override
-    public void update(CdmDataChangeMap changeEvents) {
-        //nothing
-    }
-
     /**
      * Returns the text label of the given item.
      * @param item the item for which the label should be returns
@@ -318,10 +281,6 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
         if(getTable()!=null){
             getTable().setFocus();
         }
-        //make sure to bind again if maybe in another view the conversation was unbound
-        if(getConversationHolder()!=null && !getConversationHolder().isBound()){
-            getConversationHolder().bind();
-        }
     }
 
     @Override
@@ -334,31 +293,11 @@ IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, I
 
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
-        initConversation();
-    }
 
-    private void initConversation(){
-        if(conversationHolder==null){
-            conversationHolder = CdmStore.createConversation();
-        }
     }
 
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
-        if(getConversationHolder()!=null && getConversationHolder().isBound() && !getConversationHolder().isClosed()) {
-            getConversationHolder().close();
-        }
-    }
-
-    /**
-     * @return the conversationHolder
-     */
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if(CdmStore.isActive() && conversationHolder==null){
-            initConversation();
-        }
-        return conversationHolder;
     }
 
     @Override
index fb5c210227db8b6cf2652311222b0c5254b7921b..8f94ed5305318a79eb99169ffd8efaa070c18d02 100644 (file)
@@ -27,17 +27,38 @@ public class GbifResponseImportView extends DataImportView<GbifResponse> {
 
     public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.e4.GbifResponseImportView";
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
-     */
     @Override
     protected String getTextForTableItem(GbifResponse item) {
-        String text = "";
-        if(item.getDataSetProtocol()!=null){
-            text += "["+item.getDataSetProtocol()+"] ";
+
+       String text = "";
+       String unitId = "";
+       if(item.getDataSetProtocol()!=null){
+          text += "["+item.getDataSetProtocol()+"] ";
+       }
+       if (item.getDerivedUnitFacade().getAccessionNumber() != null) {
+               unitId = item.getDerivedUnitFacade().getAccessionNumber();
+       }else if (item.getDerivedUnitFacade().getBarcode() != null) {
+               unitId = item.getDerivedUnitFacade().getBarcode();
+       }else {
+               unitId = item.getDerivedUnitFacade().getCatalogNumber();
+       }
+        if(item.getScientificName() != null){
+
+           text = item.getScientificName().getTitleCache();
         }
-        text += item.getDerivedUnitFacade().innerDerivedUnit().generateTitle();
-        return text;
+        //if (text != null){
+               String collectionCode = item.getDerivedUnitFacade().getCollection() != null ? " - " + item.getDerivedUnitFacade().getCollection().getCode(): "";
+            String kindOfUnit = item.getDerivedUnitFacade().getDerivedUnitKindOfUnit() != null ? " - " + item.getDerivedUnitFacade().getDerivedUnitKindOfUnit().toString():"";
+
+               return text + collectionCode +  unitId + kindOfUnit;
+        //}
+
+//        String text = "";
+//        if(item.getDataSetProtocol()!=null){
+//            text += "["+item.getDataSetProtocol()+"] ";
+//        }
+//        text += item.getDerivedUnitFacade().innerDerivedUnit().generateTitle();
+//        return text;
     }
 
     /* (non-Javadoc)
@@ -47,46 +68,15 @@ public class GbifResponseImportView extends DataImportView<GbifResponse> {
     public void query() {
         String errorMessage = "Could not execute query " + query;
         try{
-            //Collection<GbifResponse> results = new GbifQueryServiceWrapper().query(query);
-            //setResults(results);
-
-           // String errorMessage = "Could not execute query " + query;
-
-       //     Collection<SpecimenOrObservationBase<?>> results = new ArrayList<SpecimenOrObservationBase<?>>();
-                Collection<GbifResponse> results = new GbifQueryServiceWrapper().query(query);
-
-                setResults(results);
-
-
-//
-               // results = repo.getUnits();
-
-            } catch (ClientProtocolException e) {
-                logger.error(errorMessage, e);
-            } catch (IOException e) {
-                logger.error(errorMessage, e);
-            } catch (URISyntaxException e) {
-                               // TODO Auto-generated catch block
-                               e.printStackTrace();
-                       }
+            Collection<GbifResponse> results = new GbifQueryServiceWrapper().query(query);
+            setResults(results);
+        } catch (ClientProtocolException e) {
+               logger.error(errorMessage, e);
+        } catch (IOException e) {
+               logger.error(errorMessage, e);
+        } catch (URISyntaxException e) {
+               // TODO Auto-generated catch block
+                       e.printStackTrace();
         }
-
-//            setResults(results);
-//
-//        }
-//        } catch (ClientProtocolException e) {
-//            logger.error(errorMessage, e);
-//        } catch (IOException e) {
-//            logger.error(errorMessage, e);
-//        } catch (URISyntaxException e) {
-//            logger.error(errorMessage, e);
-//        }
-
-  //  }
-
-
-
-
-
-
+    }
 }
index 9f801df808cdf51b94f1dc8033522504d8540238..422c0188679ed67c588d7eeb28cb49a2a66f888c 100644 (file)
@@ -16,16 +16,12 @@ import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
 
 import eu.etaxonomy.cdm.common.URI;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
 import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseResponse;
-import eu.etaxonomy.cdm.ext.occurrence.gbif.DataSetResponse;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifDataSetProtocol;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.gbif.in.GbifImportConfigurator;
-import eu.etaxonomy.cdm.model.term.DefinedTermBase;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.dataimport.GbifResponseComparator;
@@ -84,7 +80,6 @@ public class SaveImportedSpecimenAction extends Action {
 
         Abcd206ImportConfigurator configuratorAbcd;
         List<Abcd206ImportConfigurator> abcdConfigurators = new ArrayList<>();
-        DataSetResponse dataSetResponse;
         OccurenceQuery bioCaseOccurrenceQuery = null;
         URI dataSetUri = null;
         for (BioCaseResponse response:checkedAbcdResults){
@@ -200,15 +195,6 @@ public class SaveImportedSpecimenAction extends Action {
         }
     }
 
-    private void persistTerm(DefinedTermBase<?> term, ITermService termService, ConversationHolder conversation){
-        if(term!=null){
-            //if the term does not exist in the DB save it
-            if(termService.find(term.getUuid())==null){
-                termService.saveOrUpdate(term);
-            }
-        }
-    }
-
     @Override
     public String getText() {
         return "Import";
index 8518ccdc8e8779eae386878631c4cea59f6ce366..b2bba93c6893670bf23418b72940d486e336eb0c 100644 (file)
@@ -189,7 +189,6 @@ public class SpecimenSearchWizard extends Wizard {
 
         @Override
         protected IStatus run(IProgressMonitor monitor) {
-            view.getConversationHolder().bind();
             view.query();
             Display.getDefault().asyncExec(new Runnable() {
 
index a94c375283e74454512bf568fea961a2d5e30a75..c549e99c1e1cda9331ad9fe0975b5ae9d8bb73c8 100644 (file)
@@ -10,13 +10,15 @@ package eu.etaxonomy.taxeditor.view.detail;
 
 import java.util.EventObject;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.forms.SectionPart;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
@@ -55,6 +57,7 @@ import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonDetailSection;
  */
 public class CdmSectionPart<T> extends SectionPart
         implements IPropertyChangeListener {
+    private static final Logger logger = LogManager.getLogger();
 
     public static String EXPANDED = "expanded";
     public static String COLLAPSED = "collapsed";
@@ -179,6 +182,36 @@ public class CdmSectionPart<T> extends SectionPart
                return true;
        }
 
+       public boolean setFormInputWithoutUpdate(Object input) {
+        if (formSection.isDisposed()){
+            return false;
+        }
+
+           this.rootInput = input;
+           //FIXME (CM): Need to fix this part of the design.
+           //The design seems to be locked to the idea that only one
+           // entity (either from the navigator or the editor) drives
+           // the detail view. In the case of multiple inputs the only workaround
+           // is checking the type and extracting relevant objects.
+               if (input instanceof IElementHasDetails) {
+                       input = ((IElementHasDetails) input).getData();
+               }
+
+               if ((input instanceof TaxonBase)
+                               && (formSection instanceof ITaxonBaseDetailSection )) {
+
+                       //if (!((TaxonBase<?>) input).getTitleCache().equals(((ITaxonBaseDetailSection) formSection).getTaxonBase().getTitleCache())) {
+                               ((ITaxonBaseDetailSection) formSection)
+                                       .setTaxonBaseWithoutUpdate((TaxonBase<?>) input);
+
+                       //}
+
+                       return true;
+               }
+               //actually only for Taxon Details...
+               return this.setFormInput( input);
+       }
+
        @Override
        public void propertyChange(PropertyChangeEvent event) {
                if (event != null) {
@@ -211,6 +244,10 @@ public class CdmSectionPart<T> extends SectionPart
        @Override
        protected void expansionStateChanged(boolean expanded) {
            super.expansionStateChanged(expanded);
-           PreferencesUtil.setStringValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput.getClass().getCanonicalName()), expanded?EXPANDED:COLLAPSED);
+           try {
+               PreferencesUtil.setStringValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput.getClass().getCanonicalName()), expanded?EXPANDED:COLLAPSED);
+           }catch (NullPointerException e) {
+               logger.error(e.getMessage());
+           }
        }
 }
\ No newline at end of file
index 19f81d003788bbfaea8db656a7ffc862e8d04421..1ada7b30bf174d549894021a3394442b3669e794 100644 (file)
@@ -6,14 +6,14 @@
 * 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.view.e4;
 
 import javax.inject.Inject;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
 import org.eclipse.e4.core.contexts.IEclipseContext;
-import org.eclipse.e4.core.services.log.Logger;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWTException;
@@ -24,8 +24,6 @@ import org.eclipse.ui.forms.IFormPart;
 import org.eclipse.ui.forms.ManagedForm;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -38,14 +36,12 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.EmptySection;
 import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
 
 /**
- *
  * @author pplitzner
  * @date 18.07.2017
- *
  */
-public abstract class AbstractCdmDataViewer extends Viewer implements IConversationEnabled{
-        @Inject
-        private Logger logger;
+public abstract class AbstractCdmDataViewer extends Viewer {
+
+       private static final Logger logger = LogManager.getLogger();
 
        protected ManagedForm managedForm;
 
@@ -67,7 +63,6 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
 
        @Inject
        public AbstractCdmDataViewer() {
-
        }
 
        public void init(Composite parent, IDirtyMarkable part) {
@@ -92,7 +87,6 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
                rootElement = new RootElement(formFactory, body);
        }
 
-
     protected void createEmptySection(String message, RootElement parent) {
         destroySections();
 
@@ -115,7 +109,7 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
                        formFactory.dispose();
                        formFactory = null;
                }
-               formFactory =  new CdmFormFactory(Display.getCurrent(), this);
+               formFactory = new CdmFormFactory(Display.getCurrent(), this);
                ContextInjectionFactory.inject(formFactory, context);
        }
 
@@ -162,6 +156,19 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
 
 //             managedForm.reflow(true);
        }
+       
+       
+       public void refresh_withoutnew_build() {
+               if(input!=null){
+                       IFormPart[] parts = managedForm.getParts();
+                       for (IFormPart part: parts) {
+                               if(part instanceof CdmSectionPart) {    
+                                       ((CdmSectionPart<?>)part).setFormInputWithoutUpdate(input);
+                               }
+                       }
+               }               
+
+       }
 
        public void layout(){
                body.layout();
@@ -185,7 +192,6 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
                         null,
                         e,
                         true);
-
             }
                }
 
@@ -236,10 +242,4 @@ public abstract class AbstractCdmDataViewer extends Viewer implements IConversat
                managedForm.addPart(sectionPart);
                formFactory.addPropertyChangeListener(sectionPart);
        }
-
-    @Override
-    public ConversationHolder getConversationHolder() {
-        return null;
-       }
-
-}
+}
\ No newline at end of file
similarity index 76%
rename from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
rename to eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPart.java
index 543b5179969e86494bf4c9d3bf81774b61e7a79a..983e4e229f5e1dcf5189b569d57746f787a552df 100644 (file)
@@ -15,7 +15,8 @@ import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Named;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.e4.core.di.annotations.Optional;
 import org.eclipse.e4.ui.di.PersistState;
@@ -31,13 +32,9 @@ import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWTException;
 import org.springframework.security.core.GrantedAuthority;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.api.service.ITermNodeService;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
@@ -45,7 +42,6 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.IBulkEditor;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
@@ -63,12 +59,13 @@ import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
  * @author pplitzner
  * @since Aug 10, 2017
  */
-public abstract class AbstractCdmEditorPartE4
-        implements IConversationEnabled, IDirtyMarkable, ISelectionElementEditingPart, IPostOperationEnabled{
+public abstract class AbstractCdmEditorPart<V extends Viewer>
+        implements IDirtyMarkable, ISelectionElementEditingPart, IPostOperationEnabled{
 
-       private static final Logger logger = LogManager.getLogger(AbstractCdmEditorPartE4.class);
+       private static final Logger logger = LogManager.getLogger();
 
        private DelaySelection delaySelection = null;
+
     /**
      * This is the monitor for the DelaySelection runnable.
      * If it is <code>true</code> then it is currently delaying a selection.
@@ -84,22 +81,65 @@ public abstract class AbstractCdmEditorPartE4
         private Object selection;
         private MPart activePart;
         private MPart thisPart;
+        private EPartService partService;
 
-        public DelaySelection(Object selection, MPart activePart, MPart thisPart) {
-            super();
+        public DelaySelection(Object selection, MPart activePart, MPart thisPart, EPartService partService) {
             this.selection = selection;
             this.activePart= activePart;
             this.thisPart = thisPart;
+            this.partService = partService;
         }
 
         @Override
         public void run() {
+
+            isInDelay = false;
+
+            //multiple selections are not supported
+            if(activePart != null
+                    && thisPart != null
+                    && !activePart.equals(thisPart)
+                    && selection instanceof IStructuredSelection
+                    && ((IStructuredSelection) selection).size()>1){
+                showEmptyPage();
+                return;
+            }
+
+            // no active editor found
+            if(activePart == thisPart && WorkbenchUtility.getActiveEditorPart(partService) == null && showEmptyIfNoActiveEditor()){
+                showEmptyPage();
+                return;
+            }
+
+            if (viewer != null && viewer.getControl()!= null && viewer.getInput() != null && !viewer.getControl().isDisposed()){
+               try{
+                   viewer.getControl().setEnabled(isEnabled);
+               }catch(SWTException e){
+                   System.out.println("...exception3 ("+ (thisPart == null? "":thisPart.getLabel()) + ")");
+                   logger.debug("Something went wrong for viewer.getControl().setEnabled(true) in " + this.getClass().getSimpleName(), e);
+               }
+            }
+
+            //same as previous selection? => return
+            if((previousSelection != null && selection != null)
+                    && (activePart != null && selectionProvidingPart != null
+                        && activePart.equals(selectionProvidingPart))
+                    && (previousSelection == selection
+                         || previousSelection.equals(selection)
+                         || new StructuredSelection(selection).equals(previousSelection))
+                     ) {
+                 return;
+            }
+
             try{
                 selectionChanged_internal(selection, activePart, thisPart);
+            }catch (Exception ex){
+                logger.error("Error during selectionChanged_internal", ex);
+                ex.printStackTrace();
             }
             finally{
-                isInDelay = false;
-            }
+                previousSelection = selection;
+             }
         }
 
         public synchronized void setSelection(Object selection) {
@@ -113,9 +153,13 @@ public abstract class AbstractCdmEditorPartE4
         public synchronized void setThisPart(MPart thisPart) {
             this.thisPart = thisPart;
         }
+
+        public synchronized void setThisPartService(EPartService partService) {
+            this.partService = partService;
+        }
     }
 
-    protected Viewer viewer;
+    protected V viewer;
 
     protected MPart thisPart;
 
@@ -146,53 +190,27 @@ public abstract class AbstractCdmEditorPartE4
             @Optional@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
             @Optional@Named(IServiceConstants.ACTIVE_PART)MPart activePart,
             MPart thisPart, UISynchronize sync, EPartService partService){
-        //multiple selections are not supported
-        if(activePart!=null
-                && thisPart!=null
-                && !activePart.equals(thisPart)
-                && selection instanceof IStructuredSelection
-                && ((IStructuredSelection) selection).size()>1){
-            showEmptyPage();
-            return;
-        }
-        // no active editor found
-        if(activePart==thisPart && WorkbenchUtility.getActiveEditorPart(partService)==null && showEmptyIfNoActiveEditor()){
-            showEmptyPage();
-            return;
-        }
-        if (viewer != null && viewer.getControl()!= null && viewer.getInput() != null && !viewer.getControl().isDisposed()){
-           try{
-               viewer.getControl().setEnabled(isEnabled);
-           }catch(SWTException e){
-              logger.debug("Something went wrong for viewer.getControl().setEnabled(true) in " + this.getClass().getSimpleName(), e);
-           }
-        }
 
-        if((previousSelection!=null && selection!=null)
-               && (activePart != null &&  selectionProvidingPart != null && activePart.equals(selectionProvidingPart))
-               && (previousSelection==selection
-                    || previousSelection.equals(selection)
-                    || new StructuredSelection(selection).equals(previousSelection))
-                ) {
-            return;
-        }
-        if(delaySelection==null){
-            delaySelection = new DelaySelection(selection, activePart, thisPart);
+        //set the delay selection which puts the change handling to the end
+        if(delaySelection == null){
+            delaySelection = new DelaySelection(selection, activePart, thisPart, partService);
         }else{
             delaySelection.setSelection(selection);
             delaySelection.setActivePart(activePart);
             delaySelection.setThisPart(thisPart);
+            delaySelection.setThisPartService(partService);
         }
+
+        //as long as the delay thread is running,
         if(!isInDelay){
-            isInDelay = true;
+               isInDelay = true;
             sync.asyncExec(delaySelection);
-            previousSelection = selection;
         }
     }
 
     @Override
     public void changed(Object object) {
-        if(selectionProvidingPart!=null){
+        if(selectionProvidingPart != null){
             Object part = selectionProvidingPart.getObject();
             if(part instanceof IDirtyMarkable){
                 ((IDirtyMarkable) part).changed(object);
@@ -200,10 +218,11 @@ public abstract class AbstractCdmEditorPartE4
             if (part instanceof IBulkEditor){
                ((IBulkEditor)part).setSelection(createSelection(object));
             }
+
         }
     }
 
-    public Viewer getViewer() {
+    public V getViewer() {
         return viewer;
     }
 
@@ -216,12 +235,12 @@ public abstract class AbstractCdmEditorPartE4
     }
 
     protected void showViewer(IStructuredSelection selection, MPart activePart, Viewer viewer){
-        if(CdmStore.getCurrentSessionManager().getActiveSession()==null){
+        if(CdmStore.getCurrentSessionManager().getActiveSession() == null){
             return;
         }
-        if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed()){
+        if(viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()){
             Object element = selection.getFirstElement();
-            Object part = createPartObject(activePart);
+            Object part = getPartObject(activePart);
             if (viewer.getControl().isDisposed()){
                 return;
             }
@@ -253,6 +272,7 @@ public abstract class AbstractCdmEditorPartE4
                             this.isEnabled = doEnable;
                         }
                     }
+
                     if (taxon.isMisapplication() || taxon.isProparteSynonym() ){
 
                         if(part instanceof ITaxonEditor){
@@ -280,7 +300,6 @@ public abstract class AbstractCdmEditorPartE4
                     element = CdmStore.getService(IVocabularyService.class).load(((TermVocabularyDto) element).getUuid());
                 }
 
-
                 selectionProvidingPart = activePart;
                 if (viewer instanceof DetailsViewerE4){
 
@@ -290,12 +309,10 @@ public abstract class AbstractCdmEditorPartE4
                         ((DetailsViewerE4)viewer).setDetailsEnabled(isEnabled);
                     }
                     ((DetailsViewerE4)viewer).setInput(element, part);
-                   
                 }
-
                 else{
                     if(element instanceof TermNodeDto){
-                        element = CdmStore.getService(ITermNodeService.class).load(((TermNodeDto) element).getUuid());
+                        //element = CdmStore.getService(ITermNodeService.class).load(((TermNodeDto) element).getUuid());
                     }
                     if (activePart.getObject() instanceof DetailsPartE4 && element instanceof TaxonName){
                         selectionProvidingPart = ((DetailsPartE4)activePart.getObject()).getSelectionProvidingPart();
@@ -306,13 +323,12 @@ public abstract class AbstractCdmEditorPartE4
                 }
             }
         }
-        
     }
 
-    protected Object createPartObject(MPart activePart) {
+    protected Object getPartObject(MPart activePart) {
         Object partObject = activePart;
         Object wrappedPart = WorkbenchUtility.getE4WrappedPart(activePart);
-        if(wrappedPart!=null){
+        if(wrappedPart != null){
             partObject = wrappedPart;
         }
         return partObject;
@@ -357,27 +373,28 @@ public abstract class AbstractCdmEditorPartE4
         return structuredSelection;
     }
 
-    @Override
-    public ConversationHolder getConversationHolder() {
-        if(selectionProvidingPart != null && selectionProvidingPart instanceof IConversationEnabled) {
-            return ((IConversationEnabled) selectionProvidingPart).getConversationHolder();
-        }
-        return null;
-    }
 
     @Override
     public boolean postOperation(Object objectAffectedByOperation) {
         changed(objectAffectedByOperation);
-//        Object part = selectionProvidingPart.getObject();
-//        if (part instanceof IBulkEditor){
-//             ((IBulkEditor)part).setSelection(createSelection(objectAffectedByOperation));
-//        }
         return true;
     }
 
     @Override
     public boolean onComplete() {
-        viewer.refresh();
+        try {
+            viewer.refresh();
+        }catch(SWTException e) {
+            if (PreferencesUtil.isShowUpWidgetIsDisposedMessages() && e.getMessage().equals("Widget is disposed")){
+                MessagingUtils.errorDialog("Widget is disposed",
+                        null,
+                        MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
+                        null,
+                        e,
+                       true);
+           }
+
+        }
         return true;
     }
 
@@ -402,10 +419,6 @@ public abstract class AbstractCdmEditorPartE4
 
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
-    }
-
     @Override
     public void forceDirty() {
     }
index e3fbf613ebcece2c96c21f5a85c90fff1e03aebb..39f99dc8354ebdcabc37987158d89b70cd23e0b7 100644 (file)
@@ -14,12 +14,14 @@ import javax.inject.Inject;
 import org.eclipse.e4.core.contexts.ContextInjectionFactory;
 import org.eclipse.e4.core.contexts.IEclipseContext;
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWTException;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
@@ -29,15 +31,15 @@ import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
-import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
 
 /**
  * @author pplitzner
  * @date 18.07.2017
  */
-public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartContentHasSupplementalData, IPartContentHasFactualData {
+public class DetailsPartE4 extends AbstractCdmEditorPart<DetailsViewerE4> implements IPartContentHasSupplementalData, IPartContentHasFactualData {
 
        @Inject
     public DetailsPartE4() {
@@ -49,7 +51,7 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
         this.thisPart = thisPart;
 
         viewer = ContextInjectionFactory.make(DetailsViewerE4.class, context);
-        ((DetailsViewerE4)viewer).init(parent, this);
+        viewer.init(parent, this);
 
         // Propagate selection from viewer
         selectionChangedListener = (event -> selService.setSelection(AbstractUtility.getElementsFromSelectionChangedEvent(event)));
@@ -58,28 +60,47 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
 
     @Override
     public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
-        if (activePart==thisPart){
-            return;
+       if (activePart == null) {
+               return;
+       }
+       
+        if (activePart == thisPart ){
+               if (this.getViewer().isNeedsRefresh()) {
+                       viewer.refresh();
+                       viewer.setNeedsRefresh(false);
+                       return;
+               }else {
+                       return;
+               }
         }
+        
+       
 
-        Object partObject = createPartObject(activePart);
+        Object partObject = getPartObject(activePart);
         if (partObject instanceof SupplementalDataPartE4 ) {
             // do not show empty page
             return;
         }
+        
+        if (partObject instanceof AbstractCdmEditorPart && ((AbstractCdmEditorPart)partObject).getViewer() instanceof TreeViewer ) {
+               //active part is factual data view or media view
+               IStructuredSelection structuredSelection = createSelection(selection);
+               if (structuredSelection != null && !structuredSelection.isEmpty()) {
+                       //if the active part is empty the selection is still the previous selection
+                       if (!(structuredSelection instanceof TreeSelection)) {
+                               return;
+                       }
+               }
+               
+           }
 
         if(partObject instanceof IPartContentHasDetails){
             IStructuredSelection structuredSelection = createSelection(selection);
-            if(structuredSelection==null || structuredSelection.isEmpty()){
-                showEmptyPage();
-                return;
-            }
-            if(!(partObject instanceof ISelectionElementEditingPart) &&
-                    partObject instanceof IConversationEnabled && ((IConversationEnabled) partObject).getConversationHolder()==null) {
-                //TODO show specific message (refactor EmptyElement to allow specific messages)
+            if(structuredSelection == null || structuredSelection.isEmpty()){
                 showEmptyPage();
                 return;
             }
+
             // do not show details for feature nodes TODO strange check to avoid having shown the distribution map for every FeatureNodeContainer
             if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
                 // do show the map for distributions
@@ -96,9 +117,7 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
             viewer.setSelection(structuredSelection, false);
 
             showViewer(structuredSelection, activePart, viewer);
-
-
-
+            viewer.setNeedsRefresh(false);
             return;
         }
         else{
@@ -108,15 +127,15 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
     }
 
     public void refreshSelection(){
-        selectionChanged_internal(new StructuredSelection(this.viewer.getInput()), selectionProvidingPart, thisPart);
+       this.viewer.refresh_withoutnew_build();
     }
 
     @Override
     protected void showEmptyPage() {
         super.showEmptyPage();
-        if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed() ){
+        if(viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed() ){
                try{
-                       ((DetailsViewerE4)viewer).destroySections();
+                       viewer.destroySections();
                }catch(SWTException e){
                        if (PreferencesUtil.isShowUpWidgetIsDisposedMessages() && e.getMessage().equals("Widget is disposed")){
                     MessagingUtils.errorDialog("Widget is disposed",
@@ -125,7 +144,6 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
                             null,
                             e,
                             true);
-
                 }
                }
         }
@@ -136,4 +154,4 @@ public class DetailsPartE4 extends AbstractCdmEditorPartE4 implements IPartConte
         return Messages.DetailsViewPart_VIEWER_NAME;
     }
 
-}
+}
\ No newline at end of file
index a1474bd1dd5c8fba1537caa14d240249ee3929fd..fc0cecca2cbc48e459e2ffd41d0347dc5648ce39 100755 (executable)
@@ -22,11 +22,12 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.swt.SWT;
+import org.eclipse.ui.forms.IFormPart;
 import org.springframework.security.core.GrantedAuthority;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
@@ -64,7 +65,6 @@ import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.IBulkEditor;
 import eu.etaxonomy.taxeditor.editor.IDistributionEditorPart;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
@@ -162,6 +162,8 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     private boolean detailsEnabled = true;
     private Object activePart;
 
+    private boolean needsRefresh = false;
+
     public boolean isDetailsEnabled() {
                return detailsEnabled;
        }
@@ -175,11 +177,17 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
         setInput(input);
 
     }
+
+       public boolean isNeedsRefresh() {
+               return needsRefresh;
+       }
+
+       public void setNeedsRefresh(boolean needsRefresh) {
+               this.needsRefresh = needsRefresh;
+       }
     // 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,
-
+    // editor and not derived unit facade objects,
     @Override
     public void setInput(Object input) {
 
@@ -208,8 +216,6 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input);
         }
         super.setInput(input);
-
-
     }
 
     @Override
@@ -405,6 +411,8 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             }
             else if(type.equals(TermType.Feature) || type.equals(TermType.Character)){
                 createFeatureNodeSection(rootElement);
+            }else {
+                createTermNodeSection(rootElement);
             }
 
         } else if (input instanceof TermTreeDto) {
@@ -434,8 +442,8 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             if (sel.getFirstElement()instanceof Distribution){
                 createDescriptionElementSection(rootElement);
             }
-
-//            createDescriptionElementSection(rootElement);
+        }else if (activePart instanceof IDistributionEditorPart && input instanceof HashSet) {
+            createEmptySection(Messages.More_than_one_distribution, rootElement);
 
         }else {
             createEmptySection(null, rootElement);
@@ -444,9 +452,9 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createGroupSection(RootElement parent) {
-        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GroupDetailSection.class, getInput().getClass().getCanonicalName()));
-        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(MemberDetailSection.class, getInput().getClass().getCanonicalName()));
-        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,StoreUtil.getSectionStyle(GrantedAuthorityDetailSection.class, getInput().getClass().getCanonicalName()));
+        GroupDetailSection groupDetailSection = formFactory.createGroupDetailSection(parent, this, StoreUtil.getSectionStyle(GroupDetailSection.class, getInput().getClass().getCanonicalName()));
+        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(parent, StoreUtil.getSectionStyle(MemberDetailSection.class, getInput().getClass().getCanonicalName()));
+        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(parent,StoreUtil.getSectionStyle(GrantedAuthorityDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(groupDetailSection);
         addPart(memberDetailSection);
@@ -509,10 +517,10 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             }
         }
         detailsEnabled = hasPermission;
-        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
+        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(parent, this,
                 StoreUtil.getSectionStyle(ParsingMessagesSection.class, getInput().getClass().getCanonicalName(), true));
         if (config == null){
-            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(parent, this,
                     StoreUtil.getSectionStyle(TaxonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
           //  boolean hasPermission = CdmStore.currentAuthentiationHasPermission(getInput(), Operation.UPDATE);
@@ -520,7 +528,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             addPart(taxonBaseDetailSection);
         }else{
             if (config.isTaxonSectionActivated()){
-                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(parent, this,
                         StoreUtil.getSectionStyle(TaxonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
                 taxonBaseDetailSection.setEnabled(detailsEnabled);
                 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -528,7 +536,6 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
             }
         }
         //TODO: test code for secundum source section
-//        SecundumSourceSection sourceSection = formFactory.createSecundumDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SecundumSourceSection.class, getInput().getClass().getCanonicalName(), true));
 //        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 //        addPart(sourceSection);
 //        if (taxonBase.getSecSource() == null){
@@ -543,12 +550,12 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 //             sourceSection.setEnabled(false);
 //        }
         NonViralNameDetailSection nonViralNameSection = formFactory
-                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
+                .createNonViralNameDetailSection(parent, this, true,
                         StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         nonViralNameSection.setEnabled(detailsEnabled);
         if (config == null || config.isNomenclaturalReferenceSectionActivated()){
-            NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+            NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(parent, this,
                     StoreUtil.getSectionStyle(NomenclaturalSourceDetailSection.class, getInput().getClass().getCanonicalName(), true));
             referenceDetailSection.setEnabled(detailsEnabled);
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
@@ -556,29 +563,22 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 
         }
         if ( config == null || config.isNomenclaturalStatusSectionActivated()){
-            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(parent,
                     StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
             nomenclaturalStatusSection.setEnabled(detailsEnabled);
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(nomenclaturalStatusSection);
         }
 
-//        if ( config == null || config.isProtologueActivated()){
-//            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
-//            protologSection.setEnabled(detailsEnabled);
-//            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//            addPart(protologSection);
-//        }
-
         if (config == null || config.isTypeDesignationSectionActivated()){
-            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
+            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
             typeDesignationSection.setEnabled(detailsEnabled);
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(typeDesignationSection);
         }
 
         if (config == null || config.isNameRelationsSectionActivated()){
-            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
+            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
             nameRelationshipSection.setEnabled(detailsEnabled);
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             addPart(nameRelationshipSection);
@@ -590,15 +590,15 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 
     private void createNameSections(RootElement parent) {
         NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
-                getConversationHolder(), parent, this, false, StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
+                parent, this, false, StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+        NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(parent, this,
                 StoreUtil.getSectionStyle(NomenclaturalSourceDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(parent,
                 StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -606,13 +606,10 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
         addPart(nomenclaturalStatusSection);
         addPart(referenceDetailSection);
 
-//        ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
-//        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
-        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
+        TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
+        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 //        addPart(protologSection);
         addPart(typeDesignationSection);
@@ -620,26 +617,26 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createReferenceSections(RootElement parent) {
-        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
+        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(parent, this,
                 StoreUtil.getSectionStyle(ReferenceDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(referenceDetailSection);
     }
 
     private void createTeamOrPersonBaseDetailSection(RootElement parent) {
-        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TeamOrPersonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(parent, this, StoreUtil.getSectionStyle(TeamOrPersonBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(teamOrPersonBaseDetailSection);
     }
 
     private void createTeamDetailSection(RootElement parent) {
-        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TeamDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(parent, StoreUtil.getSectionStyle(TeamDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(teamDetailSection);
     }
 
     private void createPersonDetailSection(RootElement parent) {
-        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(PersonDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(parent, StoreUtil.getSectionStyle(PersonDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(personDetailSection);
     }
 
@@ -648,19 +645,19 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createDescriptionElementSection(RootElement parent, Object activePart) {
-        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionElementDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DescriptionElementDetailSection descriptionElementDetailSection = formFactory.createDescriptionElementDetailSection(parent, this, StoreUtil.getSectionStyle(DescriptionElementDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
 
-        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(getConversationHolder(), parent,  getSectionStyle(.class, getInput().getClass().getCanonicalName()));
+        //  IntextReferenceSection intextReferenceSection = formFactory.createIntextReferenceSection(parent,  getSectionStyle(.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         DescriptionElementSourceSection descriptionElementSourceSection;
         if (activePart != null && activePart instanceof IDistributionEditorPart){
             Reference defaultSource =((IDistributionEditorPart)activePart).getEditor().getDefaultSource();
-            descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, defaultSource, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()));
+            descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(parent, defaultSource, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()));
 
         }else{
-            descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()) );
+            descriptionElementSourceSection = formFactory.createDescriptionElementSourceSection(parent, StoreUtil.getSectionStyle(DescriptionElementSourceSection.class, getInput().getClass().getCanonicalName()) );
             descriptionElementSourceSection.setEnabled(this.detailsEnabled);
 
         }
@@ -668,7 +665,8 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionElementMediaSection.class, getInput().getClass().getCanonicalName()));
+        DescriptionElementMediaSection descriptionElementMediaSection = formFactory.createDescriptionElementMediaSection(
+                parent, StoreUtil.getSectionStyle(DescriptionElementMediaSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -678,7 +676,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createDescriptionSection(RootElement parent, boolean isTaxonDescription, boolean isEnabled) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName(), true));
         descriptionDetailSection.setEnabled(isEnabled);
         addPart(descriptionDetailSection);
 
@@ -686,20 +684,20 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 
         if(isTaxonDescription) {
             NaturalLanguageSection naturalLanguageSection = formFactory.createNaturalLanguageSection(
-                    getConversationHolder(), parent, this, StoreUtil.getSectionStyle(NaturalLanguageSection.class, getInput().getClass().getCanonicalName(), true));
+                    parent, this, StoreUtil.getSectionStyle(NaturalLanguageSection.class, getInput().getClass().getCanonicalName(), true));
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
             naturalLanguageSection.setEnabled(isEnabled);
             addPart(naturalLanguageSection);
         }
         DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(
-                getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName(), true));
+                parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName(), true));
         descriptionSourceSection.setEnabled(isEnabled);
         addPart(descriptionSourceSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         if(isTaxonDescription) {
-            ScopeSection scopeSection = formFactory.createScopeSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ScopeSection.class, getInput().getClass().getCanonicalName()));
+            ScopeSection scopeSection = formFactory.createScopeSection(parent, StoreUtil.getSectionStyle(ScopeSection.class, getInput().getClass().getCanonicalName()));
             scopeSection.setEnabled(isEnabled);
             addPart(scopeSection);
         }
@@ -714,11 +712,11 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createUseDescriptionSection(RootElement parent) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName()));
+        DescriptionSourceSection descriptionSourceSection = formFactory.createDescriptionSourceSection(parent, StoreUtil.getSectionStyle(DescriptionSourceSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -727,19 +725,19 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createImageGallerySection(RootElement parent) {
-        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
+        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(parent, this, StoreUtil.getSectionStyle(DescriptionDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(descriptionDetailSection);
     }
 
     private void createMediaElementSection(RootElement parent) {
-        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(MediaDetailsSection.class, getInput().getClass().getCanonicalName(), true));
+        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(parent, this, StoreUtil.getSectionStyle(MediaDetailsSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(mediaDetailSection);
     }
 
     private void createDerivedUnitBaseElementSection(RootElement parent) {
-        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DerivedUnitGeneralDetailSection derivedUnitGeneralDetailSection = formFactory.createDerivedUnitGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(DerivedUnitGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         //TODO for DerivateEditor do not use facade anymore to avoid this special case handling #4539
         if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
             derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
@@ -748,91 +746,91 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(parent, this, StoreUtil.getSectionStyle(DerivedUnitBaseDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(derivedUnitBaseDetailSection);
 
         //for editors working with facades
         if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
+            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(gatheringEventDetailSection);
 
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            FieldUnitFacadeDetailSection fieldUnitDetailSection = formFactory.createFieldUnitFacadeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeDetailSection.class, getInput().getClass().getCanonicalName()));
+            FieldUnitFacadeDetailSection fieldUnitDetailSection = formFactory.createFieldUnitFacadeDetailSection(parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(fieldUnitDetailSection);
         }
         else{
 
             if(PreferencesUtil.isShowTaxonAssociations()){
                 formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TaxonAssociationDetailSection.class, getInput().getClass().getCanonicalName(), true));
+                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(parent, this, StoreUtil.getSectionStyle(TaxonAssociationDetailSection.class, getInput().getClass().getCanonicalName(), true));
                 addPart(taxonAssociationDetailSection);
             }
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DerivedUnitFacadeIdentifierSection.class, getInput().getClass().getCanonicalName()));
+            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(parent, StoreUtil.getSectionStyle(DerivedUnitFacadeIdentifierSection.class, getInput().getClass().getCanonicalName()));
             addPart(identifierDetailSection);
         }
         if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
+            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
             addPart(determinationDetailSection);
         }
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DerivedUnitTypeDesignationSection.class, getInput().getClass().getCanonicalName()));
+        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(parent, this, StoreUtil.getSectionStyle(DerivedUnitTypeDesignationSection.class, getInput().getClass().getCanonicalName()));
         addPart(derivedUnitTypeDesignationSection);
     }
 
     private void createFieldUnitFacadeSection(RootElement parent) {
-        FieldUnitFacadeGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitFacadeGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        FieldUnitFacadeGeneralDetailSection fielUnitGeneralDetailSection = formFactory.createFieldUnitFacadeGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
+        GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(parent, this, StoreUtil.getSectionStyle(GatheringEventDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        FieldUnitFacadeDetailSection fieldUnitDetailSection = formFactory.createFieldUnitFacadeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeDetailSection.class, getInput().getClass().getCanonicalName()));
+        FieldUnitFacadeDetailSection fieldUnitDetailSection = formFactory.createFieldUnitFacadeDetailSection(parent, this, StoreUtil.getSectionStyle(FieldUnitFacadeDetailSection.class, getInput().getClass().getCanonicalName()));
 
         addPart(fielUnitGeneralDetailSection);
         addPart(gatheringEventDetailSection);
         addPart(fieldUnitDetailSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
+        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
         addPart(determinationDetailSection);
     }
 
     private void createTissueSampleSection(RootElement parent) {
-        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TissueSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(TissueSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
         addPart(sampleDesignationDetailSection);
     }
 
     private void createDnaSampleSection(RootElement parent) {
-        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DnaSampleGeneralDetailSection section = formFactory.createDnaSampleGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(DnaSampleGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaSamplePreparationPreservationSection.class, getInput().getClass().getCanonicalName(), true));
+        DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(parent, this, StoreUtil.getSectionStyle(DnaSamplePreparationPreservationSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DnaQualityDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(parent, this, StoreUtil.getSectionStyle(DnaQualityDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         DeterminationDetailSection determinationDetailSection = null;
         if(!PreferencesUtil.isDeterminationOnlyForFieldUnits()){
-            determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
+            determinationDetailSection = formFactory.createDeterminationDetailSection(parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
         }
         addPart(section);
         addPart(preparationPreservationSection);
@@ -844,15 +842,15 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createSequenceSection(RootElement parent) {
-        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SequenceGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SequenceGeneralDetailSection section = formFactory.createSequenceGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(SequenceGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SequenceReferenceCollectionDetailSection referenceSection = formFactory.createSequenceReferenceCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SequenceReferenceCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SequenceReferenceCollectionDetailSection referenceSection = formFactory.createSequenceReferenceCollectionDetailSection(parent, StoreUtil.getSectionStyle(SequenceReferenceCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SequenceContigFileCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(parent, StoreUtil.getSectionStyle(SequenceContigFileCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
         addPart(referenceSection);
@@ -860,67 +858,71 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createSingleReadSection(RootElement parent) {
-        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SingleReadGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(SingleReadGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(section);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(SingleReadPherogramCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(parent, StoreUtil.getSectionStyle(SingleReadPherogramCollectionDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(pherogramSection);
     }
 
     private void createMediaSpecimenSection(RootElement parent) {
-        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(MediaSpecimenGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(parent, this, StoreUtil.getSectionStyle(MediaSpecimenGeneralDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(generalSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(RightsSection.class, getInput().getClass().getCanonicalName()));
+        RightsSection rightsSection = formFactory.createRightsSection(parent, StoreUtil.getSectionStyle(RightsSection.class, getInput().getClass().getCanonicalName()));
 //        rightsSection.setEntity(generalSection.getEntity().innerDerivedUnit());
         addPart(rightsSection);
     }
 
     private void createFeatureTreeSectionForDto(RootElement parent) {
-        TermTreeDetailSection section = formFactory.createFeatureTreeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TermTreeDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TermTreeDetailSection section = formFactory.createFeatureTreeDetailSection(parent, this, StoreUtil.getSectionStyle(TermTreeDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(section);
     }
     private void createFeatureTreeSection(RootElement parent) {
-        TermTreeDetailSectionForNode section = formFactory.createFeatureTreeDetailSectionForTree(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TermTreeDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TermTreeDetailSectionForNode section = formFactory.createFeatureTreeDetailSectionForTree(parent, this, StoreUtil.getSectionStyle(TermTreeDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(section);
     }
 
     private void createFeatureNodeSection(RootElement parent) {
-        TermNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TermNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TermNodeDetailSection featureDistributionSection = formFactory.createFeatureNodeDetailSection(parent, this, StoreUtil.getSectionStyle(TermNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        addPart(featureDistributionSection);
+    }
+    private void createTermNodeSection(RootElement parent) {
+        TermNodeDetailSection featureDistributionSection = formFactory.createTermNodeDetailSection(parent, this, StoreUtil.getSectionStyle(TermNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(featureDistributionSection);
     }
 
     private void createFeatureDistributionSection(RootElement parent) {
-        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(FeatureDistributionDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(parent, this, StoreUtil.getSectionStyle(FeatureDistributionDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(featureDistributionSection);
     }
 
     private void createCharacterNodeSection(RootElement parent) {
-        CharacterNodeDetailSection featureDistributionSection = formFactory.createCharacterNodeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        CharacterNodeDetailSection featureDistributionSection = formFactory.createCharacterNodeDetailSection(parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(featureDistributionSection);
     }
 
     private void createCharacterNodeDtoSection(RootElement parent) {
-        CharacterNodeDtoDetailSection featureDistributionSection = formFactory.createCharacterNodeDtoDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        CharacterNodeDtoDetailSection featureDistributionSection = formFactory.createCharacterNodeDtoDetailSection(parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(featureDistributionSection);
     }
 
     private void createCharacterSection(RootElement parent) {
-        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        CharacterDetailSection featureDistributionSection = formFactory.createCharacterDetailSection(parent, this, StoreUtil.getSectionStyle(CharacterDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(featureDistributionSection);
     }
 
     private void createPolytomousKeyNodeSection(RootElement parent) {
-        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(PolytomousKeyDetailSection.class, getInput().getClass().getCanonicalName()));
+        PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(parent, this, StoreUtil.getSectionStyle(PolytomousKeyDetailSection.class, getInput().getClass().getCanonicalName()));
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(PolytomousKeyNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(parent, this, StoreUtil.getSectionStyle(PolytomousKeyNodeDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(polytomousKeyDetailSection);
         addPart(polytomousKeyNodeDetailSection);
@@ -928,88 +930,99 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     }
 
     private void createUseRecordSection(RootElement parent) {
-        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(getConversationHolder(), parent, this,StoreUtil.getSectionStyle(UseRecordDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        UseRecordDetailSection descriptionUseRecordSection = formFactory.createUseRecordDetailSection(parent, this,StoreUtil.getSectionStyle(UseRecordDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(descriptionUseRecordSection);
     }
 
     private void createUserSection(RootElement parent) {
-        UserDetailSection userDetailSection = formFactory.createUserDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(UserDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        UserDetailSection userDetailSection = formFactory.createUserDetailSection(parent, this, StoreUtil.getSectionStyle(UserDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
-        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(GroupsByUserDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(parent, StoreUtil.getSectionStyle(GroupsByUserDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
         addPart(userDetailSection);
         addPart(groupByUserDetailSection);
     }
 
     private void createMisappliedNameSection(RootElement parent) {
-        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this,
+        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(parent, this,
                 StoreUtil.getSectionStyle(TaxonRelationshipDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(taxonRelationshipDetailSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         NonViralNameDetailSection nonViralNameSection = formFactory
-                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
+                .createNonViralNameDetailSection(parent, this, true,
                         StoreUtil.getSectionStyle(NonViralNameDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(nonViralNameSection);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
-        NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+        NomenclaturalSourceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(parent, this,
                 StoreUtil.getSectionStyle(NomenclaturalSourceDetailSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(referenceDetailSection);
 
-        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+        NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(parent,
                        StoreUtil.getSectionStyle(NomenclaturalStatusSection.class, getInput().getClass().getCanonicalName(), true));
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(nomenclaturalStatusSection);
 
-//             ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(ProtologueSection.class, getInput().getClass().getCanonicalName()));
-//             formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-//             addPart(protologSection);
-
-               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(parent, StoreUtil.getSectionStyle(TypeDesignationSection.class, getInput().getClass().getCanonicalName()));
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                addPart(typeDesignationSection);
 
-               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(parent, StoreUtil.getSectionStyle(NameRelationshipDetailSection.class, getInput().getClass().getCanonicalName()));
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
                addPart(nameRelationshipSection);
     }
 
     private void createTaxonRelationshipSection(RootElement parent) {
-        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TaxonRelationshipDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(parent, this, StoreUtil.getSectionStyle(TaxonRelationshipDetailSection.class, getInput().getClass().getCanonicalName(), true));
 
-        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(ReferencedEntityDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(parent, this, StoreUtil.getSectionStyle(ReferencedEntityDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(taxonRelationshipDetailSection);
         addPart(referencedEntityBaseDetailSection);
     }
     private void createTermVocabularySection(RootElement parent) {
-        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(TermVocabularyDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(parent, this, StoreUtil.getSectionStyle(TermVocabularyDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(termVocabularyDetailSection);
     }
 
     private void createDefinedTermSection(RootElement parent) {
-        DefinedTermDetailSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        DefinedTermDetailSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), parent, this, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(definedTermDetailSection);
-        TermMediaSection termMediaSection = formFactory.createTermMediaSection(getConversationHolder(), parent, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
+        TermMediaSection termMediaSection = formFactory.createTermMediaSection(parent, StoreUtil.getSectionStyle(DefinedTermDetailSection.class, getInput().getClass().getCanonicalName(), true));
         addPart(termMediaSection);
     }
 
-    @Override
-    public void update(CdmDataChangeMap arg0) {
 
-    }
     @Inject
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DETAILS)boolean refresh){
         if(refresh){
-            refresh();
+               //refresh_withoutnew_build(); this would use the update without creation of all fields
+               if (needsRefresh) {
+                       refresh();
+               }
+               this.needsRefresh = false;
         }
     }
 
+    @Inject
+    @Optional
+    private void needsRefresh(@UIEventTopic(WorkbenchEventConstants.NEED_REFRESH_DETAILS)boolean enable){
+       for (IFormPart part :this.managedForm.getParts()) {
+          if (part instanceof CdmSectionPart) {
+                  ((CdmSectionPart)part).getSection().setEnabled(enable);
+                  this.setNeedsRefresh(!enable);
+
+          }
+       }
+
+
+    }
+
     @Inject
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DETAILS_DISTRIBUTION)String nameCache){
@@ -1027,4 +1040,6 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
            }
         }
     }
+
+
 }
\ No newline at end of file
index 6c066be0eacd4f52bc8e9598b89d46f3ec0213c8..79a0e87a94961d07446d03df3ca0a1fff4f0e9d6 100644 (file)
@@ -24,165 +24,171 @@ import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.swt.SWTException;
 import org.eclipse.swt.widgets.Composite;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
+import eu.etaxonomy.cdm.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.term.TermBase;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
 import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermBasePropertyTester;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
+import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
 
 /**
  * @author pplitzner
  * @since Aug 10, 2017
  */
-public class SupplementalDataPartE4 extends AbstractCdmEditorPartE4 {
+public class SupplementalDataPartE4 extends AbstractCdmEditorPart<SupplementalDataViewerE4> {
 
-       @Inject
-    public SupplementalDataPartE4() {}
+    @Inject
+    public SupplementalDataPartE4() {
+    }
 
-       @PostConstruct
-       public void create(Composite parent, MPart thisPart, IEclipseContext context) {
+    @PostConstruct
+    public void create(Composite parent, MPart thisPart, IEclipseContext context) {
 
-           this.thisPart = thisPart;
+        this.thisPart = thisPart;
 
-           viewer = ContextInjectionFactory.make(SupplementalDataViewerE4.class, context);
-           ((SupplementalDataViewerE4)viewer).init(parent, this);
-       }
+        viewer = ContextInjectionFactory.make(SupplementalDataViewerE4.class, context);
+        viewer.init(parent, this);
+    }
 
     @Override
     public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
-           if(activePart==thisPart){
-               return;
-           }
-//         setEnabled(true);
-        Object partObject = createPartObject(activePart);
-
-           if(partObject instanceof IPartContentHasSupplementalData) {
-               setEnabled(true);
-
-               IStructuredSelection structuredSelection = createSelection(selection);
-               if(structuredSelection==null || structuredSelection.isEmpty()){
-                   showEmptyPage();
-                   return;
-               }
-               if(structuredSelection.size() != 1){
-                   showEmptyPage();
-                   return;
-               }
-               if (partObject instanceof ITaxonEditor && structuredSelection.getFirstElement() instanceof Taxon ){
-                   if (((ITaxonEditor)partObject).getTaxon() != structuredSelection.getFirstElement() && ((Taxon)structuredSelection.getFirstElement()).isMisapplication()){
-                       Set<TaxonRelationship> rels =((Taxon)structuredSelection.getFirstElement()).getTaxonRelations(((ITaxonEditor)partObject).getTaxon());
-                       if (rels != null && rels.size() == 1){
-                           structuredSelection = new StructuredSelection(rels.iterator().next());
-                       }else{
-                           showEmptyPage();
-                           return;
-                       }
-                   }
-               }
-               // do not show supplemental data for feature nodes
-               if(structuredSelection.getFirstElement() instanceof FeatureNodeContainer){
-                   showEmptyPage();
-                   return;
-               }
-
-               else if(structuredSelection.getFirstElement() instanceof DerivedUnitFacade){
-                   return;
-               }
-               else if(structuredSelection.getFirstElement() instanceof PolytomousKeyNode){
-                   structuredSelection = new StructuredSelection(((PolytomousKeyNode)structuredSelection.getFirstElement()).getKey());
-               }
-               else if(structuredSelection.getFirstElement() instanceof TreeNode){
-                   structuredSelection = new StructuredSelection(((TreeNode)structuredSelection.getFirstElement()).getValue());
-               }
-               else if(structuredSelection.getFirstElement() instanceof GbifResponse){
-                   structuredSelection = new StructuredSelection(((GbifResponse)structuredSelection.getFirstElement()).getDerivedUnitFacade().innerDerivedUnit());
-               }
-               else if(structuredSelection.getFirstElement() instanceof DescriptionElementBase ){
-                   structuredSelection = new StructuredSelection((structuredSelection.getFirstElement()));
-
-                   if (((DescriptionElementBase)structuredSelection.getFirstElement()).getInDescription() != null && (((DescriptionElementBase)structuredSelection.getFirstElement()).getInDescription().isComputed() || ((DescriptionElementBase)structuredSelection.getFirstElement()).getInDescription().isCloneForSource())){
-                    if (PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+        if (activePart == thisPart) {
+            return;
+        }
+        // setEnabled(true);
+        Object partObject = getPartObject(activePart);
+
+        if (partObject instanceof IPartContentHasSupplementalData) {
+            setEnabled(true);
+
+            IStructuredSelection structuredSelection = createSelection(selection);
+            if (structuredSelection == null || structuredSelection.isEmpty()) {
+                showEmptyPage();
+                return;
+            }
+            if (structuredSelection.size() != 1) {
+                showEmptyPage();
+                return;
+            }
+            if (partObject instanceof ITaxonEditor && structuredSelection.getFirstElement() instanceof Taxon) {
+                if (((ITaxonEditor) partObject).getTaxon() != structuredSelection.getFirstElement()
+                        && ((Taxon) structuredSelection.getFirstElement()).isMisapplication()) {
+                    Set<TaxonRelationship> rels = ((Taxon) structuredSelection.getFirstElement())
+                            .getTaxonRelations(((ITaxonEditor) partObject).getTaxon());
+                    if (rels != null && rels.size() == 1) {
+                        structuredSelection = new StructuredSelection(rels.iterator().next());
+                    } else {
+                        showEmptyPage();
+                        return;
+                    }
+                }
+            }
+            // do not show supplemental data for feature nodes
+            if (structuredSelection.getFirstElement() instanceof FeatureNodeContainer) {
+                showEmptyPage();
+                return;
+            }
+
+            else if (structuredSelection.getFirstElement() instanceof DerivedUnitFacade) {
+                return;
+            } else if (structuredSelection.getFirstElement() instanceof PolytomousKeyNode) {
+                structuredSelection = new StructuredSelection(
+                        ((PolytomousKeyNode) structuredSelection.getFirstElement()).getKey());
+            } else if (structuredSelection.getFirstElement() instanceof TreeNode) {
+                structuredSelection = new StructuredSelection(
+                        ((TreeNode) structuredSelection.getFirstElement()).getValue());
+            } else if (structuredSelection.getFirstElement() instanceof GbifResponse) {
+                structuredSelection = new StructuredSelection(((GbifResponse) structuredSelection.getFirstElement())
+                        .getDerivedUnitFacade().innerDerivedUnit());
+            } else if (structuredSelection.getFirstElement() instanceof DescriptionElementBase) {
+                structuredSelection = new StructuredSelection((structuredSelection.getFirstElement()));
+
+                if (((DescriptionElementBase) structuredSelection.getFirstElement()).getInDescription() != null
+                        && (((DescriptionElementBase) structuredSelection.getFirstElement()).getInDescription()
+                                .isComputed()
+                                || ((DescriptionElementBase) structuredSelection.getFirstElement()).getInDescription()
+                                        .isCloneForSource())) {
+                    if (PreferencesUtil.isComputedDesciptionHandlingDisabled()) {
                         setEnabled(false);
-                    }else{
+                    } else {
                         setEnabled(true);
                     }
                 }
-            }
-               else if(structuredSelection.getFirstElement() instanceof DescriptionBase ){
+            } else if (structuredSelection.getFirstElement() instanceof DescriptionBase) {
 
-                if (((DescriptionBase<?>)structuredSelection.getFirstElement()).isComputed() || ((DescriptionBase<?>)structuredSelection.getFirstElement()).isCloneForSource()){
-                    if (PreferencesUtil.isComputedDesciptionHandlingDisabled()){
+                if (((DescriptionBase<?>) structuredSelection.getFirstElement()).isComputed()
+                        || ((DescriptionBase<?>) structuredSelection.getFirstElement()).isCloneForSource()) {
+                    if (PreferencesUtil.isComputedDesciptionHandlingDisabled()) {
                         setEnabled(false);
-                    }else{
+                    } else {
                         setEnabled(true);
                     }
                 }
+            } else if (structuredSelection.getFirstElement() instanceof TermDto
+                    || structuredSelection.getFirstElement() instanceof TermVocabularyDto
+                    || structuredSelection.getFirstElement() instanceof TermNodeDto) {
+                showViewer(structuredSelection, activePart, viewer);
+                setEnabled(TermBasePropertyTester.isModifiable(structuredSelection.getFirstElement()));
+                viewer.setEnabled(isEnabled());
+                return;
+            }
+
+            if (!(structuredSelection.getFirstElement() instanceof ICdmBase)) {
+                showEmptyPage();
+                return;
+            }
+            if (structuredSelection.getFirstElement() instanceof TermBase) {
+                setEnabled(TermBasePropertyTester.isModifiable(structuredSelection.getFirstElement()));
             }
-               else if(structuredSelection.getFirstElement() instanceof TermDto
-                       || structuredSelection.getFirstElement() instanceof TermVocabularyDto
-                       || structuredSelection.getFirstElement() instanceof TermNodeDto){
-                   showViewer(structuredSelection, activePart, viewer);
-                   return;
-               }
-
-
-               if(!(structuredSelection.getFirstElement() instanceof ICdmBase)){
-                   showEmptyPage();
-                   return;
-               }
-               showViewer(structuredSelection, activePart, viewer);
-               ((SupplementalDataViewerE4)viewer).setEnabled(isEnabled());
-
-               return;
-           }
-        else{
-               showEmptyPage();
-               return;
-           }
-       }
+            showViewer(structuredSelection, activePart, viewer);
+            viewer.setEnabled(isEnabled());
+
+            return;
+        } else {
+            showEmptyPage();
+            return;
+        }
+    }
 
     @Override
     protected void showEmptyPage() {
         super.showEmptyPage();
-        if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed()){
-               try{
-                       ((SupplementalDataViewerE4)viewer).destroySections();
-               }catch (SWTException e){
-                       if (PreferencesUtil.isShowUpWidgetIsDisposedMessages() && e.getMessage().equals("Widget is disposed")){
-                    MessagingUtils.errorDialog("Widget is disposed",
-                            null,
-                            MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
-                            null,
-                            e,
-                            true);
+        if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
+            try {
+                viewer.destroySections();
+            } catch (SWTException e) {
+                if (PreferencesUtil.isShowUpWidgetIsDisposedMessages() && e.getMessage().equals("Widget is disposed")) {
+                    MessagingUtils.errorDialog("Widget is disposed", null, MessagingUtils.WIDGET_IS_DISPOSED_MESSAGE,
+                            null, e, true);
                 }
-               }
+            }
         }
     }
 
-       @Override
+    @Override
     protected String getViewName() {
-               return Messages.SupplementalDataViewPart_VIEWER_NAME;
-       }
+        return Messages.SupplementalDataViewPart_VIEWER_NAME;
+    }
 
-       @Inject
+    @Inject
     @Optional
-    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL)boolean refresh){
-        if(refresh){
+    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL) boolean refresh) {
+        if (refresh) {
             viewer.refresh();
         }
     }
index defa1844362984b67ea5fea68947b9dd53bcd5de..23c45bd6fd1836530f127f03fb54b64db5c62af2 100644 (file)
@@ -25,18 +25,22 @@ import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
 import eu.etaxonomy.cdm.model.reference.ISourceable;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.cdm.persistence.dto.IAnnotatableDto;
 import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.section.media.MediaSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CdmBaseSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.CreditSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.ExtensionSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.HeadlineSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerDtoSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.MarkerSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
 import eu.etaxonomy.taxeditor.ui.section.supplemental.SourceSection;
@@ -78,11 +82,18 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
                destroySections();
 
                //1. Headline
-               createHeadlineSection(rootElement);
+               if (input instanceof IAnnotatableDto) {
+                   createHeadlineDtoSection(rootElement);
+               }else {
+                   createHeadlineSection(rootElement);
+               }
                //2. Annotatable entitiy
-               if(input instanceof AnnotatableEntity){
+               if(input instanceof AnnotatableEntity ){
                                createAnnotationSections(rootElement);
                }
+               if(input instanceof IAnnotatableDto ){
+            createAnnotationDtoSections(rootElement);
+               }
                //3. Identifiable entity
                if(input instanceof IdentifiableEntity){
                        createIdentifiableSections(rootElement);
@@ -104,8 +115,12 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
                                createVersionSection(rootElement);
                }
                //6. CdmBase
-               if(showDebug){
-                       createCdmBaseSection(rootElement);
+               if(showDebug ){
+                   if (input instanceof IAnnotatableDto) {
+                       createCdmBaseDtoSection(rootElement);
+                   }else {
+                       createCdmBaseSection(rootElement);
+                   }
                }
 
                layout();
@@ -116,20 +131,25 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
                addPart(headlineSection);
        }
 
+       private void createHeadlineDtoSection(RootElement parent){
+        HeadlineDtoSection headlineSection = formFactory.createHeadlineDtoSection(parent);
+        addPart(headlineSection);
+    }
+
        private void createSourceSection(RootElement parent){
            int expandStyle = StoreUtil.getSectionStyle(SourceSection.class, getInput().getClass().getCanonicalName(), false);
-        SourceSection sourceSection =  formFactory.createSourceSection(getConversationHolder(), parent, expandStyle);
+        SourceSection sourceSection =  formFactory.createSourceSection(parent, expandStyle);
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         addPart(sourceSection);
     }
 
     private void createAnnotationSections(RootElement parent) {
         int expandStyle = StoreUtil.getSectionStyle(AnnotationSection.class, getInput().getClass().getCanonicalName(), false);
-        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), parent, expandStyle);
+        AnnotationSection annotationSection = formFactory.createAnnotationSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         expandStyle = StoreUtil.getSectionStyle(MarkerSection.class, getInput().getClass().getCanonicalName(), false);
-        MarkerSection markerSection = formFactory.createMarkerSection(getConversationHolder(), parent, expandStyle);
+        MarkerSection markerSection = formFactory.createMarkerSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -138,25 +158,39 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
 
     }
 
+    private void createAnnotationDtoSections(RootElement parent) {
+        int expandStyle = StoreUtil.getSectionStyle(AnnotationSection.class, getInput().getClass().getCanonicalName(), false);
+        AnnotationDtoSection annotationSection = formFactory.createAnnotationDtoSection(parent, expandStyle);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        expandStyle = StoreUtil.getSectionStyle(MarkerSection.class, getInput().getClass().getCanonicalName(), false);
+        MarkerDtoSection markerSection = formFactory.createMarkerDtoSection(parent, expandStyle);
+
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+        addPart(annotationSection);
+        addPart(markerSection);
+
+    }
     private void createIdentifiableSections(RootElement parent) {
         int expandStyle = StoreUtil.getSectionStyle(SourceSection.class, getInput().getClass().getCanonicalName(), false);
-        SourceSection sourceSection = formFactory.createSourceSection(getConversationHolder(), parent, expandStyle);
+        SourceSection sourceSection = formFactory.createSourceSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         expandStyle =  StoreUtil.getSectionStyle(IdentifierSection.class, getInput().getClass().getCanonicalName(), false);
-        IdentifierSection identifierSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, expandStyle);
+        IdentifierSection identifierSection = formFactory.createIdentifierDetailSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         expandStyle =  StoreUtil.getSectionStyle(ExtensionSection.class, getInput().getClass().getCanonicalName(), false);
-        ExtensionSection extensionSection = formFactory.createExtensionSection(getConversationHolder(), parent, expandStyle);
+        ExtensionSection extensionSection = formFactory.createExtensionSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         expandStyle =  StoreUtil.getSectionStyle(CreditSection.class, getInput().getClass().getCanonicalName(), false);
-        CreditSection creditSection = formFactory.createCreditSection(getConversationHolder(), parent, expandStyle);
+        CreditSection creditSection = formFactory.createCreditSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
         expandStyle =  StoreUtil.getSectionStyle(RightsSection.class, getInput().getClass().getCanonicalName(), false);
-        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, expandStyle);
+        RightsSection rightsSection = formFactory.createRightsSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
@@ -170,14 +204,14 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
 
     private void createIdentifiableMediaSections(RootElement parent) {
         int expandStyle = StoreUtil.getSectionStyle(MediaSection.class, getInput().getClass().getCanonicalName(), false);
-        MediaSection mediaSection = formFactory.createMediaSection(getConversationHolder(), parent, expandStyle);
+        MediaSection mediaSection = formFactory.createMediaSection(parent, expandStyle);
 
         formFactory.createHorizontalSeparator(parent, SWT.BORDER);
 
         addPart(mediaSection);
     }
 
-  
+
        private void createVersionSection(RootElement parent){
                VersionSection versionSection = formFactory.createVersionSection(parent, ExpandableComposite.NO_TITLE);
                addPart(versionSection);
@@ -188,9 +222,10 @@ public class SupplementalDataViewerE4 extends AbstractCdmDataViewer {
                addPart(cdmBaseSection);
        }
 
-       @Override
-       public void update(CdmDataChangeMap arg0) {
-       }
+       private void createCdmBaseDtoSection(RootElement parent) {
+        CdmBaseDtoSection cdmBaseSection = formFactory.createCdmBaseDtoSection(parent, ExpandableComposite.NO_TITLE);
+        addPart(cdmBaseSection);
+    }
 
        @Inject
     @Optional
@@ -6,8 +6,7 @@
 * 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.editor.view.checklist;
+package eu.etaxonomy.taxeditor.view.remoteserver;
 
 import java.util.List;
 
@@ -15,22 +14,19 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
 /**
- * @author a.oppermann
- * @created 30.04.2014
+ * <p>CdmDataSourceContentProvider class.</p>
+ *
+ * @author n.hoffmann
+ * @created 14.04.2009
  */
-public class ChecklistContentProvider implements IStructuredContentProvider {
+public class CdmRemoteServerContentProvider implements IStructuredContentProvider {
 
-       /**
-        * <p>dispose</p>
-        */
        @Override
     public void dispose() {
-
        }
 
        @Override
     public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
        }
 
        @Override
@@ -40,4 +36,4 @@ public class ChecklistContentProvider implements IStructuredContentProvider {
                }
                return new Object[]{};
        }
-}
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerLabelProvider.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerLabelProvider.java
new file mode 100644 (file)
index 0000000..9e0f372
--- /dev/null
@@ -0,0 +1,88 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.view.remoteserver;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+import eu.etaxonomy.cdm.config.ICdmSource;
+import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.model.metadata.CdmMetaDataPropertyName;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * <p>CdmDataSourceLabelProvider class.</p>
+ *
+ * @author n.hoffmann
+ * @created 14.04.2009
+ */
+public class CdmRemoteServerLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+       /** {@inheritDoc} */
+       @Override
+    public Image getColumnImage(Object element, int columnIndex) {
+               
+
+               return null;
+       }
+
+       /** {@inheritDoc} */
+       @Override
+    public String getColumnText(Object element, int columnIndex) {
+               CdmServerInfoConfig serverInfo = (CdmServerInfoConfig) element;
+
+               
+               switch (columnIndex){
+                       case 0:
+                               return serverInfo.getName();
+                       case 1:
+                               return serverInfo.getServer();                  
+                       case 2:
+                               return serverInfo.getPort() != null?String.valueOf(serverInfo.getPort()): "";
+                       case 3:
+                               return serverInfo.getPrefix();  
+                       case 4:
+                               return String.valueOf(!serverInfo.isIgnoreCdmLibVersion());
+               }
+               return null;
+       }
+
+       
+
+    @Override
+    public void addListener(ILabelProviderListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void dispose() {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public boolean isLabelProperty(Object element, String property) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public void removeListener(ILabelProviderListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/CdmRemoteServerViewPart.java
new file mode 100644 (file)
index 0000000..8fc843c
--- /dev/null
@@ -0,0 +1,247 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.remoteserver;
+
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.Focus;
+import org.eclipse.e4.ui.di.UIEventTopic;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.services.EMenuService;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerViewerComparator;
+import eu.etaxonomy.taxeditor.view.remoteserver.wizard.CdmRemoteServerWizard;
+
+/**
+ * @author kluther
+ * @date 20.01.2023
+ */
+public class CdmRemoteServerViewPart {
+
+   // private static final Logger logger = LogManager.getLogger(CdmRemoteServerViewPart.class);
+
+    @Inject
+    private UISynchronize sync;
+
+       
+
+       private class RemoteServerJob extends Job{
+
+               private final List<CdmServerInfoConfig> cdmSources;
+
+               public RemoteServerJob(String title, List<CdmServerInfoConfig> cdmSources) {
+                       super(title);
+                       this.cdmSources = cdmSources;
+               }
+
+               @Override
+               public IStatus run(final IProgressMonitor monitor) {
+                       try{
+                               //logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); //$NON-NLS-1$
+                               monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);                      //$NON-NLS-1$
+
+                               
+
+                               sync.asyncExec(()->viewer.setInput(this.cdmSources));
+
+                               monitor.worked(1);
+
+                               for(final CdmServerInfoConfig container : cdmSources){
+                                       sync.asyncExec(()-> {
+                                                       viewer.update(container, null);
+                                               }
+                                       );
+                                       monitor.worked(1);
+                               }
+
+                       }finally{
+                               monitor.done();
+                       }
+                       return Status.OK_STATUS;
+               }
+       }
+
+       private TableViewer viewer;
+
+//     private CdmRemoteServerViewerComparator comparator;
+
+       public CdmRemoteServerViewPart(){
+       }
+
+    private ISelectionChangedListener selectionChangedListener;
+
+    @Inject
+    private ESelectionService selService;
+
+    @PostConstruct
+    public void create(Composite parent, EMenuService menuService) {
+               // Create top composite
+               FillLayout fillLayout = new FillLayout();
+               fillLayout.marginWidth = 0;
+               fillLayout.marginHeight = 0;
+               fillLayout.type = SWT.VERTICAL;
+               parent.setLayout(fillLayout);
+
+               viewer = new TableViewer(parent, SWT.H_SCROLL
+                                                                                               | SWT.V_SCROLL | SWT.FULL_SELECTION);
+
+               createColumns(viewer);
+
+               viewer.setContentProvider(new CdmRemoteServerContentProvider());
+               viewer.setLabelProvider(new CdmRemoteServerLabelProvider());
+//             comparator = new CdmRemoteServerViewerComparator();
+//             viewer.setComparator(comparator);
+
+        // Propagate selection from viewer
+        selectionChangedListener = (event -> selService.setSelection(event.getSelection()));
+        viewer.addSelectionChangedListener(selectionChangedListener);
+        viewer.getControl().addMouseListener(new MouseListener() {
+                       
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+                       
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+                       
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               StructuredSelection sel = (StructuredSelection) viewer.getSelection();
+                               if (sel.getFirstElement() instanceof CdmServerInfoConfig) {
+                                       CdmServerInfoConfig container = (CdmServerInfoConfig) sel.getFirstElement();
+                                       Wizard wizard = new CdmRemoteServerWizard(container, CdmRemoteServerWizard.Mode.EDIT);
+                                       WizardDialog dialog = new WizardDialog(null, wizard);
+                                       int result = dialog.open();
+                                       if(result == IStatus.OK){
+                                               if(viewer != null){
+                                                       viewer.update(container, null);
+                                               }
+                                       }
+                               }
+                       }
+               });
+
+        //create context menu
+        menuService.registerContextMenu(viewer.getControl(), "eu.etaxonomy.taxeditor.local.popupmenu.remoteServerViewPart");
+
+               refresh();
+       }
+
+
+       // This will create the columns for the table
+       private void createColumns(TableViewer viewer) {
+               Table table = viewer.getTable();
+
+               String[] titles = {"Name", "Server",  "Port", "Prefix", "Check version"};
+               int[] bounds = { 200, 200, 100, 50, 100 };
+
+               for (int i = 0; i < titles.length; i++) {
+                       TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+                       column.getColumn().setText(titles[i]);
+                       column.getColumn().setWidth(bounds[i]);
+                       column.getColumn().setResizable(true);
+                       column.getColumn().setMoveable(true);
+                       column.getColumn().addSelectionListener(getSelectionAdapter(column.getColumn(), i));
+                       
+                       if(i == 1){
+                               table.setSortColumn(column.getColumn());
+                       }
+               }
+               table.setHeaderVisible(true);
+               table.setLinesVisible(true);
+               table.setSortDirection(SWT.UP);
+       }
+
+    @Inject
+    @Optional
+    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DATASOURCE)boolean refresh){
+        if(refresh){
+            refresh();
+        }
+    }
+
+       public void refresh(){
+               RemoteServerJob dataSourceJob = new RemoteServerJob(Messages.CdmDataSourceViewPart_1, CdmRemoteServerRepository.getAll());
+               dataSourceJob.schedule();
+       }
+       
+       @Focus
+       public void setFocus() {
+           if (viewer.getControl() != null && !viewer.getControl().isDisposed()) {
+            viewer.getControl().setFocus();
+        }
+       }
+
+       public StructuredViewer getViewer() {
+               return viewer;
+       }
+
+//     public IWorkbenchSiteProgressService getService() {
+//             return service;
+//     }
+
+       private SelectionAdapter getSelectionAdapter(final TableColumn column,
+                       final int index) {
+               SelectionAdapter selectionAdapter = new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+//                             comparator.setColumn(index);
+                               int dir = viewer.getTable().getSortDirection();
+                               if (viewer.getTable().getSortColumn() == column) {
+                                       dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
+                               } else {
+                                       dir = SWT.DOWN;
+                               }
+                               viewer.getTable().setSortDirection(dir);
+                               viewer.getTable().setSortColumn(column);
+                               viewer.refresh();
+                       }
+               };
+               return selectionAdapter;
+       }
+       
+       
+       
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerRepository.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerRepository.java
new file mode 100644 (file)
index 0000000..bdf3eb1
--- /dev/null
@@ -0,0 +1,150 @@
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ *
+ * @author n.hoffmann
+ */
+package eu.etaxonomy.taxeditor.view.remoteserver.common;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import eu.etaxonomy.cdm.config.ConfigFileUtil;
+import eu.etaxonomy.taxeditor.remoting.source.CdmRemoteSourceException;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfo;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+
+public class CdmRemoteServerRepository{
+
+       private static final String DEFAULT_REMOTE_SERVER_FILENAME = "cdm_remote_servers.json";
+
+       static List<CdmServerInfoConfig> cdmServerList = new ArrayList<>();
+
+
+
+       public static boolean delete(CdmServerInfoConfig remoteServerConfig) {
+               cdmServerList.remove(remoteServerConfig);
+               save();
+               return true;
+       }
+
+       public static Integer check(CdmServerInfoConfig remoteServerConfig) {
+
+           int index = 0;
+               for (CdmServerInfoConfig server: cdmServerList) {
+                       if (server.getName().equals(remoteServerConfig.getName())) {
+                           return index;
+                       }
+                       index++;
+               }
+               return null;
+
+       }
+
+       public static boolean add(CdmServerInfoConfig newRemoteServer) {
+//             if (cdmServerList.containsKey(newRemoteServer)) {
+//                     return false;
+//             }
+
+               cdmServerList.add(newRemoteServer);
+               return true;
+       }
+
+       public static boolean update(CdmServerInfoConfig updatedRemoteServer, String oldName) {
+               int i = 0;
+               boolean contains = false;
+               for (CdmServerInfoConfig server: cdmServerList) {
+                       if (server.getName().equals(oldName)) {
+                               contains = true;
+                               break;
+                       }
+               }
+               if (contains) {
+                       cdmServerList.remove(i);
+               }
+               cdmServerList.add(i, updatedRemoteServer);
+               return true;
+       }
+
+       public static boolean moveUp(CdmServerInfoConfig updatedRemoteServer) {
+        int i = 0;
+        boolean contains = false;
+        for (CdmServerInfoConfig server: cdmServerList) {
+            if (server.getName().equals(updatedRemoteServer.getName())) {
+                contains = true;
+                break;
+            }
+            i++;
+        }
+        if (contains) {
+            cdmServerList.remove(i);
+        }
+
+        cdmServerList.add(--i, updatedRemoteServer);
+        return true;
+    }
+
+       public static boolean moveDown(CdmServerInfoConfig updatedRemoteServer) {
+        int i = 0;
+        boolean contains = false;
+        for (CdmServerInfoConfig server: cdmServerList) {
+            if (server.getName().equals(updatedRemoteServer.getName())) {
+                contains = true;
+                break;
+            }
+            i++;
+        }
+        if (contains) {
+            cdmServerList.remove(i);
+        }
+
+        cdmServerList.add(++i, updatedRemoteServer);
+        return true;
+    }
+
+       public static List<CdmServerInfoConfig> getAll() {
+               List<CdmServerInfoConfig> cdmServers = null;
+               try {
+                       cdmServerList.clear();
+                       File file = new File(ConfigFileUtil.perUserCdmFolderFallback(), DEFAULT_REMOTE_SERVER_FILENAME);
+                       cdmServers = CdmServerInfo.loadFromConfigFile(file);
+                       for (CdmServerInfoConfig server: cdmServers) {
+                               cdmServerList.add(server);
+                       }
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+
+               return cdmServers;
+       }
+
+
+
+
+
+       /**
+        * <p>save</p>
+        *
+        * @param dataSource a {@link eu.etaxonomy.cdm.database.ICdmDataSource} object.
+        * @param strDataSourceName a {@link java.lang.String} object.
+        * @return a {@link eu.etaxonomy.cdm.database.CdmPersistentDataSource} object.
+        * @throws CdmRemoteSourceException
+        */
+       public static boolean save()  {
+               File file = new File(ConfigFileUtil.perUserCdmFolderFallback(), DEFAULT_REMOTE_SERVER_FILENAME);
+               return CdmServerInfo.saveToConfigFile(cdmServerList, file);
+       }
+
+
+
+
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerViewerComparator.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/common/CdmRemoteServerViewerComparator.java
new file mode 100644 (file)
index 0000000..243547e
--- /dev/null
@@ -0,0 +1,88 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.view.remoteserver.common;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+
+import eu.etaxonomy.cdm.config.ICdmSource;
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+import eu.etaxonomy.cdm.model.metadata.CdmMetaDataPropertyName;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+
+/**
+ * @author n.hoffmann
+ * @created Dec 8, 2010
+ */
+public class CdmRemoteServerViewerComparator extends ViewerComparator {
+
+       private int propertyIndex;
+       private static final int DESCENDING = 1;
+       private int direction = DESCENDING;
+
+       public CdmRemoteServerViewerComparator() {
+               this.propertyIndex = 1;
+               direction = DESCENDING;
+       }
+
+       public void setColumn(int column) {
+               if (column == this.propertyIndex) {
+                       // Same column as last sort; toggle the direction
+                       direction = 1 - direction;
+               } else {
+                       // New column; do an ascending sort
+                       this.propertyIndex = column;
+                       direction = DESCENDING;
+               }
+       }
+
+       @Override
+       public int compare(Viewer viewer, Object e1, Object e2) {
+               CdmServerInfoConfig d1 = (CdmServerInfoConfig) e1;
+               CdmServerInfoConfig d2 = (CdmServerInfoConfig) e2;
+
+               
+
+               int result = 0;
+
+               switch (propertyIndex) {
+                       
+                       case 4:
+                               //port
+                               if (d1.getPort() == d2.getPort()) {
+                                       result = 0;
+                               }else if (d1.getPort() > d2.getPort()) {
+                                       result = 1;
+                               }else {
+                                       result = -1;
+                               }
+                               break;
+                       case 3:
+                               // prefix
+                               result = d1.getPrefix().compareTo(d2.getPrefix());
+                               break;
+                       case 2:
+                               //server
+                               String server1 = d1.getServer();
+                               String server2 = d2.getServer();
+                               
+                               result = server1.compareTo(server2);
+                               break;
+                       default:
+                               result = d1.getName().compareTo(d2.getName());
+               }
+
+               // If descending order, flip the direction
+               if (direction == DESCENDING) {
+                       result = -result;
+               }
+               return result;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/AbstractRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/AbstractRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..58578f4
--- /dev/null
@@ -0,0 +1,68 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.remoteserver.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.di.UISynchronize;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+
+/**
+ * @author kluther
+ * @date 23.01.2023
+ */
+public abstract class AbstractRemoteServerHandler {
+
+    protected UISynchronize sync;
+
+       @Execute
+    public void execute(
+            @Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
+            @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+            UISynchronize sync) {
+
+           this.sync = sync;
+
+           CdmRemoteServerViewPart view = (CdmRemoteServerViewPart) thisPart.getObject();
+
+               boolean refresh = specificExecute(view,
+                       (CdmServerInfoConfig) selection.getFirstElement(), shell);
+
+               if(refresh) {
+            view.refresh();
+        }
+       }
+
+    @CanExecute
+    public boolean canExecute(
+            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
+            MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart
+                && selection!=null
+                && selection.size()==1
+                && selection.getFirstElement() instanceof CdmServerInfoConfig;
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+
+       public abstract boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container, Shell shell);
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/CreateRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/CreateRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..20e5914
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.remoteserver.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Execute;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+import eu.etaxonomy.taxeditor.view.remoteserver.wizard.CdmRemoteServerWizard;
+
+/**
+ * @author pplitzner
+ * @date 22.08.2017
+ */
+public class CreateRemoteServerHandler {
+
+    @Execute
+    public void execute(
+            @Named(IServiceConstants.ACTIVE_SHELL)Shell shell,
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart) {
+
+       CdmRemoteServerViewPart view = (CdmRemoteServerViewPart) thisPart.getObject();
+
+       CdmRemoteServerWizard wizard = new CdmRemoteServerWizard();
+
+        WizardDialog dialog = new WizardDialog(shell, wizard);
+
+        boolean refresh = dialog.open() == IStatus.OK;
+
+        if(refresh) {
+            view.refresh();
+        }
+    }
+
+    @CanExecute
+    public boolean canExecute(
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
+            MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart;
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/DeleteRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/DeleteRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..00f4465
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.view.remoteserver.handler;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository;
+
+/**
+ *
+ * @author pplitzner
+ * @date 22.08.2017
+ *
+ */
+public class DeleteRemoteServerHandler extends AbstractRemoteServerHandler {
+
+
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container, Shell shell) {
+        if(! MessageDialog.openConfirm(shell, "Confirm Deletion", "Do you want to delete the selected datasources?")){
+            return false;
+        }        
+        CdmRemoteServerRepository.delete(container);
+        
+        return true;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/EditRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/EditRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..3705fd7
--- /dev/null
@@ -0,0 +1,44 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.remoteserver.handler;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+import eu.etaxonomy.taxeditor.view.remoteserver.wizard.CdmRemoteServerWizard;
+
+/**
+ * @author k.luther
+ * @date 23.01.2023
+ * 
+ */
+public class EditRemoteServerHandler extends AbstractRemoteServerHandler {
+
+    @Override
+    public boolean specificExecute(CdmRemoteServerViewPart remoteServerViewPart, CdmServerInfoConfig container, Shell shell) {
+       
+       Wizard wizard = new CdmRemoteServerWizard(container, CdmRemoteServerWizard.Mode.EDIT);
+               WizardDialog dialog = new WizardDialog(shell, wizard);
+
+               int result = dialog.open();
+
+               if(result == IStatus.OK){
+                       if(remoteServerViewPart != null){
+                               
+                               remoteServerViewPart.getViewer().update(container, null);
+                       }
+               }
+               
+               return false;
+       }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveDownRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveDownRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..3573610
--- /dev/null
@@ -0,0 +1,56 @@
+// $Id$
+/**
+* Copyright (C) 2023 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.view.remoteserver.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository;
+
+/**
+ * @author k.luther
+ * @date 12.04.2023
+ *
+ */
+public class MoveDownRemoteServerHandler extends AbstractRemoteServerHandler{
+    @Override
+    @CanExecute
+    public boolean canExecute(
+            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
+            MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart
+                && selection!=null
+                && selection.size()==1
+                && selection.getFirstElement() instanceof CdmServerInfoConfig
+                && CdmRemoteServerRepository.check((CdmServerInfoConfig)selection.getFirstElement()) < CdmRemoteServerRepository.getAll().size()-1;
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+
+    @Override
+    public boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container,
+            Shell shell) {
+        CdmRemoteServerRepository.moveDown(container);
+        CdmRemoteServerRepository.save();
+        return true;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveUpRemoteServerHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/handler/MoveUpRemoteServerHandler.java
new file mode 100644 (file)
index 0000000..4bea77d
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$
+/**
+* Copyright (C) 2023 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.view.remoteserver.handler;
+
+import javax.inject.Named;
+
+import org.eclipse.e4.core.di.annotations.CanExecute;
+import org.eclipse.e4.core.di.annotations.Optional;
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
+import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.view.remoteserver.CdmRemoteServerViewPart;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository;
+
+/**
+ * @author k.luther
+ * @date 12.04.2023
+ *
+ */
+public class MoveUpRemoteServerHandler extends AbstractRemoteServerHandler{
+
+
+    @Override
+    @CanExecute
+    public boolean canExecute(
+            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
+            @Named(IServiceConstants.ACTIVE_PART)MPart thisPart,
+            MHandledMenuItem menuItem) {
+        boolean canExecute = false;
+        canExecute = thisPart.getObject() instanceof CdmRemoteServerViewPart
+                && selection!=null
+                && selection.size()==1
+                && selection.getFirstElement() instanceof CdmServerInfoConfig
+                && CdmRemoteServerRepository.check((CdmServerInfoConfig)selection.getFirstElement()) > 0;
+        menuItem.setVisible(canExecute);
+        return canExecute;
+    }
+
+
+
+    @Override
+    public boolean specificExecute(CdmRemoteServerViewPart dataSourceViewPart, CdmServerInfoConfig container,
+            Shell shell) {
+        CdmRemoteServerRepository.moveUp(container);
+        CdmRemoteServerRepository.save();
+        return true;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizard.java
new file mode 100644 (file)
index 0000000..f8840c1
--- /dev/null
@@ -0,0 +1,110 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.view.remoteserver.wizard;
+
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.view.remoteserver.common.CdmRemoteServerRepository;
+
+/**
+ *
+ * @author n.hoffmann
+ * @author k.luther
+ * @created 23.03.2023
+ */
+public class CdmRemoteServerWizard extends Wizard {
+
+       private CdmRemoteServerWizardPage remoteServerPage;
+
+       private CdmServerInfoConfig remoteServer;
+       private String oldName;
+
+       public enum Mode {
+               CREATE,
+               EDIT,
+               CLONE
+       }
+
+       // default mode is to create a new remote server
+       Mode mode = Mode.EDIT;
+
+       public CdmRemoteServerWizard() {
+               super();
+               this.mode = Mode.CREATE;
+               setForcePreviousAndNextButtons(false);
+               setWindowTitle("Remote Server Dialog");
+       }
+
+       public CdmRemoteServerWizard(CdmServerInfoConfig remoteServer, Mode mode) {
+               super();
+               if(remoteServer != null){
+                       this.mode = mode;
+                       this.remoteServer = remoteServer;
+                       this.oldName = remoteServer.getName();
+               } else {
+                       this.remoteServer = new CdmServerInfoConfig();
+                       this.remoteServer.setName("");
+               }
+               setWindowTitle("Remote Server Dialog");
+       }
+
+       @Override
+       public void addPages() {
+               if (remoteServer != null) {
+
+                       remoteServerPage = new CdmRemoteServerWizardPage(remoteServer.getName(), remoteServer, mode);
+               }else {
+                       remoteServerPage = new CdmRemoteServerWizardPage("New remote server", remoteServer, mode);
+               }
+               this.addPage(remoteServerPage);
+               return;
+
+       }
+
+       @Override
+       public boolean performFinish() {
+               try {
+                       CdmServerInfoConfig cdmServerConf = this.remoteServerPage.getRemoteServer();
+                       if (mode.equals(Mode.CREATE) && CdmRemoteServerRepository.check(cdmServerConf)!= null) {
+                               while(CdmRemoteServerRepository.check(cdmServerConf) != null){
+                                       cdmServerConf.setName(cdmServerConf.getName()+ 1);
+                               }
+                               
+                               boolean confirm = MessagingUtils.confirmDialog("Servername already in use", "This servername is already in use, the new remote server will be called: "+ cdmServerConf.getName()+"\n Do you want to continue?");
+                               if (!confirm) {
+                                       return false;
+                               }
+                       }
+                       if (mode.equals(Mode.CREATE)) {
+                               CdmRemoteServerRepository.add(cdmServerConf);
+//                     }else {
+//                             CdmRemoteServerRepository.update(cdmServerConf, this.oldName);
+                       }
+                       CdmRemoteServerRepository.save();
+                       return true;
+        } catch (Throwable e) {
+            MessagingUtils.errorDialog("Error when persisting change",
+                    this,
+                    e.getMessage(),
+                    TaxeditorStorePlugin.PLUGIN_ID,
+                    e,
+                    true);
+            return false;
+        }
+       }
+
+       @Override
+       public boolean canFinish() {
+               return remoteServerPage.isPageComplete();
+       
+       }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/remoteserver/wizard/CdmRemoteServerWizardPage.java
new file mode 100644 (file)
index 0000000..835260d
--- /dev/null
@@ -0,0 +1,317 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.view.remoteserver.wizard;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+
+import org.apache.commons.lang3.StringUtils;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+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.swt.widgets.Text;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.remoting.source.CdmServerInfoConfig;
+
+/**
+ * <p>Abstract CdmDataSourceCredentialsWizardPage class.</p>
+ *
+ * @author k.luther
+ * @created 23.01.2023
+ */
+public class CdmRemoteServerWizardPage extends WizardPage implements ModifyListener, SelectionListener {
+       private CdmServerInfoConfig remoteServer;
+
+       protected Text text_name;
+       protected Text text_server;
+       protected Text text_port;
+       protected Text text_prefix;
+
+       protected Button checkIgnoreCdmLibVersion;
+
+       protected Composite composite;
+
+       protected Composite parent;
+
+       protected String name;
+       protected String server;
+       protected String port;
+       protected String prefix;
+       protected Boolean checkCdmLibVersion;
+       CdmRemoteServerWizard.Mode mode;
+
+       /**
+        * <p>Constructor for CdmDataSourceCredentialsWizardPage.</p>
+        *
+        * @param pageName a {@link java.lang.String} object.
+        */
+       protected CdmRemoteServerWizardPage(String pageName, CdmServerInfoConfig remoteServer) {
+               super(pageName);
+               this.setPageComplete(false);
+               this.remoteServer = remoteServer;
+               mode = CdmRemoteServerWizard.Mode.CREATE;
+       }
+
+       /**
+        * <p>Constructor for CdmDataSourceCredentialsWizardPage.</p>
+        *
+        * @param pageName a {@link java.lang.String} object.
+        */
+       public CdmRemoteServerWizardPage(String pageName, CdmServerInfoConfig remoteServer, CdmRemoteServerWizard.Mode mode) {
+               super(pageName);
+               this.setPageComplete(false);
+
+               this.mode = mode;
+               if(mode == CdmRemoteServerWizard.Mode.CLONE ) {
+                       this.remoteServer = new CdmServerInfoConfig(remoteServer.getName(), remoteServer.getServer(), remoteServer.getPort(), remoteServer.getPrefix(),remoteServer.isIgnoreCdmLibVersion());
+               } else if (mode == CdmRemoteServerWizard.Mode.CREATE){
+                       this.remoteServer = new CdmServerInfoConfig("");
+                       //CdmRemoteServerRepository.add(this.remoteServer);
+               } else {
+                       this.remoteServer = remoteServer;
+               }
+       }
+
+       @Override
+    public void createControl(Composite parent) {
+               this.parent = parent;
+
+               // Create top-level composite
+               parent.setLayout(new GridLayout());
+               composite = new Composite(parent, SWT.NONE);
+               composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false,2,5));
+               GridLayout formLayout = new GridLayout();
+               formLayout.numColumns = 2;
+               composite.setLayout(formLayout);
+
+               // Create composite for data source name
+               Composite editRemoteServerComposite = new Composite(composite, SWT.NONE);
+               GridData remoteServerGridData = new GridData(SWT.FILL, SWT.TOP, true, true,2,1);
+               editRemoteServerComposite.setLayoutData(remoteServerGridData);
+               GridLayout remoteServerLayout = new GridLayout();
+               remoteServerLayout.numColumns = 2;
+               editRemoteServerComposite.setLayout(remoteServerLayout);
+
+               // Create label and input for dataSource name
+               Label remoteServerNameLabel = new Label(editRemoteServerComposite, SWT.NONE);
+               remoteServerNameLabel.setText("Name:");
+               text_name = new Text(editRemoteServerComposite, SWT.BORDER);
+               text_name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               Label remoteServerLabel = new Label(editRemoteServerComposite, SWT.NONE);
+               remoteServerLabel.setText("Server:");
+               text_server = new Text(editRemoteServerComposite, SWT.BORDER);
+               text_server.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               Label remotePortLabel = new Label(editRemoteServerComposite, SWT.NONE);
+               remotePortLabel.setText("Port:");
+               text_port = new Text(editRemoteServerComposite, SWT.BORDER);
+               text_port.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               Label remotePrefixLabel = new Label(editRemoteServerComposite, SWT.NONE);
+               remotePrefixLabel.setText("Prefix:");
+               text_prefix = new Text(editRemoteServerComposite, SWT.BORDER);
+               text_prefix.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+
+               Composite checkCdmlibVersionComposite = new Composite(editRemoteServerComposite, SWT.NONE);
+               GridData checkCdmlibVersionGridData = new GridData(SWT.FILL, SWT.TOP, true, true,2,1);
+               checkCdmlibVersionComposite.setLayoutData(checkCdmlibVersionGridData);
+               GridLayout checkCdmlibVersionLayout = new GridLayout();
+               checkCdmlibVersionLayout.numColumns = 3;
+               checkCdmlibVersionComposite.setLayout(checkCdmlibVersionLayout);
+               Label remoteCheckCdmLibVersionLabel = new Label(checkCdmlibVersionComposite, SWT.NONE);
+               remoteCheckCdmLibVersionLabel.setText("Check cdmlib Version:");
+               checkIgnoreCdmLibVersion = new Button(checkCdmlibVersionComposite, SWT.CHECK);
+               checkIgnoreCdmLibVersion.addSelectionListener(this);
+               Label remoteCheckCdmLibVersionWarning = new Label(checkCdmlibVersionComposite, SWT.NONE);
+               remoteCheckCdmLibVersionWarning.setText("(Recommended)");
+
+               // Create composite for buttons
+               Composite buttonComposite = new Composite(composite, SWT.NONE);
+               buttonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
+               GridLayout buttonLayout = new GridLayout();
+               buttonLayout.numColumns = 1;
+               buttonComposite.setLayout(buttonLayout);
+
+               // Create test connection button
+               Button testButton = new Button(buttonComposite, SWT.NONE);
+               testButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+               testButton.setText("Test connection");
+
+               // Test connection when button is pressed
+               testButton.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               boolean testConnection = testServerConfiguration();
+                               if (testConnection) {
+                                   MessagingUtils.informationDialog("Connection successfull", "The connection to the server could be established successfully.");
+                               }else {
+                                   MessagingUtils.informationDialog("Connection not successfull", "The connection to the server could not be established.");
+                               }
+                       }
+               });
+
+               setControl(composite);
+               init();
+       }
+
+
+
+       /**
+        * Initialize text fields
+        */
+       public void init() {
+               removeListeners();
+               if(getRemoteServer() != null && getRemoteServer().getName() != null){
+                       text_name.setText(getRemoteServer().getName());
+                       text_server.setText(getRemoteServer().getServer());
+                       text_port.setText(getRemoteServer().getPort() != null?String.valueOf(getRemoteServer().getPort()): "");
+                       text_prefix.setText(getRemoteServer().getPrefix());
+                       checkIgnoreCdmLibVersion.setSelection(!getRemoteServer().isIgnoreCdmLibVersion());
+               }
+               // add listeners after setting text to avoid the modify event being called
+               // for the initial value
+               addListeners();
+
+               // in the case of cloning we use the same datasource info
+               // except for the name
+               if(mode == CdmRemoteServerWizard.Mode.CLONE) {
+                       getRemoteServer().setName("");
+                       text_name.setText("");
+               } else {
+                       name = text_name.getText();
+               }
+       }
+
+       private void addListeners() {
+               text_name.addModifyListener(this);
+               text_server.addModifyListener(this);
+               text_port.addModifyListener(this);
+               text_prefix.addModifyListener(this);
+
+       }
+
+       private void removeListeners() {
+               text_name.removeModifyListener(this);
+               text_server.removeModifyListener(this);
+               text_port.removeModifyListener(this);
+               text_prefix.removeModifyListener(this);
+
+       }
+
+       private boolean testServerConfiguration() {
+           Socket s = new Socket();
+        try {
+            s.connect(new InetSocketAddress(remoteServer.getServer(), remoteServer.getPort()), CdmApplicationRemoteConfiguration.HTTP_READ_TIMEOUT_MIN);
+            s.close();
+        } catch (IOException e) {
+            return false;
+        }
+        return true;
+       }
+
+
+       /**
+        * <p>checkPageComplete</p>
+        */
+       public void checkPageComplete(){
+               boolean complete = true;
+
+               complete &=StringUtils.isNotBlank(text_name.getText());
+               complete &=StringUtils.isNotBlank(text_server.getText());
+               complete &=this.remoteServer.getPort() != null;
+
+               this.setPageComplete(complete);
+       }
+
+
+
+       @Override
+       public IWizardPage getNextPage() {
+               return null;
+       }
+
+       public void setRemoteServer(CdmServerInfoConfig remoteServer) {
+               this.remoteServer = remoteServer;
+       }
+
+       protected CdmServerInfoConfig getRemoteServer() {
+               return remoteServer;
+       }
+
+       public String getRemoteServerName() {
+               return name;
+       }
+
+       @Override
+    public void modifyText(ModifyEvent e) {
+               name = text_name.getText();
+               server = text_server.getText();
+               port = text_port.getText();
+               prefix = text_prefix.getText();
+               this.remoteServer.setName(name != null? name:null);
+               this.remoteServer.setIgnoreCdmLibVersion(!this.checkIgnoreCdmLibVersion.getSelection());
+               this.remoteServer.setServer(server!= null? server:null);
+               this.remoteServer.setPrefix(prefix != null?prefix:null);
+
+               text_port.setBackground(text_prefix.getBackground());
+               Integer intPort = checkAndConvertPort();
+               if (intPort == null){
+                       text_port.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+               }
+               this.remoteServer.setPort(intPort);
+               checkPageComplete();
+       }
+
+       private Integer checkAndConvertPort() {
+               Integer portInt = null;
+
+               try {
+                       portInt = StringUtils.isNotBlank(port)?Integer.parseInt(port):0;
+               }catch(NumberFormatException e) {
+                       return null;
+               }
+               if (portInt > 65535) {
+                       return null;
+               }
+
+               return portInt;
+       }
+
+       @Override
+       public void widgetSelected(SelectionEvent e) {
+               this.remoteServer.setIgnoreCdmLibVersion(!checkIgnoreCdmLibVersion.getSelection());
+               checkPageComplete();
+
+       }
+
+       @Override
+       public void widgetDefaultSelected(SelectionEvent e) {
+               // TODO Auto-generated method stub
+
+       }
+
+
+
+}
\ No newline at end of file
index 3bb7814d2cb0dfdf15e64cacc4b32424c2756a16..6d0e2edf110de8c29d2250803eb32fab977b3f15 100644 (file)
@@ -22,9 +22,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.swt.graphics.Image;
-import org.hibernate.LazyInitializationException;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
 import eu.etaxonomy.cdm.common.CdmUtils;
@@ -45,6 +43,7 @@ import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.cdm.model.term.DefinedTerm;
+import eu.etaxonomy.cdm.model.term.IdentifierType;
 import eu.etaxonomy.cdm.strategy.cache.common.IdentifiableEntityDefaultCacheStrategy;
 import eu.etaxonomy.cdm.strategy.cache.occurrence.DnaSampleDefaultCacheStrategy;
 import eu.etaxonomy.taxeditor.model.ImageResources;
@@ -52,12 +51,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * Label provider for the views to show {@link SpecimenOrObservationBase}s.<br>
- * <br>
- * <b>Note:</b> If you use this label provider you need to assure that you
- * created a {@link ConversationHolder} resp. have an open session because
- * the labels are generated from various fields of the derivate hierarchy which
- * are lazy loaded and could therefore throw a {@link LazyInitializationException}.<br>
- * Use <b>{@link #setConversation(ConversationHolder)}</b> to assign the session to this provider.
  */
 public class DerivateLabelProvider extends ColumnLabelProvider {
 
@@ -67,13 +60,11 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
 
     private static Map<DerivedUnit, Collection<SpecimenTypeDesignation>> typeDesignations;
 
-    private ConversationHolder conversation;
-
     private static DefinedTerm photoTerm = null;
     private static DefinedTerm drawingTerm = null;
     private static DefinedTerm specimenScanTerm = null;
     private static DefinedTerm detailImageTerm = null;
-    private static DefinedTerm sampleDesignationTerm = null;
+    private static IdentifierType sampleDesignationTerm = null;
 
     //FIXME: move static term getters to new singleton utility class
     private static void initializeTerms() {
@@ -91,8 +82,11 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             else if(definedTerm.getUuid().equals(UUID.fromString("31eb8d02-bf5d-437c-bcc6-87a626445f34"))){
                 detailImageTerm = definedTerm;
             }
-            else if(definedTerm.getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
-                sampleDesignationTerm = definedTerm;
+        }
+        List<IdentifierType> identifierTypes = CdmStore.getTermManager().getPreferredTerms(IdentifierType.class);
+        for (IdentifierType identifierType : identifierTypes) {
+            if(identifierType.getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
+                sampleDesignationTerm = identifierType;
             }
         }
     }
@@ -125,7 +119,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return detailImageTerm;
     }
 
-    public static DefinedTerm getSampleDesignationTerm(){
+    public static IdentifierType getSampleDesignationTerm(){
         if(sampleDesignationTerm==null){
             initializeTerms();
         }
@@ -213,17 +207,9 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         return getDerivateText(element);
     }
 
-    public void setConversation(ConversationHolder conversation) {
-        this.conversation = conversation;
-    }
-
-    public String getDerivateText(Object element){
-        return getDerivateText(element, conversation);
-    }
-
     //Note AM: not sure what this method is really used for, why do we need an explicit
     //         formatting for those few use-cases where this is used?
-    public static String getDerivateText(Object element, ConversationHolder conversation){
+    public static String getDerivateText(Object element){
         //TODO: use list of strings to assemble labels to avoid adding the separator every time and to allow null values
         TreeNode parentNode = null;
         TreeNode node = null;
@@ -235,10 +221,6 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             derivate = node.getValue();
         }
 
-        if(conversation!=null){
-            conversation.bind();
-        }
-
         final String emptyString = StringUtils.EMPTY;
         final String separator = " ";
 
@@ -441,7 +423,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
     public static Identifier getCurrentSampleDesignation(CdmBase entity) {
         if(entity.isInstanceOf(DnaSample.class)){
             DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class);
-            return dnaSample.getIdentifier(DefinedTerm.uuidSampleDesignation);
+            return dnaSample.getIdentifier(IdentifierType.uuidSampleDesignation);
         }
         else if(entity.isInstanceOf(Sequence.class)){
             Sequence sequence = HibernateProxyHelper.deproxy(entity, Sequence.class);
index b444e692cd032e2e00c972c7e3bbe5ea3d7731b1..20a518c41f935b446d5610d8bef29f77564165f8 100644 (file)
@@ -8,6 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.view.search.facet;
 
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -52,7 +53,7 @@ public class FilterComposite extends Composite{
         content.setLayout(gl_content);
 
         Label label = new Label(content, SWT.NONE);
-        label.setText(facet.getFacet());
+        label.setText(StringUtils.replace(facet.getFacet(), "&", "&&"));
         GridDataFactory.fillDefaults().applyTo(label);
 
     }
index cf19e2245c6e482abbaec2e0e5092006ae7b383c..cc5e05223010fd19610b83c43aa83301ec2cfb19 100644 (file)
@@ -18,6 +18,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyEvent;
@@ -94,10 +95,13 @@ public abstract class SearchController<S extends SearchResult<T>, T> implements
             categoryToFacetsMap.put(category, categoryFacets);
         }
         for (Entry<String, List<Facet>> entry: categoryToFacetsMap.entrySet()) {
-            String category = entry.getKey();
+            String category = StringUtils.replace(entry.getKey(), "&", "&&");
             // create group
             Group group = new Group(composite.getFilterListComposite(), SWT.NONE);
             group.setLayout(new GridLayout());
+            
+            
+            
             GridDataFactory.fillDefaults().applyTo(group);
             group.setText(category!=null?category:"None");
             // fill group with facet filters
@@ -115,6 +119,9 @@ public abstract class SearchController<S extends SearchResult<T>, T> implements
     private Set<Facet> createResults(List<S> results) {
         Set<Facet> facets = new HashSet<>();
         searchResultComposites.clear();
+        
+        
+        
         for (S result : results) {
 
             CheckBoxSearchResultComposite checkComp = createResultComposite(result, composite.getSearchResultComposite());
index 143c322ebf50f07d6bf556513cdc1e788997e181..f02f5a93878b81ce1000654259a39993c0704378 100644 (file)
@@ -28,7 +28,6 @@ import eu.etaxonomy.taxeditor.view.search.facet.SearchController;
 /**
  * @author pplitzner
  * @since Jan 22, 2019
- *
  */
 public class OccurrenceSearchController extends SearchController<OccurrenceSearchResult, DerivedUnitDTO> {
 
@@ -45,7 +44,6 @@ public class OccurrenceSearchController extends SearchController<OccurrenceSearc
                 String label2 = o2.getContent().getLabel();
                 return StoreUtil.compareBySearchString(searchString, label1, label2);
             }
-
         };
     }
 
@@ -69,5 +67,4 @@ public class OccurrenceSearchController extends SearchController<OccurrenceSearc
     protected List<OccurrenceSearchResult> getSelectedResults() {
         return null;
     }
-
-}
+}
\ No newline at end of file
index 4b002da21a4fa48c33994e60202f1f5ef6c0e63c..9e65afc0e5426bf7ae93ca7aaf96788f55dbc72d 100644 (file)
@@ -12,6 +12,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
@@ -23,6 +24,7 @@ import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.term.TermType;
+import eu.etaxonomy.cdm.model.term.VocabularyEnum;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
@@ -66,16 +68,57 @@ public class TermSearchController extends SearchController<TermSearchResult, Abs
     }
 
     @Override
-    protected List<TermSearchResult> searchResults(String searchString){
+    protected List<TermSearchResult> searchResults(String searchString) {
         List<TermSearchResult> searchResults = new ArrayList<>();
-        if(CdmUtils.isNotBlank(searchString)){
-            TermType type = term!= null ? term.getTermType():null;
-            Collection<TermDto> dtos = CdmStore.getService(ITermService.class).findByTitleAsDtoWithVocDto(searchString, type);
+        if (CdmUtils.isNotBlank(searchString)) {
+            TermType type = term != null ? term.getTermType() : null;
+            Collection<TermDto> dtos = CdmStore.getService(ITermService.class).findByTitleAsDtoWithVocDto(searchString,
+                    type);
             dtos.remove(term);
-            dtos.stream().forEach(dto->searchResults.add(new TermSearchResult(dto)));
-            if (page != null){
-                Collection<TermVocabularyDto> vocDtos = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermTypeAndPattern(searchString, type);
-                vocDtos.stream().forEach(vocDto->searchResults.add(new TermSearchResult(vocDto)));
+
+            if (this.page != null && this.page.isSkipStandartVocs()) {
+                Collection<TermDto> filteredDtos = dtos.stream()
+                        .filter(c -> VocabularyEnum.getVocabularyEnumByUuid(c.getVocabularyUuid()) == null)
+                        .collect(Collectors.toSet());
+
+                dtos = filteredDtos;
+            }
+            if (this.page != null && this.page.isSkipManagedColls()) {
+                Collection<TermDto> filteredDtos = dtos.stream()
+                        .filter(c -> !c.isManaged())
+                        .collect(Collectors.toSet());
+
+                dtos = filteredDtos;
+            }
+            
+
+            dtos.stream().forEach(dto -> searchResults.add(new TermSearchResult(dto)));
+            if (page != null) {
+                Collection<TermVocabularyDto> vocDtos = CdmStore.getService(IVocabularyService.class)
+                        .findVocabularyDtoByTermTypeAndPattern(searchString, type);
+                if (this.page.isSkipStandartVocs()) {
+                    Collection<TermVocabularyDto> filteredDtos = vocDtos.stream()
+                            .filter(c -> VocabularyEnum.getVocabularyEnumByUuid(c.getUuid()) == null)
+                            .collect(Collectors.toSet());
+
+                    vocDtos = filteredDtos;
+                }
+                if (this.page != null && this.page.isSkipStandartVocs()) {
+                    Collection<TermVocabularyDto> filteredDtos = vocDtos.stream()
+                            .filter(c -> VocabularyEnum.getVocabularyEnumByUuid(c.getUuid()) == null)
+                            .collect(Collectors.toSet());
+
+                    vocDtos = filteredDtos;
+                }
+                if (this.page != null && this.page.isSkipManagedColls()) {
+                    Collection<TermVocabularyDto> filteredDtos = vocDtos.stream()
+                            .filter(c -> !c.isManaged())
+                            .collect(Collectors.toSet());
+
+                    vocDtos = filteredDtos;
+                }
+
+                vocDtos.stream().forEach(vocDto -> searchResults.add(new TermSearchResult(vocDto)));
             }
         }
         return searchResults;
@@ -90,11 +133,11 @@ public class TermSearchController extends SearchController<TermSearchResult, Abs
             public void widgetSelected(SelectionEvent e) {
                 Button selectedComp = (Button) e.widget;
                 boolean selected = selectedComp.getSelection();
-                for (CheckBoxSearchResultComposite<?,?> comp: getSearchResultComposites()){
+                for (CheckBoxSearchResultComposite<?, ?> comp : getSearchResultComposites()) {
                     comp.getBtnCheck().setSelection(false);
                 }
                 selectedComp.setSelection(selected);
-                if (page != null){
+                if (page != null) {
                     page.setPageComplete(selected);
                 }
             }
@@ -113,7 +156,7 @@ public class TermSearchController extends SearchController<TermSearchResult, Abs
     }
 
     @Override
-    protected void search(){
+    protected void search() {
         super.search();
 
     }
index 7c40204520c9cf2981861466dbbe9eecbd855937..3a2a86ca6758a6943a3c8c7e2a2adfc619dbecd0 100644 (file)
@@ -8,20 +8,23 @@
 */
 package eu.etaxonomy.taxeditor.view.search.facet.term;
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
+import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.term.TermType;
 import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;
 import eu.etaxonomy.cdm.persistence.dto.TermDto;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.view.search.facet.Facet;
 import eu.etaxonomy.taxeditor.view.search.facet.SearchResult;
 
 /**
  * @author pplitzner
  * @since Jan 24, 2019
- *
  */
 public class TermSearchResult extends SearchResult<AbstractTermDto> {
 
@@ -32,14 +35,19 @@ public class TermSearchResult extends SearchResult<AbstractTermDto> {
     @Override
     protected Set<Facet> initFacets(AbstractTermDto content) {
         Set<Facet> facets = new HashSet<>();
-        content.localize(new TermRepresentation_L10n());
+        //this does not work!
+        List<Language> languages = new ArrayList<>();
+        languages.add(PreferencesUtil.getGlobalLanguage());
+        content.localize(new TermRepresentation_L10n(), languages);
         TermType termType = content.getTermType();
+
         if (content instanceof TermDto){
-            facets.add(new Facet(((TermDto)content).getVocRepresentation_L10n(), termType!=null?termType.getLabel():null));
+               String vocString =((TermDto)content).getVocabularyDto() != null?((TermDto)content).getVocabularyDto().getTitleCache():null;
+               vocString = vocString != null? vocString: (termType!= null? termType.getLabel():null);
+            facets.add(new Facet(((TermDto)content).getVocabularyDto() != null?((TermDto)content).getVocabularyDto().getTitleCache():"", termType!= null?termType.getLabel():"" ));
         }else{
             facets.add(new Facet(content.getRepresentation_L10n(), termType!=null?termType.getLabel():null));
         }
         return facets;
     }
-
-}
+}
\ No newline at end of file
index b7af9ee7ec3f9d081e163fb222bb98f252480c9c..3d86103d14a2c407fb351b7acbb515a05fa046f0 100644 (file)
@@ -14,6 +14,7 @@ import java.util.HashSet;
 import java.util.UUID;
 import java.util.stream.Collectors;
 
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -52,11 +53,8 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
 
     private Collection<Image> imageBuffer;
 
-
-
     public TermSearchResultComposite(TermSearchResult result, Composite parent, int style) {
         super(result, parent, style);
-
     }
 
     @Override
@@ -65,7 +63,6 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
             image.dispose();
             imageBuffer = null;
         }
-
         super.dispose();
     }
 
@@ -77,7 +74,8 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
         content.setLayout(layout);
         Label label = new Label(content, SWT.WRAP);
         label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
-        label.setText(result.getContent().getRepresentation_L10n());
+        String termLabel = CdmUtils.Nz(StringUtils.replace(result.getContent().getRepresentation_L10n(), "&", "&&"));
+        label.setText(termLabel);
         label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
         GridDataFactory.fillDefaults().applyTo(label);
 
@@ -88,7 +86,7 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
                 .collect(Collectors.joining(","));
         if (CdmUtils.isNotBlank(facetText)) {
             Label labelFacets = new Label(content, SWT.WRAP);
-            labelFacets.setText(facetText);
+            labelFacets.setText(StringUtils.replace(facetText, "&", "&&"));
             labelFacets.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));
         }
         // description
@@ -105,7 +103,9 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
                 }
             });
             lblDescription.setText(representation_L10n_text);
+            lblDescription.setText(StringUtils.replace(representation_L10n_text, "&", "&&"));
         }
+
         // media
         if (result.getContent() instanceof TermDto){
             Collection<UUID> mediaUuids = ((TermDto)result.getContent()).getMedia();
@@ -171,8 +171,4 @@ public class TermSearchResultComposite extends CheckBoxSearchResultComposite<Abs
         }
         return content;
     }
-
-
-
-
-}
+}
\ No newline at end of file
index 0b4203a0ad936fc1a6eeb4c5c54f8adee40e48a1..2956d802eeb33ddc91dd2d3747d90802f35c38a1 100644 (file)
@@ -33,11 +33,12 @@ 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.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.taxeditor.preference.BiocaseProvideConfig;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
@@ -86,7 +87,9 @@ public class SpecimenProviderSelectionComposite extends Composite {
         toolkit.adapt(lblAccessPointUrl, true, true);
         lblAccessPointUrl.setText("Access Point URL");
         txtAccessPoint = new Combo(this, SWT.BORDER);
-        txtAccessPoint.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+        TableWrapData layoutData = new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP, 1, 1);
+        layoutData.maxWidth = 300;
+        txtAccessPoint.setLayoutData(layoutData);
         toolkit.adapt(txtAccessPoint, true, true);
 //        new Label(this, SWT.NONE);
         btnGbif = new Button(this, SWT.RADIO);
@@ -99,7 +102,10 @@ public class SpecimenProviderSelectionComposite extends Composite {
         try {
             url = new URL("https://www.biocase.org/whats_biocase/gbif_biocase.cgi");
 
-            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            HttpURLConnection conn;
+
+                conn = (HttpURLConnection) url.openConnection();
+
             conn.setRequestProperty("Accept", "application/json");
     //        conn.setConnectTimeout(TIMEOUT*9);
     //        conn.setReadTimeout(TIMEOUT*9);
@@ -121,46 +127,39 @@ public class SpecimenProviderSelectionComposite extends Composite {
             e.printStackTrace();
         }
 
-        JSONArray jsonResponseArray;
+        java.util.List<BiocaseProvideConfig> listProvider = null;
+        ObjectMapper mapper = new ObjectMapper();
         try {
-            jsonResponseArray =new JSONArray(response);
-
-            int i = 0;
-            String service_url = null;
-            JSONArray dataSets = null;
-//            items = new String[jsonResponseArray.length()];
-            while (i<jsonResponseArray.length()){
-                JSONObject object = jsonResponseArray.getJSONObject(i);
-                service_url = (String) object.get("service_url");
-                if (service_url != null){
-                    if (itemList.add(service_url)){
-                        dataSets = (JSONArray) object.get("datasets");
-                        if (service_url != null){
-                            int j = 0;
-                            while ( j < dataSets.length()){
-                                String title = ((JSONObject)dataSets.get(j)).getString("title");
-                                itemList.add(title+" - "+ service_url);
-                                txtAccessPoint.add(title+" - "+ service_url);
-                                //create object with title and service url to add as data
-                                txtAccessPoint.setData(title+" - "+ service_url, title);
-                                j++;
-                            }
-
-                        }
-
-
+            listProvider = mapper.readValue(response, new TypeReference<java.util.List<BiocaseProvideConfig>>(){});
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
 
-//                        txtAccessPoint.add(service_url);
+        int i = 0;
+        String service_url = null;
+        String[] datasets = null;
+        for (BiocaseProvideConfig conf: listProvider) {
+
+            service_url = conf.getService_url();
+            if (service_url != null){
+                if (itemList.add(service_url)){
+                    int j = 0;
+                    while ( j < conf.getDatasets().length){
+                        String title = conf.getDatasets()[j];
+                        itemList.add(title+" - "+ service_url);
+                        txtAccessPoint.add(title+" - "+ service_url);
+                        //create object with title and service url to add as data
+                        txtAccessPoint.setData(title+" - "+ service_url, title);
+                        j++;
                     }
-//                    items[i] = service_url;
+                    //                    txtAccessPoint.add(service_url);
                 }
-                i++;
+//                items[i] = service_url;
             }
-
-        } catch (JSONException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            i++;
         }
+
+
         String biocaseProvider = PreferencesUtil.getStringValue(PreferencePredicate.BioCaseProvider.getKey());
         if (biocaseProvider != null){
             String items[] = biocaseProvider.split(";");
index 1e7b3eaca720dee2d798368bf454691d6aa0a314..a033432b2a57a244103f715a7d0a47a05988fd6b 100644 (file)
@@ -74,7 +74,7 @@ public class InspectSessionsDialog extends Dialog {
     public InspectSessionsDialog(Shell parent, int style) {
         super(parent, style);
         setText("Inspect Active Session");
-        cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+        cdmlibModelCache = CdmRemoteCacheManager.INSTANCE().getCdmModelGetMethodsCache();
         activeSession = CdmStore.getCurrentSessionManager().getActiveSession();
         if (activeSession != null){
             //TODO
index ec7994803b2bc546856a5c06e9a72533b66fe5ee..78ba77796e5216a5e51563626359980083d58991 100644 (file)
@@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.wb.swt.SWTResourceManager;
 
-import eu.etaxonomy.cdm.api.cache.CdmCacherBase;
+import eu.etaxonomy.cdm.api.cache.CdmPermanentCacheBase;
 import eu.etaxonomy.cdm.cache.CdmRemoteCacheManager;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
@@ -58,10 +58,10 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
     private final ICdmEntitySessionManager cdmEntitySessionManager;
     private Text txtNoOfSessions;
     private Text txtNoOfCaches;
-    private Text txtDefaultInMemory;
+    private Text txtPermanentInMemory;
     private Text txtCdmModelInMemory;
     private Text txtCdmModelOnDisk;
-    private Text txtDefaultOnDisk;
+    private Text txtPermanentOnDisk;
 
     @Inject
     private ECommandService commandService;
@@ -81,6 +81,7 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
      * Create contents of the view part.
      * @param parent
      */
+    @SuppressWarnings("unused")
     @PostConstruct
     public void createPartControl(Composite parent) {
         Composite container = new Composite(parent, SWT.NONE);
@@ -127,40 +128,40 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
         new Label(container, SWT.NONE);
 
         {
-            Label lblDefaultCache = new Label(container, SWT.CENTER);
-            lblDefaultCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-            lblDefaultCache.setText("Default Cache, ");
-            lblDefaultCache.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
-            lblDefaultCache.setAlignment(SWT.RIGHT);
+            Label lblPermanentCache = new Label(container, SWT.CENTER);
+            lblPermanentCache.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblPermanentCache.setText("Permanent Cache, ");
+            lblPermanentCache.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblPermanentCache.setAlignment(SWT.RIGHT);
         }
         {
-            Label lblDefaultInMemory = new Label(container, SWT.CENTER);
-            lblDefaultInMemory.setText("in Memory : ");
-            lblDefaultInMemory.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
-            lblDefaultInMemory.setAlignment(SWT.RIGHT);
-            lblDefaultInMemory.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            Label lblPermanentInMemory = new Label(container, SWT.CENTER);
+            lblPermanentInMemory.setText("in Memory : ");
+            lblPermanentInMemory.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblPermanentInMemory.setAlignment(SWT.RIGHT);
+            lblPermanentInMemory.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
         }
         {
-            txtDefaultInMemory = new Text(container, SWT.BORDER);
-            txtDefaultInMemory.setEditable(false);
-            GridData gd_txtDefaultInMemory = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
-            gd_txtDefaultInMemory.widthHint = 130;
-            txtDefaultInMemory.setLayoutData(gd_txtDefaultInMemory);
+            txtPermanentInMemory = new Text(container, SWT.BORDER);
+            txtPermanentInMemory.setEditable(false);
+            GridData gd_txtPermanentInMemory = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtPermanentInMemory.widthHint = 130;
+            txtPermanentInMemory.setLayoutData(gd_txtPermanentInMemory);
         }
         {
-            Label lblDefaultOnDisk = new Label(container, SWT.CENTER);
-            lblDefaultOnDisk.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-            lblDefaultOnDisk.setText("on Disk : ");
-            lblDefaultOnDisk.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
-            lblDefaultOnDisk.setAlignment(SWT.RIGHT);
+            Label lblPermanentOnDisk = new Label(container, SWT.CENTER);
+            lblPermanentOnDisk.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+            lblPermanentOnDisk.setText("on Disk : ");
+            lblPermanentOnDisk.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
+            lblPermanentOnDisk.setAlignment(SWT.RIGHT);
         }
         {
-            txtDefaultOnDisk = new Text(container, SWT.BORDER);
-            txtDefaultOnDisk.setEditable(false);
-            txtDefaultOnDisk.setText("");
-            GridData gd_txtDefaultOnDisk = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
-            gd_txtDefaultOnDisk.widthHint = 130;
-            txtDefaultOnDisk.setLayoutData(gd_txtDefaultOnDisk);
+            txtPermanentOnDisk = new Text(container, SWT.BORDER);
+            txtPermanentOnDisk.setEditable(false);
+            txtPermanentOnDisk.setText("");
+            GridData gd_txtPermanentOnDisk = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+            gd_txtPermanentOnDisk.widthHint = 130;
+            txtPermanentOnDisk.setLayoutData(gd_txtPermanentOnDisk);
         }
         {
             Label lblCdmModelCache = new Label(container, SWT.CENTER);
@@ -274,17 +275,17 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
             }
         }
 
-        CdmRemoteCacheManager instance = CdmRemoteCacheManager.getInstance();
+        CdmRemoteCacheManager instance = CdmRemoteCacheManager.INSTANCE();
         int cdmEnityCacheSize = CacheManager.create().getCacheNames().length;
         txtNoOfCaches.setText(String.valueOf(cdmEnityCacheSize));
 
-        Cache defaultCache = CacheManager.create().getCache(CdmCacherBase.DEFAULT_CACHE_NAME);
-        txtDefaultInMemory.setText("");
-        txtDefaultOnDisk.setText("");
-        if(defaultCache != null) {
-               FlatStatistics liveCacheStatistics = defaultCache.getStatistics();
-            txtDefaultInMemory.setText(getInMemoryStats(liveCacheStatistics));
-            txtDefaultOnDisk.setText(getOnDiskStats(liveCacheStatistics));
+        Cache permanentCache = CacheManager.create().getCache(CdmPermanentCacheBase.PERMANENT_CACHE_NAME);
+        txtPermanentInMemory.setText("");
+        txtPermanentOnDisk.setText("");
+        if(permanentCache != null) {
+               FlatStatistics liveCacheStatistics = permanentCache.getStatistics();
+            txtPermanentInMemory.setText(getInMemoryStats(liveCacheStatistics));
+            txtPermanentOnDisk.setText(getOnDiskStats(liveCacheStatistics));
         }
 
         Cache cdmModelGetMethodsCache = instance.getCdmModelGetMethodsCache();
@@ -295,7 +296,6 @@ public class SessionsViewPart implements ICdmEntitySessionManagerObserver {
             txtCdmModelInMemory.setText(getInMemoryStats(liveCacheStatistics));
             txtCdmModelOnDisk.setText(getOnDiskStats(liveCacheStatistics));
         }
-
     }
 
     private void addSession(ICdmEntitySession session) {
index 578f82b3e4a11632fedb6306954b268b02bd98b4..ba94686376ae9939913792ce51e792a3163e2957 100644 (file)
@@ -21,10 +21,7 @@ import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.wb.swt.SWTResourceManager;
 
-import eu.etaxonomy.cdm.api.service.IVocabularyService;
-import eu.etaxonomy.cdm.model.term.TermVocabulary;
 import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.combo.termvocabulary.TermVocabularyComboViewer;
 
 /**
@@ -88,13 +85,13 @@ public class GfBioTerminologyImportComposite extends Composite{
         btnChooseOntology = new Button(composite_3, SWT.NONE);
         btnChooseOntology.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
 
-        lblNewLabel_4 = new Label(composite_3, SWT.NONE);
-        lblNewLabel_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        lblNewLabel_4.setText("Import Vocabulary");
-
-        termVocabularyComboViewer = new TermVocabularyComboViewer(composite_3, SWT.NONE);
-        termVocabularyComboViewer.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
-        termVocabularyComboViewer.setInput(CdmStore.getService(IVocabularyService.class).list(TermVocabulary.class, null, null, null, null));
+//        lblNewLabel_4 = new Label(composite_3, SWT.NONE);
+//        lblNewLabel_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+//        lblNewLabel_4.setText("Import Vocabulary");
+//
+//        termVocabularyComboViewer = new TermVocabularyComboViewer(composite_3, SWT.NONE);
+//        termVocabularyComboViewer.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
+//        termVocabularyComboViewer.setInput(CdmStore.getService(IVocabularyService.class).list(TermVocabulary.class, null, null, null, null));
 
         btnRemoveVocabulary = new Button(composite_3, SWT.NONE);
         btnRemoveVocabulary.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
index bfd120dd7115f5dc7539fde724a27e124ea12b70..9d2619c71d41862fca6d3a29044a53e50921e040 100644 (file)
@@ -38,7 +38,8 @@ import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
-import org.json.JSONException;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
 
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.taxeditor.l10n.Messages;
@@ -190,7 +191,7 @@ public class GfBioTerminologyImportPresenter {
                 String response = new RequestTerminologies().request();
                 try {
                     availableOntologies = TerminologyParser.parse(response);
-                } catch (JSONException e) {
+                } catch (JsonProcessingException e) {
                     MessagingUtils.errorDialog("Loading ontologies failed", this, "Ontologies could not be found", TaxeditorStorePlugin.PLUGIN_ID, e, false);
                     e.printStackTrace();
                 }
@@ -259,7 +260,11 @@ public class GfBioTerminologyImportPresenter {
                     return Status.CANCEL_STATUS;
                 }
                 final List<OntologyTermWrapper> wrapperList = new ArrayList<>();
-                wrapperList.addAll(TermParser.parse(response));
+                try {
+                    wrapperList.addAll(TermParser.parse(response));
+                } catch (JsonProcessingException e) {
+                    e.printStackTrace();
+                }
                 if(wrapperList.isEmpty()){
                     MessagingUtils.informationDialog(Messages.GfBioTerminologyImportPresenter_NO_RESULTS_TITLE, Messages.GfBioTerminologyImportPresenter_NO_RESULTS_MESSAGE);
                 }
index 05cc3b288f377317109d0dccdfd94195d9c410b6..052492abbfa897579ed065407226db24b4db059f 100644 (file)
@@ -13,6 +13,8 @@ import java.util.Collection;
 
 import org.eclipse.jface.viewers.ITreeContentProvider;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+
 import eu.etaxonomy.taxeditor.view.webimport.termimport.parser.OntologyTermParser;
 import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestBroader;
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
@@ -38,8 +40,14 @@ public class OntologyTermContentProvider implements ITreeContentProvider {
         if(parentElement instanceof OntologyTermWrapper){
             OntologyTermWrapper wrapper = (OntologyTermWrapper) parentElement;
             String response = new RequestBroader(wrapper.getUri(), wrapper.getSourceTerminology()).request();
-            Collection<OntologyTermWrapper> broader = OntologyTermParser.parse(response, ((OntologyTermWrapper) parentElement).getSourceTerminology());
-            return broader.toArray();
+            Collection<OntologyTermWrapper> broader;
+            try {
+                broader = OntologyTermParser.parse(response, ((OntologyTermWrapper) parentElement).getSourceTerminology());
+                return broader.toArray();
+            } catch (JsonProcessingException e) {
+                e.printStackTrace();
+            }
+
         }
         return null;
     }
index 11df63631e451d8ede6b4e26cba809d6fdd07e89..5f700a442f88e50e32932b9cf7052f0c4c474041 100644 (file)
@@ -11,9 +11,9 @@ package eu.etaxonomy.taxeditor.view.webimport.termimport.parser;
 import java.util.Collection;
 import java.util.LinkedList;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.HierarchyTermWrapper;
 
@@ -23,26 +23,38 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.HierarchyTermWra
  *
  */
 public class HierarchyParser {
-    public static Collection<HierarchyTermWrapper> parse(String response){
+    public static Collection<HierarchyTermWrapper> parse(String response) throws JsonProcessingException{
         LinkedList<HierarchyTermWrapper> wrapperList = new LinkedList<>();
+        JsonNode tree = null;
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode resultNode = null;
+        HierarchyTermWrapper childTerm = null;
         try {
-            JSONObject jsonResponse = new JSONObject(response);
-            JSONArray responseArray = ParserUtil.parseResults(jsonResponse);
-            HierarchyTermWrapper childTerm = null;
-            for(int i=0;i<responseArray.length();i++){
-                JSONObject jsonObject = responseArray.getJSONObject(i);
-                String label = ParserUtil.parseLabel(jsonObject);
-                String uri= ParserUtil.parseUri(jsonObject);
-                HierarchyTermWrapper hierarchyTermWrapper = new HierarchyTermWrapper(uri, label);
-                wrapperList.add(hierarchyTermWrapper);
-                if(childTerm!=null){
-                    childTerm.setParentTerm(hierarchyTermWrapper);
+            tree =  mapper.readTree(response);
+            if (tree != null) {
+                resultNode =ParserUtil.parseResults(tree);
+
+                for (int i = 0; i < resultNode.size(); i++) {
+                    JsonNode node = resultNode.get(i);
+                    String uri = ParserUtil.parseUri(node);
+                    String label = ParserUtil.parseLabel(node);
+                    HierarchyTermWrapper hierarchyTermWrapper = new HierarchyTermWrapper(uri, label, null);
+                    if (childTerm != null) {
+                        childTerm.setParentTerm(hierarchyTermWrapper);
+                    }
+                    childTerm = hierarchyTermWrapper;
+                    wrapperList.add(hierarchyTermWrapper);
                 }
-                childTerm = hierarchyTermWrapper;
+
             }
-        } catch (JSONException jsonException) {
-            jsonException.printStackTrace();
-        }
+         } catch (JsonProcessingException e1) {
+
+             throw e1;
+         }
+
+
+
+
         return wrapperList;
     }
 
index c9f5fbe56bbcf85f4d9b15ab2668a73e8d61ce54..986093952f37ec5171f8438de4b83b4b657561f0 100644 (file)
@@ -12,9 +12,10 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
 
@@ -24,19 +25,21 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrap
  *
  */
 public class OntologyTermParser {
-    public static Collection<OntologyTermWrapper> parse(String response, String terminology){
+    public static Collection<OntologyTermWrapper> parse(String response, String terminology) throws JsonMappingException, JsonProcessingException{
         List<OntologyTermWrapper> wrapperList = new ArrayList<>();
-        try {
-            JSONObject jsonResponse = new JSONObject(response);
-            JSONArray responseArray = ParserUtil.parseResults(jsonResponse);
-            for(int i=0;i<responseArray.length();i++){
-                JSONObject jsonObject = responseArray.getJSONObject(i);
-                String label = ParserUtil.parseLabel(jsonObject);
-                String uriString = ParserUtil.parseUri(jsonObject);
+
+        JsonNode tree = null;
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode resultNode = null;
+
+        tree =  mapper.readTree(response);
+        if (tree != null) {
+            resultNode =tree.get("results");
+            for (int i = 0; i < resultNode.size(); i++) {
+                String label = ParserUtil.parseLabel(resultNode.get(i));
+                String uriString = ParserUtil.parseUri(resultNode.get(i));
                 wrapperList.add(new OntologyTermWrapper(uriString, label, terminology));
             }
-        } catch (JSONException e) {
-            e.printStackTrace();
         }
         return wrapperList;
     }
index 12a42ece91d9fcc0757099a8652902e4099f9539..1bc0c50b6549cff3849089c1186bb0094cc5f9bc 100644 (file)
@@ -11,9 +11,9 @@ package eu.etaxonomy.taxeditor.view.webimport.termimport.parser;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
 
 import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestTerm;
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
@@ -25,47 +25,50 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrap
  */
 public class ParserUtil {
 
-    public static JSONArray parseResults(JSONObject jsonObject) throws JSONException{
-        return jsonObject.getJSONArray("results");
+    public static JsonNode parseResults(JsonNode jsonObject) {
+        return jsonObject.get("results");
     }
 
-    public static String parseUri(JSONObject jsonObject) throws JSONException{
-        return jsonObject.getString("uri");
+    public static String parseUri(JsonNode jsonObject){
+        return jsonObject.get("uri").textValue();
     }
 
-    public static String parseLabel(JSONObject jsonObject) throws JSONException{
-        return jsonObject.getString("label");
+    public static String parseLabel(JsonNode jsonObject) {
+        return jsonObject.get("label").textValue();
     }
 
-    public static String parseDescription(JSONObject jsonObject) throws JSONException{
+    public static String parseDescription(JsonNode jsonObject) {
         String descriptionKey = "description";
         if(jsonObject.has(descriptionKey)){
-            return jsonObject.getString(descriptionKey);
+            return jsonObject.get(descriptionKey).textValue();
         }
         return null;
     }
 
-    public static List<String> parseSynonyms(JSONObject jsonObject) throws JSONException{
+    public static List<String> parseSynonyms(JsonNode jsonObject) {
         List<String> synonyms = new ArrayList<>();
         String synomymKey = "synonyms";
         if(jsonObject.has(synomymKey)){
-             JSONArray jsonArray = jsonObject.getJSONArray(synomymKey);
-             for(int i=0;i<jsonArray.length();i++){
-                 synonyms.add(jsonArray.getString(i));
+             JsonNode jsonArray = jsonObject.get(synomymKey);
+             for(int i=0;i<jsonArray.size();i++){
+                 //TODO: check whether this is correct!!!
+                 synonyms.add(jsonArray.get(i).textValue());
              }
         }
         return synonyms;
     }
 
-    public static String parseTerminology(JSONObject jsonObject) throws JSONException {
-        return jsonObject.getString("sourceTerminology");
+    public static String parseTerminology(JsonNode jsonObject){
+        return jsonObject.get("sourceTerminology").textValue();
     }
 
     /**
      * Loads and sets detail information for the given wrapper
      * @param wrapper the wrapper for which the detailed information will be loaded and set
+     * @throws JsonProcessingException
+     * @throws JsonMappingException
      */
-    public static void loadDetails(OntologyTermWrapper wrapper) {
+    public static void loadDetails(OntologyTermWrapper wrapper) throws JsonMappingException, JsonProcessingException {
         String request = new RequestTerm(wrapper.getUri(), wrapper.getSourceTerminology()).request();
         OntologyTermWrapper detailTerm = TermParser.parseSingleTerm(request);
         wrapper.setDescription(detailTerm.getDescription());
index 8bfa874d1da3208c8755d9c9f4cb2c0b216246c9..61fc73563dd6796523a02c9037ae4c8533748ee4 100644 (file)
@@ -12,11 +12,11 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
-import eu.etaxonomy.taxeditor.view.webimport.termimport.requests.RequestTerm;
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
 
 /**
@@ -25,23 +25,22 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrap
  *
  */
 public class SuggestParser {
-    public static Collection<OntologyTermWrapper> parse(String response){
+    public static Collection<OntologyTermWrapper> parse(String response) throws JsonMappingException, JsonProcessingException{
         List<OntologyTermWrapper> wrapperList = new ArrayList<>();
-        try {
-            JSONObject jsonResponse = new JSONObject(response);
-            JSONArray responseArray = ParserUtil.parseResults(jsonResponse);
-            for(int i=0;i<responseArray.length();i++){
-                JSONObject jsonObject = responseArray.getJSONObject(i);
-                String label = ParserUtil.parseLabel(jsonObject);
-                String uri= ParserUtil.parseUri(jsonObject);
-                String sourceTerminology = ParserUtil.parseTerminology(jsonObject);
-                String request = new RequestTerm(uri, sourceTerminology).request();
-                OntologyTermWrapper wrapper = new OntologyTermWrapper(uri, label, sourceTerminology);
-                wrapperList.add(wrapper);
-            }
-        } catch (JSONException jsonException) {
-            jsonException.printStackTrace();
+        ObjectMapper mapper = new ObjectMapper();
+
+        JsonNode tree =  mapper.readTree(response);
+        JsonNode resultNode = ParserUtil.parseResults(tree);
+        for(int i=0;i<resultNode.size();i++){
+            JsonNode jsonObject = resultNode.get(i);
+            String label = ParserUtil.parseLabel(jsonObject);
+            String uri= ParserUtil.parseUri(jsonObject);
+            String sourceTerminology = ParserUtil.parseTerminology(jsonObject);
+            //String request = new RequestTerm(uri, sourceTerminology).request();
+            OntologyTermWrapper wrapper = new OntologyTermWrapper(uri, label, sourceTerminology);
+            wrapperList.add(wrapper);
         }
+
         return wrapperList;
     }
 
index 36c13c83d8dc58ac9bd0101b07e7196dfc35eaa2..ff9d7d00d7e06482f257d64ae4bfc1de5b640381 100644 (file)
@@ -11,9 +11,10 @@ package eu.etaxonomy.taxeditor.view.webimport.termimport.parser;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper;
 
@@ -23,36 +24,36 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrap
  *
  */
 public class TermParser {
-    public static OntologyTermWrapper parseSingleTerm(String response){
-        try {
-            JSONObject jsonResponse = new JSONObject(response);
-            JSONArray responseArray = ParserUtil.parseResults(jsonResponse);
-            for(int i=0;i<responseArray.length();i++){
-                JSONObject jsonObject = responseArray.getJSONObject(i);
-                return createWrapper(jsonObject);
-            }
-        } catch (JSONException e) {
-            e.printStackTrace();
+    public static OntologyTermWrapper parseSingleTerm(String response) throws JsonMappingException, JsonProcessingException{
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode resultNode = null;
+
+        JsonNode tree = mapper.readTree(response);
+        JsonNode responseNode = ParserUtil.parseResults(tree);
+        for(int i=0;i<responseNode.size();i++){
+            JsonNode jsonObject = responseNode.get(i);
+            return createWrapper(jsonObject);
         }
+
         return null;
     }
 
-    public static List<OntologyTermWrapper> parse(String response){
+    public static List<OntologyTermWrapper> parse(String response) throws JsonMappingException, JsonProcessingException{
         List<OntologyTermWrapper> wrapperList = new ArrayList<>();
-        try {
-            JSONObject jsonResponse = new JSONObject(response);
-            JSONArray responseArray = ParserUtil.parseResults(jsonResponse);
-            for(int i=0;i<responseArray.length();i++){
-                JSONObject jsonObject = responseArray.getJSONObject(i);
-                wrapperList.add(createWrapper(jsonObject));
-            }
-        } catch (JSONException e) {
-            e.printStackTrace();
+        ObjectMapper mapper = new ObjectMapper();
+
+        JsonNode tree = mapper.readTree(response);
+
+        JsonNode resultNode = ParserUtil.parseResults(tree);
+        for(int i=0;i<resultNode.size();i++){
+            JsonNode jsonObject = resultNode.get(i);
+            wrapperList.add(createWrapper(jsonObject));
         }
+
         return wrapperList;
     }
 
-    private static OntologyTermWrapper createWrapper(JSONObject jsonObject) throws JSONException{
+    private static OntologyTermWrapper createWrapper(JsonNode jsonObject) {
         String description = ParserUtil.parseDescription(jsonObject);
         String label = ParserUtil.parseLabel(jsonObject);
         String uri= ParserUtil.parseUri(jsonObject);
index 1de37c16a504edd9d48b5aff528cc12ea3bd69b4..04ee0d98cacd1a46e1f97d68b2159043de680082 100644 (file)
@@ -12,9 +12,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
 
 import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.TerminologyWrapper;
 
@@ -24,18 +24,32 @@ import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.TerminologyWrapp
  *
  */
 public class TerminologyParser {
-    public static Collection<TerminologyWrapper> parse(String response) throws JSONException{
+    public static Collection<TerminologyWrapper> parse(String response) throws JsonProcessingException {
         List<TerminologyWrapper> wrapperList = new ArrayList<>();
-        JSONObject jsonResponse = new JSONObject(response);
-        JSONArray responseArray = jsonResponse.getJSONArray("results");
-        for(int i=0;i<responseArray.length();i++){
-            JSONObject jsonObject = responseArray.getJSONObject(i);
-            String name = jsonObject.getString("name");
-            String acronym = jsonObject.getString("acronym");
-            String description = ParserUtil.parseDescription(jsonObject);
-            String uri = ParserUtil.parseUri(jsonObject);
-            wrapperList.add(new TerminologyWrapper(name, acronym, description, uri));
+        JsonNode tree = null;
+        ObjectMapper mapper = new ObjectMapper();
+        JsonNode resultNode = null;
+        try {
+           tree =  mapper.readTree(response);
+           if (tree != null) {
+               resultNode =tree.get("results");
+
+               for (int i = 0; i < resultNode.size(); i++) {
+                   JsonNode node = resultNode.get(i);
+                   String name = node.get("name").textValue();
+                   String acronym = node.get("acronym").textValue();
+                   String description = ParserUtil.parseDescription(node);
+                   String uri = ParserUtil.parseUri(node);
+                   wrapperList.add(new TerminologyWrapper(name, acronym, description, uri));
+               }
+
+           }
+        } catch (JsonProcessingException e1) {
+            // TODO Auto-generated catch block
+            throw e1;
         }
+
+
         return wrapperList;
     }
 
index 7a1aab10142165e9de314853135251f7670f139f..176a6ab1d144fba9ae21568e793e031eb5cf5158 100644 (file)
@@ -16,8 +16,9 @@ package eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper;
 public class HierarchyTermWrapper extends TermWrapper{
 
     private HierarchyTermWrapper parentTerm;
-    public HierarchyTermWrapper(String uri, String label) {
+    public HierarchyTermWrapper(String uri, String label, HierarchyTermWrapper parentTerm) {
         super(uri, label);
+        this.parentTerm = parentTerm;
     }
     public HierarchyTermWrapper getParentTerm() {
         return parentTerm;
index be43af0fc20398d058b49281da8867f822a5c5cc..e0bf2dcddad1b5c4d552c61878bcbd8fbf446fe7 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -12,7 +12,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.name.INonViralName;
 import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
@@ -27,24 +26,21 @@ public class NameProtectTitleCacheTest /*extends CdmIntegrationTest */{
 
 //     @SpringBeanByType
        @SuppressWarnings("unused")
-       private CdmStore cdmStore;// = CdmStore.getDefault();   
-       
-       @SuppressWarnings("unused")
-       private ConversationHolder conversation;
+       private CdmStore cdmStore;// = CdmStore.getDefault();
 
        private INonViralName name;
 
        @Before
        public void setUp() throws Exception {
-               
+
                (new DefaultTermInitializer()).initialize();
-               
+
                name = TaxonNameFactory.NewNonViralInstance(Rank.SPECIES());
-               
+
                name.setGenusOrUninomial("Joe");
                name.setSpecificEpithet("mama");
        }
-       
+
        @Test
        public void testProtectTitleCache(){
                Assert.assertTrue(name.isProtectedTitleCache() == false);
index fc6281ae9e1d1135a783ddfa5825551ed75a880b..05ae47250324eb5b3363a8c72cd5b6a50f862fe5 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: eu.etaxonomy.taxeditor.test
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: EDIT
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
index 05563a0c86e444826b9f51803216691908ae386a..5c48ff2fd0124268ebe626aa0b338fe23affdbb1 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
   <artifactId>eu.etaxonomy.taxeditor.test</artifactId>
   <!-- for packaging=eclipse-test-plugin 
index e4b4cecc607ff94b07067f7ee07e8bce5fd6155a..38a79aebaf85cdb5a4463925c838b4706b01a20c 100644 (file)
@@ -25,7 +25,7 @@ import org.unitils.spring.annotation.SpringApplicationContext;
 import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.api.application.CdmDataChangeService;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.cache.CdmRemoteCacheManager;
 import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.remoting.cache.ConversationalTransientEntityCacher;
@@ -93,7 +93,7 @@ public abstract class BaseRemotingTest extends ThreadedTest {
                         null,
                         null);
         CdmApplicationState.setCurrentAppConfig(remoteApplicationController);
-        CdmApplicationState.setCdmServiceCacher(new CdmServiceCacher());
+        CdmApplicationState.setTermProxy(new CdmServiceCachingProxy());
 
         cdmEntitySessionManager = getRemoteApplicationController().getCdmEntitySessionManager();
 
index a421684329d3765d957f54d2a5f1e30aaad5dcc6..bef18b1b2f48a50ed2457735c8c51edad82b5ec9 100644 (file)
@@ -14,7 +14,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
 
@@ -23,7 +23,7 @@ public class CdmServiceCacherTest extends RemotingSessionAwareTest {
     @SuppressWarnings("unused")
     private static final Logger logger = LogManager.getLogger(CdmServiceCacherTest.class);
 
-       private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
+       private static CdmServiceCachingProxy cdmServiceCacher = CdmApplicationState.getTermProxy();
 
        @Test
        public void testLanguageCache() {
index ff272ce29b6ca98e7105c72781f18e1ac2ab5fb3..cacc071c905c5a6d475338d7093149920a29cbee 100644 (file)
@@ -16,7 +16,8 @@ import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -50,7 +51,7 @@ import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
 @Ignore
 public class RemoteLazyLoadingTest extends BaseRemotingTest {
 
-    private static final Logger logger = LogManager.getLogger(RemoteLazyLoadingTest.class);
+    private static final Logger logger = LogManager.getLogger();
 
     private static IClassificationService classificationService;
     private static ITaxonService taxonService;
@@ -73,11 +74,8 @@ public class RemoteLazyLoadingTest extends BaseRemotingTest {
 //        Assert.assertNotNull(classification);
         taxonNodes = classificationService.getAllNodes();
         Assert.assertFalse(taxonNodes.isEmpty());
-
     }
 
-
-
     @Test
     public void testCDMEntityGet() {
         Iterator<TaxonNode> taxonNodeItr = taxonNodes.iterator();
@@ -101,8 +99,6 @@ public class RemoteLazyLoadingTest extends BaseRemotingTest {
 
             count++;
         }
-
-
     }
 
     @Test
@@ -231,6 +227,7 @@ public class RemoteLazyLoadingTest extends BaseRemotingTest {
 
         Assert.assertEquals("Title caches should be equal",oldTitleCache,nvnOld.getTitleCache());
     }
+
     @Ignore
     @Test
     public void testCDMEntitySaveCollection() {
similarity index 98%
rename from eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java
rename to eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonEditorTest.java
index 6a77b722c187e6004dc9b635276698a18199218f..b1cb49975f3624b095a8c740f8da8ec70a470294 100644 (file)
@@ -48,10 +48,10 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 3 Feb 2015
  */
 @DataSet
-public class TaxonNameEditorTest extends BaseOperationTest {
+public class TaxonEditorTest extends BaseOperationTest {
 
     @SuppressWarnings("unused")
-       private static final Logger logger = LogManager.getLogger(TaxonNameEditorTest.class);
+       private static final Logger logger = LogManager.getLogger();
 
     private ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
     private ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
index 464e2f9a108848ed88104ad8a0a276f987600a7d..9101185f9ca60e477ce3d68cff3056dbee14f7b8 100644 (file)
@@ -14,7 +14,8 @@ import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.commands.ExecutionException;
 import org.junit.Assert;
 import org.junit.Ignore;
@@ -50,14 +51,13 @@ import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
 public class TaxonNavigatorTest extends BaseOperationTest {
 
     @SuppressWarnings("unused")
-       private static final Logger logger = LogManager.getLogger(TaxonNameEditorTest.class);
+       private static final Logger logger = LogManager.getLogger();
 
-    ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
-    ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
-    IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
-
-    Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
+    private ITaxonNodeService taxonNodeService = getRemoteApplicationController().getTaxonNodeService();
+    private ITaxonService taxonService = getRemoteApplicationController().getTaxonService();
+    private IClassificationService classificationService = getRemoteApplicationController().getClassificationService();
 
+    private Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
 
     @Test
     public void testChangeAcceptedTaxonToSynonym() throws ExecutionException {
@@ -84,8 +84,6 @@ public class TaxonNavigatorTest extends BaseOperationTest {
         Assert.assertNull(oldTaxonNode);
         Assert.assertEquals(countTargetSynonyms + 1,newAcceptedTaxonNode.getTaxon().getSynonyms().size());
         Assert.assertEquals(name, newAcceptedTaxonNode.getTaxon().getSynonyms().iterator().next().getName());
-
-
     }
 
     @Test
index a125b3369b148e87c357e4f50e853886d007f618..e75ce2c0557324671b2b11aef9d9804a5ae41f1a 100644 (file)
@@ -31,7 +31,6 @@ import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
 import eu.etaxonomy.cdm.model.name.TaxonName;
@@ -96,17 +95,7 @@ public class IOServiceImportTest extends BaseRemotingTest {
         Assert.assertEquals(9,list.size());
     }
 
-    @Test
-    public void importSpecimenExcel() throws IOException {
-        String importFilePath = "src/test/resources/imports/SpecimenExcelImport.xls";
-        SpecimenCdmExcelImportConfigurator config = SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
-        config.setNomenclaturalCode(NomenclaturalCode.ICNP);
-        config.setDbSchemaValidation(DbSchemaValidation.CREATE);
-        ImportResult result = ioService.importData(config, fileToByteArray(importFilePath), SOURCE_TYPE.URI);
-        Assert.assertTrue(result.isSuccess());
-//        List<SpecimenOrObservationBase> occurrences = occurrenceService.list(SpecimenOrObservationBase.class, null, null, null, null);
-//        Assert.assertEquals(3,occurrences.size());
-    }
 
     @Test
     public void importTCS() throws IOException {
index 3bea4b29df2765a747817b117cee2e96ad4eb3da..145816d00111d0251ce7b5ffb6136599a472fcdb 100644 (file)
@@ -1,3 +1,11 @@
+/**
+* Copyright (C) 2018 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.service;
 
 import java.util.List;
@@ -9,7 +17,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.cache.CdmServiceCacher;
+import eu.etaxonomy.cdm.api.cache.CdmServiceCachingProxy;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Language;
@@ -19,26 +27,27 @@ import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
 
 public class ServiceInterceptorTest extends RemotingSessionAwareTest {
 
-        @SuppressWarnings("unused")
-    private static final Logger logger = LogManager.getLogger(ServiceInterceptorTest.class);
-        private final ITermService termService = getRemoteApplicationController().getTermService();
-        private static CdmServiceCacher cdmServiceCacher = CdmApplicationState.getCdmServiceCacher();
-
-
-           @Test
-           public void termServiceInterceptorTest() {
-               List<DefinedTermBase<?>> terms = termService.listByTermType(TermType.Language, null, null, null, null);
-               int cacheLanguageSize = 0;
-               List<UUID> keys = cdmServiceCacher.getDefaultCache().getKeys();
-               for(UUID key : keys) {
-                   CdmBase cdmBase = cdmServiceCacher.getFromCache(key);
-                   if(cdmBase != null && cdmBase.getClass().equals(Language.class)) {
-                       cacheLanguageSize++;
-                   }else{
-                       System.err.println("There is no element for key" + key.toString());
-                   }
-               }
-               Assert.assertEquals(terms.size(), cacheLanguageSize);
-               // TO DO : get the static termTypeMap from TermServiceRequestExecutor and check the size
-           }
-}
+       @SuppressWarnings("unused")
+       private static final Logger logger = LogManager.getLogger(ServiceInterceptorTest.class);
+
+       private final ITermService termService = getRemoteApplicationController().getTermService();
+       private static CdmServiceCachingProxy cdmTermCache = CdmApplicationState.getTermProxy();
+
+
+    @Test
+    public void termServiceInterceptorTest() {
+       List<DefinedTermBase<?>> terms = termService.listByTermType(TermType.Language, null, null, null, null);
+       int cacheLanguageSize = 0;
+       List<UUID> keys = cdmTermCache.getPermanentCache().getKeys();
+       for(UUID key : keys) {
+           CdmBase cdmBase = cdmTermCache.getFromCache(key);
+           if(cdmBase != null && cdmBase.getClass().equals(Language.class)) {
+               cacheLanguageSize++;
+           }else{
+               System.err.println("There is no element for key" + key.toString());
+           }
+       }
+       Assert.assertEquals(terms.size(), cacheLanguageSize);
+       // TO DO : get the static termTypeMap from TermServiceRequestExecutor and check the size
+    }
+}
\ No newline at end of file
index 6a664cf3e3c01102e9e4130479b87a9b76b7ce1f..3ca9c5c67860389ffd30ca686cac4837177422ab 100644 (file)
@@ -395,6 +395,7 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
     public void testSaveNewTermVocabulary() {
         TermVocabulary<Feature> termVocabulary =
                 TermVocabulary.NewInstance(TermType.Feature,
+                        Feature.class,
                         null,
                         "Untitled",
                         null,
index 80895e8236e87204c24f3b21ac7faf4af2b6d537..3bf1ddeccb299a9c64e559666c20277e73109b4c 100644 (file)
@@ -4,9 +4,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
 import org.junit.Assert;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.unitils.dbunit.annotation.DataSet;
 
@@ -27,19 +25,12 @@ import eu.etaxonomy.taxeditor.httpinvoker.RemotingSessionAwareTest;
 @DataSet
 public class CdmEntitySessionManagerTest extends RemotingSessionAwareTest {
 
-       @SuppressWarnings("unused")
-       private static final Logger logger = LogManager.getLogger(CdmEntitySessionManagerTest.class);
-
        IPolytomousKeyService polytomousKeyService = getRemoteApplicationController().getPolytomousKeyService();
        IPolytomousKeyNodeService polytomousKeyNodeService = getRemoteApplicationController().getPolytomousKeyNodeService();
 
        private final UUID polytomousKeyUuid = UUID.fromString("0d53ba20-7de4-4baa-bd8a-401048447d66");
        private final Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
 
-       @BeforeClass
-       public static void initializeCdmEntitySessionManagerTest() {
-       }
-
        @Test
        public void manageNullSessionTest() {
 
@@ -99,7 +90,7 @@ public class CdmEntitySessionManagerTest extends RemotingSessionAwareTest {
                PolytomousKeyNode node = root.getChildAt(0);
                List<PolytomousKeyNode> nodes = root.getChildren();
                node.getStatement().getLabel(english).setText(upStatement);
-               
+
                MergeResult<PolytomousKey> result = polytomousKeyService.merge(key, true);
                key = result.getMergedEntity();
                pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
index 1012c54a21e85d1c306ad9a66fce37373b1489b8..1112e5768b52abfb80b64b1ec9a874efea9c79e3 100644 (file)
@@ -16,25 +16,16 @@ import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 /**
  * @author cmathew
  * @date 15 Jun 2015
- *
  */
 public class MockConversationEnabled implements IConversationEnabled {
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-     */
     @Override
     public void update(CdmDataChangeMap arg0) {
         // TODO Auto-generated method stub
-
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-     */
     @Override
     public ConversationHolder getConversationHolder() {
         return new ConversationHolderMock();
     }
-
-}
+}
\ No newline at end of file
index 85847b2472ee4e55bd210c53183e0feda73d824f..ad3b2333b17d94ac4f6f5e8c07bdfa306fe371e1 100644 (file)
   <TaxonBase DTYPE="Taxon" id="2737" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" taxonstatusunknown="false" name_id="2737"  publish="true"/>
   <TaxonBase DTYPE="Taxon" id="2738" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" taxonstatusunknown="false" name_id="2738"  publish="true"/>
 
-  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" isDefault="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
   
   <LanguageString id="10"/>
 </dataset>
index 04e122d662f28817f619b445ac2f26e37bc087f3..eb7ea742d614477a137529cd869f330ae2bf0005 100644 (file)
   <TaxonBase DTYPE="Taxon" id="2738" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" taxonstatusunknown="false"   name_id="2738"  publish="true"/>
   <TaxonBase DTYPE="Taxon" id="2739" uuid="79b45ff5-c17c-44ec-9114-fb6b3cd1aef4" protectedtitlecache="false" titleCache="Pteris cretica sec. Cyprus" doubtful="false" usenamecache="false" name_id="2739" publish="true" taxonstatusunknown="false"/>
 
-  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" isDefault="false" types="#"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" isDefault="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false" types="#"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false" types="#"/>
 
   <LanguageString id="10"/>
 </dataset>
index 624ad16a0b325ccbb02a791022e3bd13c068210f..5683b757abdd242a6bf1493a201d8ce52fb5ec48 100644 (file)
   <TaxonBase DTYPE="Taxon" id="2737" uuid="6b46ac55-3e39-4c37-a1b6-b680b21599b2" protectedtitlecache="false" titleCache="Pteris vittata L. sec. Cyprus" doubtful="false" usenamecache="false" taxonstatusunknown="false" name_id="2737"  publish="true"/>
   <TaxonBase DTYPE="Taxon" id="2738" uuid="8ac3dca2-6bbf-4cd4-84b7-53ddc2973ed8" protectedtitlecache="false" titleCache="Pteris sec. Cyprus" doubtful="false" usenamecache="false" taxonstatusunknown="false" name_id="2738"  publish="true"/>
 
-  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" isDefault="false"/>
-  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" isDefault="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="28" uuid="f04f8f66-ad92-42d0-89bc-04ac5b36163c" protectedtitlecache="false" titleCache="Taxon description for Adiantum capillus-veneris L." imagegallery="false"   taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="149" uuid="24df0fca-bfc4-4f0f-a269-336985ed6e5e" protectedtitlecache="false" titleCache="Taxon description for Anogramma leptophylla (L.) Link" imagegallery="false"   taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="447" uuid="01863b86-c6ae-48b8-a8da-f693be9087da" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes acrostica (Balbis) Tod." imagegallery="false"   taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="448" uuid="aac7b184-e622-409b-8eda-e14998b9021d" protectedtitlecache="false" titleCache="Taxon description for Cheilanthes maderensis Lowe" imagegallery="false"   taxon_id="815" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="521" uuid="2d672585-0f35-42f8-9923-dfd5545e6369" protectedtitlecache="false" titleCache="Taxon description for Cosentinia vellea (Aiton) Tod." imagegallery="false"   taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1234" uuid="a8a734c2-122b-4d5b-9c89-a852f4ab4661" protectedtitlecache="false" titleCache="Taxon description for Notholaena marantae (L.) Desv." imagegallery="false"   taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="1524" uuid="c4e66d46-e4fb-4da2-a432-3f1cf5353b81" protectedtitlecache="false" titleCache="Taxon description for Pteris vittata L." imagegallery="false"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4567" uuid="dd0f7395-6162-4ce4-8ece-774011b09325" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Adiantum capillus-veneris L. sec. Cyprus" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4627" uuid="34266202-eb5d-41ec-a0b2-da56deb11cc7" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Anogramma leptophylla (L.) Link sec. Cyprus" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4798" uuid="504b0178-39e6-4c79-8e33-ca00b0662f27" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cheilanthes acrostica (Balbis) Tod. sec. Cyprus" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="4840" uuid="73396d11-5d35-43fb-8b15-4d472bdcdd43" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Cosentinia vellea (Aiton) Tod. sec. Cyprus" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5409" uuid="64a797b2-7f92-4012-a4f5-d76f8aaeb6b4" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Pteris vittata L. sec. Cyprus" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="5974" uuid="71872861-8229-4cab-8042-b75dfa0e3f63" protectedtitlecache="true" titleCache="Cyprus Distributions Excel Import for Notholaena marantae (L.) Desv. sec. Cyprus" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="11766" uuid="6b4be8a2-ea86-4815-bd31-b022055a90f2" protectedtitlecache="false" titleCache="Image gallery for Pteris vittata L." imagegallery="true"   taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12353" uuid="b8d3a151-032e-48d9-9191-d7b8fb1fe1a0" protectedtitlecache="false" titleCache="Image gallery for Cheilanthes acrostica (Balbis) Tod." imagegallery="true"   taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="12713" uuid="61fbdc1b-80bf-4aea-b6cb-8f4d466bd923" protectedtitlecache="false" titleCache="Image gallery for Adiantum capillus-veneris L." imagegallery="true"   taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13728" uuid="53b3125e-2a43-4433-a4dd-50dd9a4cf92c" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="48" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="13817" uuid="7b108193-e689-417a-bcab-adaf6c49d532" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="264" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14043" uuid="de29cc97-a160-4783-b996-b929157335d5" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="812" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14101" uuid="815336d3-19d6-493d-9ea4-bcb320d1b922" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="946" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14658" uuid="ce4068f8-17b0-46e2-9fbb-e8c16efb7255" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2203" PUBLISH="true" ISDEFAULT="false"/>
+  <DescriptionBase DTYPE="TaxonDescription" id="14864" uuid="2d55f445-8e72-43d3-976a-133828e89599" protectedtitlecache="true" titleCache="Import from Cyprus Excel Altitude Import" imagegallery="false" taxon_id="2737" PUBLISH="true" ISDEFAULT="false"/>
 
   <LanguageString id="10"/>
 </dataset>
index c1b003b410f2098c01d324a49b5f617785d0a968..a1ae32e112a0b300eaeb0c71ee4652b164888d4d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db and b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db differ
index 9355d95ee13c189f8c0b10c329546e284d492164..b24fc5d987c02329666c84bf11a782913ea6a802 100644 (file)
@@ -5,7 +5,7 @@ Export-Package: eu.etaxonomy.taxeditor.bulkeditor,
  eu.etaxonomy.taxeditor.workbench.datasource,
  eu.etaxonomy.taxeditor.workbench.part
 Bundle-Name: Workbench Bundle
-Bundle-Version: 5.33.0
+Bundle-Version: 5.42.0
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.e4.ui.workbench,
index 9b9b1530a4d68d42e52639787fd5bba100b57f5c..66ec1bff59ef80001a2ac4da7d5daa6134a2af2d 100644 (file)
@@ -3,7 +3,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index 436a9de21ce144367758990ad7c9a454772ccaaa..4701b7e9dabad6aa6abc4d907dcbcdafe5623042 100755 (executable)
@@ -93,7 +93,7 @@ public class OpenAdminPreferencesHandler {
         }
 
         //sort root nodes
-        Collections.sort(rootPages, new PreferenceNodeComparator());
+       // Collections.sort(rootPages, new PreferenceNodeComparator());
         //add root nodes
         rootPages.forEach(pageWrapper->{
             PreferenceNode node = new PreferenceNode(pageWrapper.id, pageWrapper.page);
@@ -122,6 +122,7 @@ public class OpenAdminPreferencesHandler {
         }
         PreferenceDialog dialog = new PreferenceDialog(shell, manager);
         dialog.create();
+        dialog.getTreeViewer().expandToLevel(2);
         dialog.open();
     }
 
index f6495d3045d04bd5735440c23d1bbe0fc71952b0..9a06de9b9ff13723bf65ed452c64159ae56c936e 100644 (file)
@@ -19,7 +19,8 @@ import java.util.Map;
 
 import javax.inject.Named;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExtensionRegistry;
@@ -91,7 +92,7 @@ public class OpenPreferencesHandler {
         }
 
         //sort root nodes
-        Collections.sort(rootPages, new PreferenceNodeComparator());
+        //Collections.sort(rootPages, new PreferenceNodeComparator());
         //add root nodes
         rootPages.forEach(pageWrapper->{
             PreferenceNode node = new PreferenceNode(pageWrapper.id, pageWrapper.page);
index f043712d5a114c2bcfa2d941f1337d93560c9fc0..5ca7deb0bbc45766e89a84e8ee5535a186762273 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="5.33.0">
+<?pde version="3.5"?><product application="eu.etaxonomy.taxeditor.application.application" autoIncludeRequirements="true" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" includeLaunchers="true" name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" useFeatures="true" version="5.42.0">
   <aboutInfo>
     <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
     <text>
@@ -21,7 +21,6 @@
   <windowImages i16="/eu.etaxonomy.taxeditor.application/icons/256color_16x16.gif" i32="/eu.etaxonomy.taxeditor.application/icons/256color_32x32.gif" i48="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
   <splash location="eu.etaxonomy.taxeditor.application" startupForegroundColor="000000" startupMessageRect="7,432,360,20" startupProgressRect="5,447,366,15"/>
   <launcher name="TaxonomicEditor">
-    <solaris/>
     <win useIco="false">
       <bmp/>
     </win>
@@ -38,5 +37,6 @@
     <plugin autoStart="true" id="org.eclipse.equinox.ds" startLevel="2"/>
     <plugin autoStart="true" id="org.eclipse.equinox.p2.transport.ecf" startLevel="4"/>
     <plugin autoStart="true" id="org.eclipse.equinox.simpleconfigurator" startLevel="1"/>
+    <property name="osgi.nl" value="en"/>
   </configurations>
 </product>
index 7af086db6f9d2df0f87754e6b77165f208b1e2b2..9c82986c71ed2eeaa42bee136988f3f8e066485a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product.jre" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="5.33.0" useFeatures="true" includeLaunchers="true">
+<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product.jre" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="5.42.0" useFeatures="true" includeLaunchers="true">
 
    <aboutInfo>
       <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
@@ -61,6 +61,7 @@
       <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
       <plugin id="org.eclipse.equinox.p2.transport.ecf" autoStart="true" startLevel="4" />
       <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
+      <property name="osgi.nl" value="en"/>
    </configurations>
 
 </product>
index cfbed9f491e34243b2e38a808ea74a75212e75ab..9a6dd2ed9d2e284134ee64c4cb86b0c281ad52b1 100644 (file)
@@ -2,7 +2,7 @@
   <parent>
     <groupId>eu.etaxonomy</groupId>
     <artifactId>taxeditor-parent</artifactId>
-    <version>5.33.0</version>
+    <version>5.42.0</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
index ee74eabef5f85bf5eb69a92008db8ca480ffb72d..9ea268890f18b8b720dd6eb61d6526d7c0afb168 100644 (file)
 <unit id="org.eclipse.oomph.setup.sdk.feature.group" version="1.7.0.v20170305-1123"/>\r
 <repository location="http://download.eclipse.org/releases/neon"/>\r
 </location>\r
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
-<unit id="org.eclipse.nebula.widgets.compositetable.feature.feature.group" version="1.0.0.202011020719"/>\r
-<repository location="http://download.eclipse.org/nebula/releases/latest/"/>\r
-</location>\r
+       <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+               <repository location="https://archive.eclipse.org/nebula/Q22016/release/"/>\r
+               <unit id="org.eclipse.nebula.widgets.compositetable.feature.feature.group" version="1.0.0.201605182147"/>\r
+       </location>\r
 </locations>\r
 <includeBundles>\r
 <feature id="org.eclipse.core.runtime.feature"/>\r
diff --git a/pom.xml b/pom.xml
index 7725a4363aaff0f9c45dadefe30abc161db03491..01579f30a7085a0f6d7b8150770c271a2c9a4350 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
   </prerequisites>
   <groupId>eu.etaxonomy</groupId>
   <artifactId>taxeditor-parent</artifactId>
-  <version>5.33.0</version>
+  <version>5.42.0</version>
   <name>EDIT Taxonomic Editor</name>
   <description>The Taxonomic Editor for EDIT's platform for
     cybertaxonomy
   <properties>
     <java.codelevel>1.8</java.codelevel>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <cdmlib.version>5.33.0</cdmlib.version>
+    <cdmlib.version>5.42.0</cdmlib.version>
     <!-- TODO can we use project.version ????? -->
     <!-- Increasing tycho above 0.22.0 will fail for the macosx build because 
       for higher version numbers tycho needs to be build against Eclipse Mars or 
       higher -->
     <tycho.version>1.7.0</tycho.version>
-    <taxeditor.version>5.33.0</taxeditor.version>
+    <taxeditor.version>5.42.0</taxeditor.version>
     <update.dir>snapshot</update.dir>
-    <log4j.version>2.18.0</log4j.version>
+    <log4j.version>2.19.0</log4j.version>
     <httpcomponents.version>4.5.13</httpcomponents.version>
     <jetty-version>9.4.26.v20200117</jetty-version>
     <doclint>none</doclint>
   
+  
+  
+  
+  
+  
+  
+  
+  
+  
     <!-- see according comment in cdmlib for possible finetuning -->
   </properties>
   <modules>
     <repository>
       <id>eclipse-indigo</id>
       <layout>p2</layout>
-      <url>http://download.eclipse.org/technology/swtbot/snapshots/</url>
+      <!--<url>http://download.eclipse.org/technology/swtbot/snapshots</url>-->
+      <url>http://download.eclipse.org/technology/swtbot/releases/latest</url>
     </repository>
     <repository>
       <id>eclipse-nebula</id>
       <layout>p2</layout>
-      <url>http://download.eclipse.org/nebula/releases/latest</url>
+      <url> https://archive.eclipse.org/nebula/Q22016/release/</url>
+    
+    
+    
+    
+    
+    
+    
+      <!--<url>http://download.eclipse.org/nebula/releases/latest</url>-->
     </repository>
     <repository>
       <id>nattable</id>