Merge develop into branch
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 25 Aug 2015 06:22:23 +0000 (08:22 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 25 Aug 2015 06:22:23 +0000 (08:22 +0200)
62 files changed:
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorQuery.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSearch.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_en.properties
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientTaxonService.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/operation/MoveDerivateOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/MoveDescriptionElementsOperation.java
eu.etaxonomy.taxeditor.feature/build.properties.with.jre
eu.etaxonomy.taxeditor.molecular.lib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.molecular/build.properties
eu.etaxonomy.taxeditor.molecular/lib/.gitignore [deleted file]
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorContentService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDnDService.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorViewer.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDragListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/schema/eu.etaxonomy.taxeditor.store.cdmViewer.exsd
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteConfiguratorDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNodeConfiguratorComposite.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.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/classification/TaxonNodeDetailElement.java
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/key/PolytomousKeyNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.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/MediaRepresentationPartElement.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/NonViralNameDetailSection.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/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerContextMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/CdmViewerUtil.java
eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre [new file with mode: 0644]
pom.xml

index 81bdf0a83e67d6553289f32ec6d37f413fdd5f0b..6a5c286864b932de03a3eebef50559186709fc25 100644 (file)
@@ -21,6 +21,7 @@ Require-Bundle: org.eclipse.ui,
  eu.etaxonomy.taxeditor.bulkeditor,
  eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.printpublisher,
+ eu.etaxonomy.taxeditor.molecular,
  eu.etaxonomy.taxeditor.help,
  org.eclipse.equinox.ds,
  org.eclipse.equinox.util,
index b74e209ce9d93b65fa3e04ed7461db32d7388015..40453cf2d1848c766922824ffe398ca9329c89e9 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?eclipse version="3.2"?>\r
-<plugin>\r
-   <extension\r
-         id="application"\r
-         name="%extension.name"\r
-         point="org.eclipse.core.runtime.applications">\r
-      <application\r
-            cardinality="singleton-global"\r
-            thread="main"\r
-            visible="true">\r
-         <run\r
-               class="eu.etaxonomy.taxeditor.Application">\r
-         </run>\r
-      </application>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.perspectives">\r
-      <perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.Taxonomic"\r
-            id="eu.etaxonomy.taxeditor.application.perspective.taxonomic"\r
-            name="%perspective.name">\r
-      </perspective>\r
-      <!--perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.BulkEditing"\r
-            id="eu.etaxonomy.taxeditor.application.perspective.bulkeditor"\r
-            name="Bulk Editing">\r
-      </perspective-->\r
-      <perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.PolytomousKey"\r
-            id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
-            name="%perspective.name.0">\r
-      </perspective>\r
-      <perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.Uses"\r
-            id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
-            name="%perspective.name.1">\r
-      </perspective>\r
-      <perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.DerivatePerspective"\r
-            icon="icons/specimen_derivate-16x16-32.png"\r
-            id="eu.etaxonomy.taxeditor.application.perspective.derivates"\r
-            name="%perspective.name.2">\r
-      </perspective>\r
-      <perspective\r
-            class="eu.etaxonomy.taxeditor.perspective.ChecklistPerspective"\r
-            icon="icons/check.png"\r
-            id="eu.etaxonomy.taxeditor.perspective.checklistperspective"\r
-            name="Checklist">\r
-      </perspective>\r
-     \r
-   </extension>\r
-   <!--extension\r
-         point="org.eclipse.ui.views">\r
-      <view\r
-            class="eu.etaxonomy.taxeditor.navigation.taxonomictree.TaxonomicTreeView"\r
-            id="eu.etaxonomy.taxeditor.navigation.taxonomictree.treeView"\r
-            name="Taxonomic Tree">\r
-      </view>\r
-      <view\r
-            allowMultiple="true"\r
-            class="eu.etaxonomy.taxeditor.navigation.search.SearchResultView"\r
-            id="eu.etaxonomy.taxeditor.navigation.search.searchResultView"\r
-            name="Search Result"\r
-            restorable="true">\r
-      </view>\r
-   </extension-->\r
- <extension\r
-       point="org.eclipse.ui.perspectiveExtensions">\r
-    <perspectiveExtension\r
-          targetID="eu.etaxonomy.taxeditor.application.perspective.bulkeditor">\r
-       <showInPart\r
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">\r
-       </showInPart>\r
-       <showInPart\r
-             id="eu.etaxonomy.taxeditor.bulkeditor.referencingobjectsview">\r
-       </showInPart>\r
-    </perspectiveExtension>\r
-    <perspectiveExtension\r
-          targetID="eu.etaxonomy.taxeditor.application.perspective.polytomous">\r
-       <showInPart\r
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">\r
-       </showInPart>\r
-    </perspectiveExtension>\r
-    <perspectiveExtension\r
-          targetID="eu.etaxonomy.taxeditor.application.perspective.uses">\r
-       <showInPart\r
-             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">\r
-       </showInPart>\r
-    </perspectiveExtension>\r
- </extension>\r
-   <extension\r
-         point="org.eclipse.ui.menus">\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu">\r
-         <menu\r
-               id="org.eclipse.ui.main.menu.file"\r
-               label="%menu.label">\r
-         </menu>\r
-         <menu\r
-               id="org.eclipse.ui.main.menu.edit"\r
-               label="%menu.label.0">\r
-         </menu>\r
-         <menu\r
-               id="org.eclipse.ui.main.menu.window"\r
-               label="%menu.label.1">\r
-         </menu>\r
-         <menu\r
-               id="org.eclipse.ui.main.menu.help"\r
-               label="%menu.label.2">\r
-         </menu>\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu.file">\r
-         <menu\r
-               id="eu.etaxonomy.navigation.menu.new"\r
-               label="%menu.label.3">\r
-         </menu>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.application.filemenu.new"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.file.close"\r
-               label="%command.label"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.file.closeAll"\r
-               label="%command.label.0"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.application.filemenu.close"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.file.save"\r
-               label="%command.label.1"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.file.saveAll"\r
-               label="%command.label.2"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.application.filemenu.save"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.file.import"\r
-               label="%command.label.3"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.file.export"\r
-               label="%command.label.4"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.application.filemenu.io"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.file.exit"\r
-               id="eu.etaxonomy.taxeditor.application.menu.exit"\r
-               label="%command.label.5"\r
-               style="push">\r
-         </command>\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu.edit">\r
-         <command\r
-               commandId="org.eclipse.ui.edit.undo"\r
-               label="%command.label.6">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.edit.redo"\r
-               label="%command.label.7"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.ui.edit.separator1"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.edit.cut"\r
-               label="%command.label.8"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.edit.copy"\r
-               label="%command.label.9"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.edit.paste"\r
-               label="%command.label.10"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.ui.edit.separator2"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.edit.delete"\r
-               label="%command.label.11"\r
-               style="push">\r
-         </command>\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu.window">\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.application.windowMenu.last"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.window.preferences"\r
-               label="%command.label.12"\r
-               style="push">\r
-         </command>\r
-      </menuContribution>\r
-      <menuContribution\r
-            locationURI="menu:org.eclipse.ui.main.menu.help">\r
-         <command\r
-               commandId="org.eclipse.ui.help.helpContents"\r
-               label="%command.label.13"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="org.eclipse.ui.help.helpSearch"\r
-               label="%command.label.14"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.ui.help.separator0"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.help.dynamicHelp"\r
-               label="%command.label.15"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.application.help.parser"\r
-               label="%command.label.16"\r
-               style="push">\r
-         </command>\r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.ui.help.separator1"\r
-               visible="true">\r
-         </separator>\r
-         <!--command\r
-               commandId="eu.etaxonomy.taxeditor.install"\r
-               label="%command.label.18"\r
-               style="push"/-->\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.update"\r
-               label="%command.label.17"\r
-               style="push"/>    \r
-         <separator\r
-               name="eu.etaxonomy.taxeditor.ui.help.separator2"\r
-               visible="true">\r
-         </separator>\r
-         <command\r
-               commandId="org.eclipse.ui.help.aboutAction"\r
-               label="%command.label.19">\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
-               label="%command.label.20"\r
-               style="push">\r
-         </command>\r
-      </menuContribution>\r
-            <menuContribution\r
-            locationURI="toolbar:org.eclipse.ui.main.toolbar">\r
-         <toolbar\r
-               id="eu.etaxonomy.taxeditor.editor.main">\r
-            <command\r
-                  commandId="org.eclipse.ui.newWizard"\r
-                  label="%command.label.21"\r
-                  style="push">\r
-            </command>\r
-            <command\r
-                  commandId="org.eclipse.ui.file.save"\r
-                  label="%command.label.22"\r
-                  style="push">\r
-            </command>\r
-         </toolbar>\r
-      </menuContribution>\r
-   </extension>\r
-   <extension\r
-         id="product"\r
-         point="org.eclipse.core.runtime.products">\r
-      <product\r
-            application="eu.etaxonomy.taxeditor.application.application"\r
-            name="%product.name">\r
-         <property\r
-               name="windowImages"\r
-               value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">\r
-         </property>\r
-         <property\r
-               name="aboutText"\r
-               value="%productBlurb">\r
-         </property>\r
-         <!--property\r
-               name="startupForegroundColor"\r
-               value="#C8D5EA"-->\r
-         <property\r
-               name="startupForegroundColor"\r
-               value="000000">\r
-         </property>\r
-         <property\r
-               name="startupProgressRect"\r
-               value="5,447,366,15">\r
-         </property>\r
-         <property\r
-               name="startupMessageRect"\r
-               value="7,432,360,20">\r
-         </property>\r
-         <property\r
-               name="appName"\r
-               value="EDIT Taxonomic Editor">\r
-         </property>\r
-         <property\r
-               name="preferenceCustomization"\r
-               value="plugin_customization.ini">\r
-         </property>\r
-         <property\r
-               name="aboutImage"\r
-               value="icons/256color_48x48.gif">\r
-         </property>\r
-      </product>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.commands">\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler"\r
-            id="eu.etaxonomy.taxeditor.application.help.parser"\r
-            name="%command.name">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler"\r
-            id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"\r
-            name="%command.name.0">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.update.UpdateHandler"\r
-            id="eu.etaxonomy.taxeditor.update"\r
-            name="%command.label.17">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.update.InstallNewSoftwareHandler"\r
-            id="eu.etaxonomy.taxeditor.install"\r
-            name="%command.label.18">\r
-      </command>\r
-   </extension>\r
-   \r
-   \r
-       <extension\r
-               point="org.eclipse.ui.activities">\r
-               <activity\r
-                       description="%activity.description"\r
-                       id="eu.etaxonomy.taxeditor.disable"\r
-                       name="%activity.name">\r
-               </activity>\r
-               <activityPatternBinding\r
-                       activityId="eu.etaxonomy.taxeditor.disable"\r
-                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.project">\r
-               </activityPatternBinding>\r
-               <activityPatternBinding\r
-                       activityId="eu.etaxonomy.taxeditor.disable"\r
-                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.file">\r
-               </activityPatternBinding>\r
-               <activityPatternBinding\r
-                       activityId="eu.etaxonomy.taxeditor.disable"\r
-                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.folder">\r
-               </activityPatternBinding>\r
-               <activityPatternBinding\r
-                       activityId="eu.etaxonomy.taxeditor.disable"\r
-                       pattern="org\.eclipse\.ui\.editors/org\.eclipse\.ui\.editors\.wizards\.UntitledTextFileWizard">\r
-               </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\..*externaltools.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.debug.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.team.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.ant.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.pde.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.jdt.*">\r
-  </activityPatternBinding>\r
-  <activityPatternBinding\r
-        activityId="eu.etaxonomy.taxeditor.disable"\r
-        pattern="org\.eclipse\.search.*">\r
-  </activityPatternBinding>\r
-       </extension>\r
- <extension\r
-       id="eu_etaxonomy_taxeditor_product"\r
-       point="org.eclipse.core.runtime.products">\r
-    <product\r
-          application="eu.etaxonomy.taxeditor.application.application"\r
-          name="EDIT Taxonomic Editor">\r
-       <property\r
-             name="appName"\r
-             value="EDIT Taxonomic Editor">\r
-       </property>\r
-       <property\r
-             name="aboutImage"\r
-             value="icons/256color_48x48.gif">\r
-       </property>\r
-       <property\r
-             name="aboutText"\r
-             value="%productBlurb">\r
-       </property>\r
-       <property\r
-             name="windowImages"\r
-             value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">\r
-       </property>\r
-       <property\r
-             name="startupForegroundColor"\r
-             value="000000">\r
-       </property>\r
-       <property\r
-             name="startupMessageRect"\r
-             value="7,432,360,20">\r
-       </property>\r
-       <property\r
-             name="startupProgressRect"\r
-             value="5,447,366,15">\r
-       </property>\r
-       <property\r
-             name="preferenceCustomization"\r
-             value="plugin_customization.ini">\r
-       </property>\r
-    </product>\r
- </extension>\r
-\r
-</plugin>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         id="application"
+         name="%extension.name"
+         point="org.eclipse.core.runtime.applications">
+      <application
+            cardinality="singleton-global"
+            thread="main"
+            visible="true">
+         <run
+               class="eu.etaxonomy.taxeditor.Application">
+         </run>
+      </application>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="eu.etaxonomy.taxeditor.perspective.Taxonomic"
+            id="eu.etaxonomy.taxeditor.application.perspective.taxonomic"
+            name="%perspective.name">
+      </perspective>
+      <!--perspective
+            class="eu.etaxonomy.taxeditor.perspective.BulkEditing"
+            id="eu.etaxonomy.taxeditor.application.perspective.bulkeditor"
+            name="Bulk Editing">
+      </perspective-->
+      <perspective
+            class="eu.etaxonomy.taxeditor.perspective.PolytomousKey"
+            id="eu.etaxonomy.taxeditor.application.perspective.polytomous"
+            name="%perspective.name.0">
+      </perspective>
+      <perspective
+            class="eu.etaxonomy.taxeditor.perspective.Uses"
+            id="eu.etaxonomy.taxeditor.application.perspective.uses"
+            name="%perspective.name.1">
+      </perspective>
+      <perspective
+            class="eu.etaxonomy.taxeditor.perspective.DerivatePerspective"
+            icon="icons/specimen_derivate-16x16-32.png"
+            id="eu.etaxonomy.taxeditor.application.perspective.derivates"
+            name="%perspective.name.2">
+      </perspective>
+      <perspective
+            class="eu.etaxonomy.taxeditor.perspective.ChecklistPerspective"
+            icon="icons/check.png"
+            id="eu.etaxonomy.taxeditor.perspective.checklistperspective"
+            name="Checklist">
+      </perspective>
+     
+   </extension>
+   <!--extension
+         point="org.eclipse.ui.views">
+      <view
+            class="eu.etaxonomy.taxeditor.navigation.taxonomictree.TaxonomicTreeView"
+            id="eu.etaxonomy.taxeditor.navigation.taxonomictree.treeView"
+            name="Taxonomic Tree">
+      </view>
+      <view
+            allowMultiple="true"
+            class="eu.etaxonomy.taxeditor.navigation.search.SearchResultView"
+            id="eu.etaxonomy.taxeditor.navigation.search.searchResultView"
+            name="Search Result"
+            restorable="true">
+      </view>
+   </extension-->
+ <extension
+       point="org.eclipse.ui.perspectiveExtensions">
+    <perspectiveExtension
+          targetID="eu.etaxonomy.taxeditor.application.perspective.bulkeditor">
+       <showInPart
+             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
+       </showInPart>
+       <showInPart
+             id="eu.etaxonomy.taxeditor.bulkeditor.referencingobjectsview">
+       </showInPart>
+    </perspectiveExtension>
+    <perspectiveExtension
+          targetID="eu.etaxonomy.taxeditor.application.perspective.polytomous">
+       <showInPart
+             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
+       </showInPart>
+    </perspectiveExtension>
+    <perspectiveExtension
+          targetID="eu.etaxonomy.taxeditor.application.perspective.uses">
+       <showInPart
+             id="eu.etaxonomy.taxeditor.editor.forms.detailsView">
+       </showInPart>
+    </perspectiveExtension>
+ </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu">
+         <menu
+               id="org.eclipse.ui.main.menu.file"
+               label="%menu.label">
+         </menu>
+         <menu
+               id="org.eclipse.ui.main.menu.edit"
+               label="%menu.label.0">
+         </menu>
+         <menu
+               id="org.eclipse.ui.main.menu.window"
+               label="%menu.label.1">
+         </menu>
+         <menu
+               id="org.eclipse.ui.main.menu.help"
+               label="%menu.label.2">
+         </menu>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.file">
+         <menu
+               id="eu.etaxonomy.navigation.menu.new"
+               label="%menu.label.3">
+         </menu>
+         <separator
+               name="eu.etaxonomy.taxeditor.application.filemenu.new"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.file.close"
+               label="%command.label"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.file.closeAll"
+               label="%command.label.0"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.application.filemenu.close"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.file.save"
+               label="%command.label.1"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.file.saveAll"
+               label="%command.label.2"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.application.filemenu.save"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.file.import"
+               label="%command.label.3"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.file.export"
+               label="%command.label.4"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.application.filemenu.io"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.file.exit"
+               id="eu.etaxonomy.taxeditor.application.menu.exit"
+               label="%command.label.5"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.edit">
+         <command
+               commandId="org.eclipse.ui.edit.undo"
+               label="%command.label.6">
+         </command>
+         <command
+               commandId="org.eclipse.ui.edit.redo"
+               label="%command.label.7"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.ui.edit.separator1"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.edit.cut"
+               label="%command.label.8"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.edit.copy"
+               label="%command.label.9"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.edit.paste"
+               label="%command.label.10"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.ui.edit.separator2"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.edit.delete"
+               label="%command.label.11"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.window">
+         <separator
+               name="eu.etaxonomy.taxeditor.application.windowMenu.last"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.window.preferences"
+               label="%command.label.12"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.help">
+         <command
+               commandId="org.eclipse.ui.help.helpContents"
+               label="%command.label.13"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.help.helpSearch"
+               label="%command.label.14"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.ui.help.separator0"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.help.dynamicHelp"
+               label="%command.label.15"
+               style="push">
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.application.help.parser"
+               label="%command.label.16"
+               style="push">
+         </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.ui.help.separator1"
+               visible="true">
+         </separator>
+         <!--command
+               commandId="eu.etaxonomy.taxeditor.install"
+               label="%command.label.18"
+               style="push"/-->
+         <command
+               commandId="eu.etaxonomy.taxeditor.update"
+               label="%command.label.17"
+               style="push"/>    
+         <separator
+               name="eu.etaxonomy.taxeditor.ui.help.separator2"
+               visible="true">
+         </separator>
+         <command
+               commandId="org.eclipse.ui.help.aboutAction"
+               label="%command.label.19">
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.application.help.aboutPlatform"
+               label="%command.label.20"
+               style="push">
+         </command>
+      </menuContribution>
+            <menuContribution
+            locationURI="toolbar:org.eclipse.ui.main.toolbar">
+         <toolbar
+               id="eu.etaxonomy.taxeditor.editor.main">
+            <command
+                  commandId="org.eclipse.ui.newWizard"
+                  label="%command.label.21"
+                  style="push">
+            </command>
+            <command
+                  commandId="org.eclipse.ui.file.save"
+                  label="%command.label.22"
+                  style="push">
+            </command>
+         </toolbar>
+      </menuContribution>
+   </extension>
+   <extension
+         id="product"
+         point="org.eclipse.core.runtime.products">
+      <product
+            application="eu.etaxonomy.taxeditor.application.application"
+            name="%product.name">
+         <property
+               name="windowImages"
+               value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">
+         </property>
+         <property
+               name="aboutText"
+               value="%productBlurb">
+         </property>
+         <!--property
+               name="startupForegroundColor"
+               value="#C8D5EA"-->
+         <property
+               name="startupForegroundColor"
+               value="000000">
+         </property>
+         <property
+               name="startupProgressRect"
+               value="5,447,366,15">
+         </property>
+         <property
+               name="startupMessageRect"
+               value="7,432,360,20">
+         </property>
+         <property
+               name="appName"
+               value="EDIT Taxonomic Editor">
+         </property>
+         <property
+               name="preferenceCustomization"
+               value="plugin_customization.ini">
+         </property>
+         <property
+               name="aboutImage"
+               value="icons/256color_48x48.gif">
+         </property>
+      </product>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalParserHelpHandler"
+            id="eu.etaxonomy.taxeditor.application.help.parser"
+            name="%command.name">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.OpenExternalAboutPlatformHandler"
+            id="eu.etaxonomy.taxeditor.application.help.aboutPlatform"
+            name="%command.name.0">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.update.UpdateHandler"
+            id="eu.etaxonomy.taxeditor.update"
+            name="%command.label.17">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.update.InstallNewSoftwareHandler"
+            id="eu.etaxonomy.taxeditor.install"
+            name="%command.label.18">
+      </command>
+   </extension>
+   
+   
+       <extension
+               point="org.eclipse.ui.activities">
+               <activity
+                       description="%activity.description"
+                       id="eu.etaxonomy.taxeditor.disable"
+                       name="%activity.name">
+               </activity>
+               <activityPatternBinding
+                       activityId="eu.etaxonomy.taxeditor.disable"
+                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.project">
+               </activityPatternBinding>
+               <activityPatternBinding
+                       activityId="eu.etaxonomy.taxeditor.disable"
+                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.file">
+               </activityPatternBinding>
+               <activityPatternBinding
+                       activityId="eu.etaxonomy.taxeditor.disable"
+                       pattern="org\.eclipse\.ui\.ide/org\.eclipse\.ui\.wizards\.new\.folder">
+               </activityPatternBinding>
+               <activityPatternBinding
+                       activityId="eu.etaxonomy.taxeditor.disable"
+                       pattern="org\.eclipse\.ui\.editors/org\.eclipse\.ui\.editors\.wizards\.UntitledTextFileWizard">
+               </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\..*externaltools.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.debug.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.team.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.ant.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.pde.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.jdt.*">
+  </activityPatternBinding>
+  <activityPatternBinding
+        activityId="eu.etaxonomy.taxeditor.disable"
+        pattern="org\.eclipse\.search.*">
+  </activityPatternBinding>
+       </extension>
+ <extension
+       id="eu_etaxonomy_taxeditor_product"
+       point="org.eclipse.core.runtime.products">
+    <product
+          application="eu.etaxonomy.taxeditor.application.application"
+          name="EDIT Taxonomic Editor">
+       <property
+             name="appName"
+             value="EDIT Taxonomic Editor">
+       </property>
+       <property
+             name="aboutImage"
+             value="icons/256color_48x48.gif">
+       </property>
+       <property
+             name="aboutText"
+             value="%productBlurb">
+       </property>
+       <property
+             name="windowImages"
+             value="icons/256color_16x16.gif,icons/256color_32x32.gif,icons/256color_48x48.gif">
+       </property>
+       <property
+             name="startupForegroundColor"
+             value="000000">
+       </property>
+       <property
+             name="startupMessageRect"
+             value="7,432,360,20">
+       </property>
+       <property
+             name="startupProgressRect"
+             value="5,447,366,15">
+       </property>
+       <property
+             name="preferenceCustomization"
+             value="plugin_customization.ini">
+       </property>
+    </product>
+ </extension>
+
+</plugin>
index c2978874b1a990ce1ac9e37636fe71b87580c3c0..720cd61578f40be821155fd125e1bf851df858f4 100644 (file)
@@ -34,9 +34,7 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 
 import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineDocumentProvider;
@@ -44,7 +42,6 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView;
 import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
@@ -54,10 +51,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>
- * BulkEditor class.
- * </p>
- *
  * @author p.ciardelli
  * @created 07.07.2009
  * @version 1.0
@@ -76,16 +69,10 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
 
        private boolean isDirty;
 
-       /**
-        * <p>Constructor for BulkEditor.</p>
-        */
        public BulkEditor() {
                super(CdmStore.createConversation());
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
-        */
        /** {@inheritDoc} */
        @Override
        protected void initializeEditor() {
@@ -103,9 +90,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                setSourceViewerConfiguration(new BulkEditorViewerConfiguration(lineDisplayStrategy));
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.ListEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
-        */
        /** {@inheritDoc} */
        @Override
     protected ISourceViewer createSourceViewer(Composite parent,
@@ -117,9 +101,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                return viewer;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.AnnotatedLineEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
-        */
        /** {@inheritDoc} */
        @Override
        public void init(IEditorSite site, IEditorInput input)
@@ -132,9 +113,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                super.init(site, input);
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
-        */
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
@@ -164,9 +142,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                }
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.editors.text.TextEditor#dispose()
-        */
        /** {@inheritDoc} */
        @Override
        public void dispose() {
@@ -177,18 +152,12 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        }
 
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#isEditable()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean isEditable() {
                return false;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#setFocus()
-        */
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
@@ -203,9 +172,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                }
        }
 
-       /**
-        *
-        */
        private void displayWarningDialog() {
                IPreferenceStore prefs = PreferencesUtil.getPreferenceStore();
                if (!prefs.getBoolean(PreferencesUtil.HIDE_BULKEDITOR_INFO)) {
@@ -221,9 +187,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                }
        }
 
-       /**
-        * @param control
-        */
        private void addToggleMergeCandidateListener(Control control) {
                control.addMouseListener(new MouseAdapter() {
                        @Override
@@ -235,11 +198,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                });
        }
 
-       /**
-        * <p>toggleMergeCandidateAnnotation</p>
-        *
-        * @param line a int.
-        */
        public void toggleMergeCandidateAnnotation(int line) {
 
                IDocument document = getSourceViewer().getDocument();
@@ -261,9 +219,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                }
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#isDirty()
-        */
        @Override
        public boolean isDirty() {
            if(isDirty){
@@ -280,17 +235,14 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
            firePropertyChange(PROP_DIRTY);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
-        */
        @Override
        public void doSave(IProgressMonitor progressMonitor) {
            isDirty = false;
-          
+
            super.doSave(progressMonitor);
-           
+
            selectFirstItem();
-          
+
                getSourceViewer().getTextWidget().setFocus();
 
        }
@@ -304,9 +256,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
 //             firePropertyChange(PROP_DIRTY);
        }
 
-       /* (non-Javadoc)
-        * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
-        */
        /** {@inheritDoc} */
        public void performSearch(BulkEditorQuery query) {
                if (query != null) {
@@ -323,7 +272,7 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                        }
                        conversation.commit();
                        conversation.clear();
-                       
+
                        getEditorInput().performSearch(query);
 
                        refresh();
@@ -339,9 +288,6 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                getSelectionProvider().setSelection(selection);
        }
 
-       /**
-        *
-        */
        public void refresh() {
                if(getDocumentProvider().getAnnotationModel(getEditorInput()) != null){
                        ((AnnotationModel) getDocumentProvider().getAnnotationModel(getEditorInput())).removeAllAnnotations();
index 96b0cbed6fcb4ac6c33077779f453099abea96ce..e65805b9d516c14d23c75b36652cfe13cca4dfff 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -24,10 +24,10 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
  * @version 1.0
  */
 public class BulkEditorQuery {
-               
-       private String searchString;
-       private Comparator<?> comparator;
-       private IIdentifiableEntityServiceConfigurator searchConfigurator;
+
+       private final String searchString;
+       private final Comparator<?> comparator;
+       private final IIdentifiableEntityServiceConfigurator searchConfigurator;
 
        public BulkEditorQuery (String searchString, Comparator comparator) {
                this.searchString = searchString;
@@ -38,30 +38,21 @@ public class BulkEditorQuery {
                searchConfigurator.setTitleSearchString(searchString);
                searchConfigurator.setMatchMode(null);
                searchConfigurator.setPropertyPaths(propertyPath);
-               
+
                if(searchString != null && searchString.trim().equals("*")){
                        searchConfigurator.setPageSize(1000);
                }
-               
+
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getComparator()
-        */
        public Comparator getComparator() {
                return comparator;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchString()
-        */
        public String getSearchString() {
                return searchString;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorQuery#getSearchConfigurator()
-        */
        public IIdentifiableEntityServiceConfigurator getSearchConfigurator() {
                return searchConfigurator;
        }
index eb17b543514a658b5722337ce78b2e8c88d9a551..552a9d0dfa46af09e0ff38a26280854d3fd59c8e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -33,8 +33,6 @@ import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.store.SearchManager;
 
 /**
- * <p>BulkEditorSearchComposite class.</p>
- *
  * @author p.ciardelli
  * @author e.-m.lee
  * @author n.hoffmann
@@ -42,83 +40,63 @@ import eu.etaxonomy.taxeditor.store.SearchManager;
  * @version 1.0
  */
 public class BulkEditorSearch {
-       
-       /**
-        * 
-        */
+
        private static final String SEARCH = "Search";
-       
+
        private static final String DEFAULT_TEXT = String.format("Use \'%s\' for wildcard searching", SearchManager.WILDCARD);
-       
+
        private final BulkEditor editor;
-       
+
        private Text text;
        private BulkEditorSortCombo sortCombo;
-       
+
        private Button button;
-       
-       
+
+
        public Object ORDER_BY = new Object();
-       
-       /**
-        * <p>Constructor for BulkEditorSearchComposite.</p>
-        *
-        * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
-        * @param style a int.
-        * @param editor a {@link org.eclipse.ui.IEditorPart} object.
-        */
+
        public BulkEditorSearch(BulkEditor editor, Composite parent, int style) {
                this.editor = editor;
-               
+
                createControl(parent, style);
        }
 
-       /*
-        * Creates the search control.
-        */
        /**
-        * <p>createControl</p>
+        * Creates the search control.
         */
        protected void createControl(Composite parent, int style) {
-       
+
                final Composite container = new Composite(parent, style);
                GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
                container.setLayoutData(gridData);
                container.setLayout(new GridLayout(5, false));
-               
+
                createSearchTextField(container, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
-               
+
                createSortCombo(container, style);
-               
+
                button = new Button(container, SWT.PUSH);
                button.setText(SEARCH);
                button.addSelectionListener(new SelectionAdapter() {
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                        */
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                updateEditorInput();
                        }
                });
-               
+
                registerAtFocusService();
        }
 
-       /**
-        * @param container
-        * @param style
-        */
        private void createSortCombo(Composite parent, int style) {
                sortCombo = new BulkEditorSortCombo(parent, editor.getEditorInput().getSortProviders());
-               
+
        }
 
        /**
         * Handles focus changes for the textfield.
         */
        private void registerAtFocusService() {
-               IFocusService focusService = 
+               IFocusService focusService =
                        (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
                if (focusService != null) {
                        focusService.addFocusTracker(text, "bulkeditor.textControlId");
@@ -132,32 +110,31 @@ public class BulkEditorSearch {
        private void createSearchTextField(Composite parent, int style) {
                final Label label = new Label(parent, SWT.NONE);
                label.setText("Title Cache");
-               
+
                text = new Text(parent, style);
                text.setText(DEFAULT_TEXT);
                text.setForeground(BulkEditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
-               
+
                text.addFocusListener(new FocusListener() {
 
-                       public void focusGained(FocusEvent e) {
+                       @Override
+            public void focusGained(FocusEvent e) {
                                text.setForeground(BulkEditorUtil.getColor(Resources.SEARCH_VIEW_FOCUS));
                                if (DEFAULT_TEXT.equals(text.getText())) {
                                        text.setText("");
                                }
                        }
 
-                       public void focusLost(FocusEvent e) {
+                       @Override
+            public void focusLost(FocusEvent e) {
                                if (CdmUtils.isEmpty(text.getText())) {
                                        text.setForeground(BulkEditorUtil.getColor(Resources.SEARCH_VIEW_FOREGROUND));
-                                       text.setText(DEFAULT_TEXT);             
-                               } 
+                                       text.setText(DEFAULT_TEXT);
+                               }
                        }
                });
-               
+
                text.addKeyListener(new KeyAdapter() {
-                       /* (non-Javadoc)
-                        * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
-                        */
                        @Override
                        public void keyReleased(KeyEvent e) {
                                if (e.keyCode == SWT.CR) {
@@ -165,59 +142,39 @@ public class BulkEditorSearch {
                                }
                        }
                });
-               
+
                GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
                text.setLayoutData(gridData);
        }
 
 
-       /*
+       /**
         * Shows the results of the search.
         */
        private void updateEditorInput() {
-               
+
                String searchString = getSearchString().trim();
-                               
-               if(DEFAULT_TEXT.equals(searchString) || CdmUtils.isEmpty(searchString)){
+
+               if(DEFAULT_TEXT.equals(searchString) || CdmUtils.isBlank(searchString)){
                        return;
-               }                       
-               
-               BulkEditorQuery query = new BulkEditorQuery(getSearchString(), getComparator());
+               }
+
+               BulkEditorQuery query = new BulkEditorQuery(searchString, getComparator());
                editor.performSearch(query);
        }
-       
-       /*
+
+       /**
         * Returns the current string in the search textfield.
         * @return the content of the textfield
         */
-       /**
-        * <p>getSearchString</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
        public String getSearchString() {
                return text.getText().trim();
        }
-       
-       /*
-        * 
-        */
-       /**
-        * <p>getComparator</p>
-        *
-        * @return a {@link java.util.Comparator} object.
-        */
+
        public Comparator getComparator() {
                return sortCombo.getSelection();
-       };
-       
-       /*
-        * 
-        */
+       }
 
-       /**
-        * 
-        */
        public void setFocus() {
                if(text != null && ! text.isDisposed()){
                        text.setFocus();
index 5c0e8676ed02da8bbc536308dd3309393683d872..4a8ae8a3ce9df24256ef97a5e99e4312e99a7e11 100644 (file)
@@ -22,12 +22,17 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.strategy.merge.MergeException;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityContainer;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * <p>MergeGroupHandler class.</p>
@@ -71,10 +76,41 @@ public class MergeGroupHandler extends AbstractHandler {
                        }                       
                        Object targetEntity = ((IEntityContainer<?>) targetAnnotation).getEntity();
                        
+                       TeamOrPersonBase teamOrPerson = null;
+                       Reference ref = null;
+                       if (targetEntity instanceof TeamOrPersonBase){
+                               teamOrPerson = HibernateProxyHelper.deproxy(targetEntity, TeamOrPersonBase.class);
+                       } else if(targetEntity instanceof Reference){
+                               ref = HibernateProxyHelper.deproxy(targetEntity, Reference.class);
+                       }
                        logger.info("Merging group");
 //                     model.printAnnotations();
                        for (LineAnnotation annotation : candidateAnnotations) {
+                               //first check whether entities are mergeable
+                               
                                
+                       try{
+                               if (ref != null){
+                                       Reference ref2 = HibernateProxyHelper.deproxy(annotation.getEntity(), Reference.class);
+                                       
+                                       if (!CdmStore.getCommonService().isMergeable(ref, ref2, null)){
+                                               MessageDialog.openWarning(HandlerUtil.getActiveShell(event), 
+                                                               "No merge possible", "A merge of " + ref.getTitleCache() + " and " + ref2.getTitleCache() + " is not possible.");
+                                               return null;
+                                       }
+                               }
+                               if (teamOrPerson != null){
+                                       TeamOrPersonBase teamOrPerson2 = HibernateProxyHelper.deproxy(annotation.getEntity(), TeamOrPersonBase.class);
+                                       
+                                       if (!CdmStore.getCommonService().isMergeable(teamOrPerson, teamOrPerson2, null)){
+                                               MessageDialog.openWarning(HandlerUtil.getActiveShell(event), 
+                                                               "No merge possible", "A merge of " + teamOrPerson.getTitleCache() + " and " + teamOrPerson2.getTitleCache() + " is not possible.");
+                                               return null;
+                                       }
+                               }
+                       }catch(MergeException e){
+                                       
+                       }
                                ((BulkEditor) editor).removeAnnotatedLine(annotation);
                                
                                // Mark entity container for merging with target entity
index 2a739544f0deeab50984dc606b4db9d09ca8d4d0..bae14730a3e804fb7ad11e1ade91c9520d45ba64 100644 (file)
@@ -1,23 +1,18 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.bulkeditor.input;
 
-import java.util.Arrays;
 import java.util.List;
-import java.util.UUID;
-
-import org.eclipse.core.commands.ExecutionException;
 
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
-import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
 import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Person;
@@ -29,7 +24,6 @@ import eu.etaxonomy.cdm.strategy.merge.MergeException;
 import eu.etaxonomy.cdm.strategy.merge.MergeMode;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.handler.MergeGroupHandler;
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.AgentCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
 import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
@@ -38,62 +32,32 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 
 
 /**
- * <p>AgentEditorInput class.</p>
- *
  * @author p.ciardelli
  * @created 25.06.2009
  * @version 1.0
  */
 public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase> {
 
-       /**
-        * 
-        */
        private static final long serialVersionUID = 3387950621617078479L;
 
-       /** Constant <code>ID="bulkeditor.input.author"</code> */
        public static final String ID = "bulkeditor.input.author";
-       
+
        private static AgentEditorInput instance;
 
-       /**
-        * <p>getID</p>
-        *
-        * @return the iD
-        */
        public static String getID() {
                return ID;
        }
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getName()
-        */
-       /**
-        * <p>getName</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       public String getName() {
+
+       @Override
+    public String getName() {
                return BulkEditorInputType.AGENT.label;
        }
 
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getToolTipText()
-        */
-       /**
-        * <p>getToolTipText</p>
-        *
-        * @return a {@link java.lang.String} object.
-        */
-       public String getToolTipText() {
+       @Override
+    public String getToolTipText() {
                return getName();
        }
 
-       /**
-        * <p>Getter for the field <code>instance</code>.</p>
-        *
-        * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
-        */
        public static AbstractBulkEditorInput getInstance() {
                if (instance == null) {
                        instance = new AgentEditorInput();
@@ -101,24 +65,18 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                return instance;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
-        */
        /** {@inheritDoc} */
        @Override
        public boolean isMergingEnabled() {
                return true;
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
-        */
+
        /** {@inheritDoc} */
        @Override
        public boolean isConvertingEnabled() {
                return true;
        }
-       
+
        /** {@inheritDoc} */
        @Override
     public boolean merge(TeamOrPersonBase entity, TeamOrPersonBase mergeTarget) {
@@ -126,7 +84,7 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
                        try {
                                IMergeStrategy strategy = DefaultMergeStrategy.NewInstance(Person.class);
                                strategy.setMergeMode("institutionalMemberships", MergeMode.FIRST);
-                               CdmStore.getCommonService().merge((IMergable)mergeTarget, (IMergable)entity, strategy);                         
+                               CdmStore.getCommonService().merge((IMergable)mergeTarget, (IMergable)entity, strategy);
                        } catch (MergeException e) {
                                MessagingUtils.errorDialog("Bulk Editor Merge Error",
                                                this,
@@ -144,42 +102,36 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
        public List<TeamOrPersonBase> listEntities(IIdentifiableEntityServiceConfigurator configurator) {
                return CdmStore.getSearchManager().findTeamOrPersons(configurator);
        }
-       
-       /** {@inheritDoc} 
+
+       /** {@inheritDoc}
        @Override
        public AgentBase loadEntity(UUID uuid) {
-               List<String> propertyPaths = Arrays.asList(new String[]{}); 
+               List<String> propertyPaths = Arrays.asList(new String[]{});
                return CdmStore.getService(IAgentService.class).load(uuid, propertyPaths);
        }*/
 
-       
+
        public boolean delete(AgentBase entity) throws ReferencedObjectUndeletableException  {
-               
-                       return CdmStore.getService(IAgentService.class).delete(entity) != null;                 
-               
+
+                       return CdmStore.getService(IAgentService.class).delete(entity) != null;
+
        }
 
        /** {@inheritDoc} */
        public boolean save(AgentBase entity) {
-               
+
                return CdmStore.getService(IAgentService.class).saveOrUpdate(entity) != null;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getSortProviders()
-        */
        @Override
        public List<IBulkEditorSortProvider<TeamOrPersonBase>> getSortProviders() {
                List<IBulkEditorSortProvider<TeamOrPersonBase>> sortProviders = super.getSortProviders();
-               
+
                sortProviders.add(0, new IdentifiableEntitySortProvider<TeamOrPersonBase>());
-               
+
                return sortProviders;
        }
-       
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
-        */
+
        @Override
        protected IEntityCreator<TeamOrPersonBase> createEntityCreator() {
                return new AgentCreator();
index 1c03030fc915ddc834cf1df4280e190e31a92032..8281fca55730c8e4d81a2fa766ff092f498fea7d 100644 (file)
@@ -9,7 +9,7 @@ editor.name.1 = Key
 editor.name.2 = Polytomous Key Graph Editor\r
 editor.name.3 = Polytomous Key List Editor\r
 editor.name.4 = Cdm Authority Editor\r
-editor.name.5 = Derivative View\r
+editor.name.5 = Derivative Editor\r
 view.name = Factual Data\r
 view.name.0 = Uses\r
 view.name.1 = Media\r
@@ -112,7 +112,7 @@ command.name.32 = Create Concept Relation
 command.name.33 = Open Related Concept\r
 category.name.7 = -- Group\r
 command.name.34 = Edit CDM Authorities\r
-command.name.35 = Open Derivative View\r
+command.name.35 = Open Derivative Editor\r
 scheme.description = The default key binding scheme for the Taxonomic Editor\r
 scheme.name = Taxonomic Editor Default Key Bindings\r
 editor.name.6 = Specimen Import Editor\r
index 803b460b910b316e22385caaf708145194e9e992..a4d096a11d103606e828005e75ba6cb461142e33 100644 (file)
@@ -112,7 +112,7 @@ command.name.32 = Erstelle Konzeptrelationen
 command.name.33 = \u00d6ffne verbundenes Konzept
 category.name.7 = -- Gruppe
 command.name.34 = Bearbeite CDM Rechte
-command.name.35 = \u00d6ffne Derivate Ansicht
+command.name.35 = \u00d6ffne Derivat-Editor
 scheme.description = Die Standard Tastenkombinationsschema f\u00fcr den Taxonomischen Editor
 scheme.name = Taxonomic Editor Standard Tastenkombinationen
 editor.name.6 = Specimen Import Editor
index 65d48bae536842cd7d76985773f77ae134851e3f..17a5b049048252c4a6b4c41bee895d67cbf1b017 100644 (file)
@@ -111,7 +111,6 @@ command.name.32 = Create Concept Relation
 command.name.33 = Open Related Concept\r
 category.name.7 = -- Group\r
 command.name.34 = Edit CDM Authorities\r
-command.name.35 = Open Derivate View\r
 scheme.description = The default key binding scheme for the Taxonomic Editor\r
 scheme.name = Taxonomic Editor Default Key Bindingseditor.name.6 = Specimen Import Editor\r
 editor.name.7 = Gbif Import Editor\r
index b3c364a17b50b074d2136075a4a9e7c32af3de97..b9a3d50db54a0e6946d6ef4b413333c62c4b3d6a 100644 (file)
                commandId="eu.etaxonomy.taxeditor.editor.command.new.name"
                label="%command.label.46"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.reference"
                label="%command.label.47"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.team"
                label="%command.label.1"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="eu.etaxonomy.taxeditor.editor.command.new.person"
                label="%command.label.2"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator2"
                commandId="eu.etaxonomy.taxeditor.editor.command.new.specimen"
                label="%command.label.3"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator3"
                commandId="eu.etaxonomy.taxeditor.editor.command.new.datasource"
                label="%command.label.48"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.descriptive">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.media">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.concept">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   value="eu.etaxonomy.taxeditor.editor.view.concept.graph">
             </parameter>
             <visibleWhen
-                  checkEnabled="true">
-               <and>
-                  <reference
-                        definitionId="isShowExperimentalFeatures">
-                  </reference>
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </and>
+                  checkEnabled="false">
+               <reference
+                     definitionId="isShowExperimentalFeatures">
+               </reference>
             </visibleWhen>
          </command>
       </menuContribution>
                commandId="eu.etaxonomy.taxeditor.editor.command.openParent"
                label="%command.label.8"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
             <visibleWhen
                   checkEnabled="true">
                <or>
-                  <reference
-                        definitionId="isDescriptionElement">
-                  </reference>
                   <reference
                         definitionId="isFeatureNodeContainer">
                   </reference>
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
       </menuContribution>
    </extension>
             id="eu.etaxonomy.taxeditor.editor.media.command.delete"
             name="%command.name.49">
       </command>
+      
       <category
             id="eu.etaxonomy.taxeditor.editor.new.category"
             name="%category.name.4">
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionToOtherTaxonHandler"
-            id="eu.etaxonomy.taxeditor.editor.commands.description.moveDescriptionToTaxon"
+            id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionToTaxon"
             name="%command.name.13">
       </command>
+       
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.MoveDescriptionElementsHandler"
-            id="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
+            id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.moveDescriptionElements"
             name="%command.name.12">
       </command>
         
          </description>
       </wizard>
    </extension>
+    <extension
+          point="eu.etaxonomy.taxeditor.store.cdmViewer">
+       <cdmViewer
+             class="eu.etaxonomy.taxeditor.editor.EditorCdmViewer">
+       </cdmViewer>
+    </extension>
 </plugin>
index 5fc0b2b9a7398afbfecf0dc27e8f399364f39646..7b9a605cf3719f445a17a58678363142ff271d39 100644 (file)
@@ -83,6 +83,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
 
        @Override
        public void setFocus() {
+               getConversationHolder().commit(true);
                getConversationHolder().bind();
                super.setFocus();
        }
index ceae45d69d43fd57c6ea825e9928e868b7ac14f8..dc81964bcb980a3f797810c654c7f6c6b073264f 100644 (file)
@@ -345,7 +345,8 @@ public class PolytomousKeyListEditor extends EditorPart implements
        @Override
        public boolean postOperation(CdmBase objectAffectedByOperation) {
                viewer.refresh();
-
+               getConversationHolder().bind();
+               getConversationHolder().commit(true);
                editor.changed(objectAffectedByOperation);
 
                if (objectAffectedByOperation != null) {
index 3b4ae0d7ab1d1bcad784e2b7d041f4eabee34ad3..f31a83125aa62cf9cf7d9846550908e69a0b318d 100644 (file)
@@ -12,9 +12,12 @@ import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
+import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -52,15 +55,27 @@ public class DeleteNodeOperation extends AbstractPostTaxonOperation {
                controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
                
                IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
-               
+               DeleteResult result;
                if (node.getChildren().size()>0){
                        if(! MessageDialog.openQuestion(null, "Confirm deletion of children", "The selected node has children, do you want to delete them, too?")) {
-                               service.delete(node.getUuid(), false);
+                               result = service.delete(node.getUuid(), false);
                        } else{
-                               service.delete(node.getUuid(), true);
+                               result = service.delete(node.getUuid(), true);
                        }
                } else{
-                       service.delete(node.getUuid(), true);
+                       result = service.delete(node.getUuid(), true);
+               }
+               
+               if (!result.isOk() || result.getExceptions().size() > 0){
+                       Exception t = new Exception();
+                       if (result.getExceptions().size() >1){
+                               for (Exception e:result.getExceptions()){
+                                       t.addSuppressed(e);
+                               }
+                       }else {
+                               t = result.getExceptions().iterator().next();
+                       }
+                       MessagingUtils.errorDialog("Exception occured. Delete not possible", getClass(),null, TaxeditorBulkeditorPlugin.PLUGIN_ID, t, true);
                }
                return postExecute(null);
        }
index a74d15d44c56ca2ddcb11d95df5fc740297d1631..5be66c8bce3a9913d602e7e09673efd28c78891d 100644 (file)
@@ -21,6 +21,9 @@ import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
+ * Input for {@link DataImportEditor}. This class queries a data source for
+ * occurrences and passes them to the editor.
+ *
  * @author pplitzner
  * @date 25.02.2014
  *
@@ -35,65 +38,40 @@ public abstract class DataImportEditorInput<T> implements IEditorInput {
 
     protected OccurenceQuery query;
 
-    /**
-     * @param results
-     */
     public DataImportEditorInput() {
         this.conversationHolder = CdmStore.createConversation();
     }
 
-
-    /* (non-Javadoc)
-     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-     */
     @Override
     public Object getAdapter(Class adapter) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#exists()
-     */
     @Override
     public boolean exists() {
         return false;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-     */
     @Override
     public ImageDescriptor getImageDescriptor() {
         // TODO Auto-generated method stub
         return null;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getPersistable()
-     */
     @Override
     public IPersistableElement getPersistable() {
         return null;
     }
 
-    /**
-     * @return the results
-     */
     public Collection<T> getResults() {
         return results;
     }
 
-    /**
-     * @param results the results to set
-     */
     public void setResults(Collection<T> results) {
         this.results = results;
     }
 
-    /**
-     * @return the conversationHolder
-     */
     public ConversationHolder getConversationHolder() {
         return conversationHolder;
     }
index ed7c89cc0cf3313004d0ee90754c186585ec99ec..3aaf22c5269c7e72b2681852295ae285da873d1f 100644 (file)
@@ -26,9 +26,6 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
  */
 public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
 
-    /**
-     * @param query
-     */
     public GbifImportEditorInput(OccurenceQuery query) {
         super();
         this.query = query;
@@ -50,25 +47,16 @@ public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
     }
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getName()
-     */
     @Override
     public String getName() {
         return "[GBIF] " + query.toString();
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getToolTipText()
-     */
     @Override
     public String getToolTipText() {
         return "[GBIF] " + query.toString();
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
     @Override
     public int hashCode() {
         final int prime = 31;
@@ -77,9 +65,6 @@ public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
         return result;
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
index 407234ba7fa2c07b1571cc83d8bc912576efefd7..d1daa7b1f27dea8b4fb874d0ca0f72fe003eb84d 100644 (file)
@@ -1344,7 +1344,7 @@ public class TransientTaxonService implements ITaxonService {
     public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
         return defaultService.getSynonymsByHomotypicGroup(taxon, propertyPaths);
     }
-
+    
     @Override
     public Synonym changeRelatedTaxonToSynonym(Taxon fromTaxon, Taxon toTaxon,
             TaxonRelationshipType oldRelationshipType,
index 7548960d901fee8e5cf57967c11d847e1f60866a..a7845395ed1b783ac5bb80dc3a0cf5d933986ed5 100644 (file)
@@ -166,7 +166,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
             DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
             return derivateViewEditorInput.getName();
         }
-        return "Derivative View";
+        return "Derivative Editor";
     }
 
     /* (non-Javadoc)
index b863dcbe28a14aa047007dccf5189f11df1cd582..9931904ff8478df078fe61513974fef264703074 100644 (file)
@@ -63,7 +63,7 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
             derivateView = (DerivateView) getPostOperationEnabled();
         }
         if(derivateView==null){
-            MessagingUtils.operationDialog(this, new NullPointerException("DerivativeView was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
+            MessagingUtils.operationDialog(this, new NullPointerException("Derivative Editor was null"), TaxeditorEditorPlugin.PLUGIN_ID, this.getLabel(), getLabel());
             return Status.CANCEL_STATUS;
         }
         if(derivateView.isDirty()){
index 0c2306ba6081a6da06c1e32e6b2dedc3cd552664..9a801a4d412797995c6899f6ae3f8c6045152438 100644 (file)
@@ -20,25 +20,36 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.AnnotationType;
+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.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 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.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.Page;
+import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 
 
 /**
@@ -46,8 +57,9 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
  * @created Feb 8, 2011
  * @version 1.0
  */
-public class MoveDescriptionElementsHandler extends AbstractHandler {
-
+public class MoveDescriptionElementsHandler extends AbstractHandler implements IPostOperationEnabled{
+       private UUID newAcceptedTaxonNodeUuid;
+       private TaxonNameEditor editor;
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
@@ -55,7 +67,7 @@ public class MoveDescriptionElementsHandler extends AbstractHandler {
        public Object execute(ExecutionEvent event) throws ExecutionException {
                
 //             ConversationHolder conversation = CdmStore.createConversation();
-               
+               editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
                ISelection selection = HandlerUtil.getCurrentSelection(event);
                
                if(selection instanceof IStructuredSelection){
@@ -81,14 +93,28 @@ public class MoveDescriptionElementsHandler extends AbstractHandler {
                        if(elements.size() == 0){
                                return null;
                        }
+                       DescriptionBase description = elements.get(0).getInDescription();
+                       List<UUID> excludeTaxa = new ArrayList<UUID>();
+                       if (description.isInstanceOf(TaxonDescription.class)){
+                               TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class);
+                               Taxon actualTaxon = taxonDescription.getTaxon();
+                               excludeTaxa.add(actualTaxon.getUuid());
+                       }
                        
-                       Taxon targetTaxon = TaxonBaseSelectionDialog.selectTaxon(HandlerUtil.getActiveShell(event), EditorUtil.getActiveMultiPageTaxonEditor().getConversationHolder(), null);
+                       
+                       TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
+                                       editor.getConversationHolder(),
+                                       "Choose the accepted taxon",
+                                       excludeTaxa,
+                                       null,
+                                       null);
+                       Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
                        
                        if(targetTaxon == null){
                                // canceled
                                return null;
                        }
-                                               
+                       newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();                      
                        TaxonDescription targetDescription = TaxonDescription.NewInstance(targetTaxon);
                        String moveMessage = String.format("Elements moved from %s", EditorUtil.getActiveMultiPageTaxonEditor().getTaxon());
                        targetDescription.setTitleCache(moveMessage, true);
@@ -99,10 +125,11 @@ public class MoveDescriptionElementsHandler extends AbstractHandler {
                        try {
                                AbstractPostOperation operation = new MoveDescriptionElementsOperation(
                                                event.getCommand().getName(), EditorUtil.getUndoContext(), 
-                                               targetDescription, elements, false, (IPostOperationEnabled) EditorUtil.getView(DescriptiveViewPart.ID, true));
+                                               targetDescription, elements, false, this);
+                               
                                EditorUtil.executeOperation(operation);
-//                             conversation.commit(true);
-                               CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
+                               
+                               //CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
                                
                        } catch (NotDefinedException e) {
                                MessagingUtils.error(getClass(), e);
@@ -112,4 +139,44 @@ public class MoveDescriptionElementsHandler extends AbstractHandler {
                return null;
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
+               
+               editor.getConversationHolder().bind();
+               editor.getConversationHolder().commit(true);
+               Display.getDefault().asyncExec(new Runnable(){
+                       
+            public void run() {
+                               //AbstractUtility.close(editor.getMultiPageTaxonEditor());
+
+                               try {
+                                       MultiPageTaxonEditor possibleOpenEditor = (MultiPageTaxonEditor) EditorUtil.findEditorByTaxonNodeUuid(newAcceptedTaxonNodeUuid);
+                                       if(possibleOpenEditor != null){
+                                               AbstractUtility.close(possibleOpenEditor);
+                                       }
+                                       EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid);
+                               } catch (PartInitException e) {
+                                       MessagingUtils.error(this.getClass(), e);
+                                       throw new RuntimeException(e);
+                               } catch (Exception e) {
+                                       MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
+                               }
+                       }
+
+               });
+
+
+               return true;
+       }
+
+       @Override
+       public boolean onComplete() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+       
 }
index ab67cf8c6221f297bd97db55a4176b697e168e5d..c4b57e9cb4629968822bd35d951b0bbb9c407a00 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
@@ -28,6 +29,7 @@ import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionToOtherTaxonOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -66,8 +68,14 @@ public class MoveDescriptionToOtherTaxonHandler extends AbstractHandler
                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
 
                        for(Object element : structuredSelection.toArray()){
-                               if (element instanceof TaxonDescription){
-                                       UUID uuid = ((TaxonDescription)element).getUuid();
+                               UUID uuid = null;
+                               if (element instanceof FeatureNodeContainer){
+                                       uuid = ((FeatureNodeContainer)element).getDescription().getUuid();
+                               }       else if (element instanceof DescriptionBase){
+                                       uuid = ((DescriptionBase)element).getUuid();
+                               }
+                               
+                               if (uuid != null){
                                        descriptions.add((TaxonDescription) CdmStore.getService(IDescriptionService.class).load(uuid, null));
                                }
                        }
index 5b4b0053ed727bfea012bd536bf289b3378dd06e..fd74d72745e6dc55a6ef9ba1e3f7b74ca6c2f8d1 100644 (file)
@@ -17,10 +17,17 @@ 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 org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -30,7 +37,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Feb 8, 2011
  * @version 1.0
  */
-public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation {
+public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation{
 
        private Collection<DescriptionElementBase> descriptionElements;
        private DescriptionBase targetDescription;
@@ -68,6 +75,7 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
                
                service.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isCopy);
                
+               
                return postExecute(targetDescription);
        }
 
@@ -90,5 +98,7 @@ public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation
                // TODO Auto-generated method stub
                return null;
        }
+       
+       
 
 }
index 73564880ab8a98167a170b6ea6baf7e95a4185d6..421dda37b47695e7305d74400a71e3d3e1ac2a72 100644 (file)
@@ -8,4 +8,4 @@ root.win32.win32.x86_64.permissions.755=jre/bin/**
 root.win32.win32.x86=win-32
 root.win32.win32.x86.permissions.755=jre/bin/**
 root.macosx.cocoa.x86_64=mac-64
-root.macosx.cocoa.x86_64.permissions.755=jre/bin/**
\ No newline at end of file
+root.macosx.cocoa.x86_64.permissions.755=jre/Contents/Home/jre/bin/**
\ No newline at end of file
index d770e631e0082036bed708bef7aad602543ec282..3ee9c828b60a847b69207b75793900e1e9b5c4a2 100644 (file)
@@ -15,27 +15,150 @@ Bundle-ClassPath: .,
  lib/sequencing-1.9.2-SNAPSHOT.jar,
  lib/tic-core-2-SNAPSHOT.jar,
  lib/tic-swt-2-SNAPSHOT.jar
-Export-Package: info.bioinfweb.commons.collections,
+Export-Package: info.bioinfweb.commons,
+ info.bioinfweb.commons.appversion,
+ info.bioinfweb.commons.beans,
+ info.bioinfweb.commons.bio,
+ info.bioinfweb.commons.changemonitor,
+ info.bioinfweb.commons.collections,
+ info.bioinfweb.commons.collections.observable,
+ info.bioinfweb.commons.graphics,
+ info.bioinfweb.commons.io,
+ info.bioinfweb.commons.log,
+ info.bioinfweb.commons.progress,
+ info.bioinfweb.commons.swing,
+ info.bioinfweb.commons.swing.scrollpaneselector,
+ info.bioinfweb.commons.swt,
+ info.bioinfweb.commons.text,
+ info.bioinfweb.libralign,
+ info.bioinfweb.libralign.actions,
  info.bioinfweb.libralign.alignmentarea,
+ info.bioinfweb.libralign.alignmentarea.content,
+ info.bioinfweb.libralign.alignmentarea.label,
  info.bioinfweb.libralign.alignmentarea.order,
  info.bioinfweb.libralign.alignmentarea.paintsettings,
+ info.bioinfweb.libralign.alignmentarea.rowsarea,
  info.bioinfweb.libralign.alignmentarea.selection,
  info.bioinfweb.libralign.alignmentarea.tokenpainter,
  info.bioinfweb.libralign.dataarea,
  info.bioinfweb.libralign.dataarea.implementations,
+ info.bioinfweb.libralign.dataarea.implementations.charset,
  info.bioinfweb.libralign.dataarea.implementations.pherogram,
  info.bioinfweb.libralign.editsettings,
  info.bioinfweb.libralign.model,
  info.bioinfweb.libralign.model.adapters,
+ info.bioinfweb.libralign.model.concatenated,
+ info.bioinfweb.libralign.model.data,
  info.bioinfweb.libralign.model.events,
+ info.bioinfweb.libralign.model.exception,
+ info.bioinfweb.libralign.model.factory,
+ info.bioinfweb.libralign.model.factory.continuous,
  info.bioinfweb.libralign.model.implementations,
+ info.bioinfweb.libralign.model.implementations.swingundo,
+ info.bioinfweb.libralign.model.implementations.swingundo.edits,
+ info.bioinfweb.libralign.model.implementations.swingundo.edits.sequence,
+ info.bioinfweb.libralign.model.implementations.swingundo.edits.token,
+ info.bioinfweb.libralign.model.implementations.translation,
  info.bioinfweb.libralign.model.tokenset,
+ info.bioinfweb.libralign.model.tokenset.continuous,
  info.bioinfweb.libralign.multiplealignments,
  info.bioinfweb.libralign.pherogram,
+ info.bioinfweb.libralign.pherogram.distortion,
  info.bioinfweb.libralign.pherogram.model,
  info.bioinfweb.libralign.pherogram.provider,
  info.bioinfweb.libralign.pherogram.view,
  info.bioinfweb.tic,
+ info.bioinfweb.tic.exception,
  info.bioinfweb.tic.input,
- org.biojava.bio.chromatogram
+ info.bioinfweb.tic.toolkit,
+ info.bioinfweb.tic.toolkit.layoutdata,
+ org.biojava.bibliography,
+ org.biojava.bio,
+ org.biojava.bio.alignment,
+ org.biojava.bio.annodb,
+ org.biojava.bio.chromatogram,
+ org.biojava.bio.chromatogram.graphic,
+ org.biojava.bio.dist,
+ org.biojava.bio.dp,
+ org.biojava.bio.dp.onehead,
+ org.biojava.bio.dp.twohead,
+ org.biojava.bio.molbio,
+ org.biojava.bio.program,
+ org.biojava.bio.program.abi,
+ org.biojava.bio.program.blast2html,
+ org.biojava.bio.program.fastq,
+ org.biojava.bio.program.formats,
+ org.biojava.bio.program.gff,
+ org.biojava.bio.program.gff3,
+ org.biojava.bio.program.hmmer,
+ org.biojava.bio.program.homologene,
+ org.biojava.bio.program.indexdb,
+ org.biojava.bio.program.phred,
+ org.biojava.bio.program.scf,
+ org.biojava.bio.program.ssaha,
+ org.biojava.bio.program.ssbind,
+ org.biojava.bio.program.tagvalue,
+ org.biojava.bio.program.unigene,
+ org.biojava.bio.program.xff,
+ org.biojava.bio.program.xml,
+ org.biojava.bio.proteomics,
+ org.biojava.bio.proteomics.aaindex,
+ org.biojava.bio.search,
+ org.biojava.bio.seq,
+ org.biojava.bio.seq.db,
+ org.biojava.bio.seq.db.biofetch,
+ org.biojava.bio.seq.db.emblcd,
+ org.biojava.bio.seq.db.flat,
+ org.biojava.bio.seq.distributed,
+ org.biojava.bio.seq.filter,
+ org.biojava.bio.seq.homol,
+ org.biojava.bio.seq.impl,
+ org.biojava.bio.seq.io,
+ org.biojava.bio.seq.io.agave,
+ org.biojava.bio.seq.io.filterxml,
+ org.biojava.bio.seq.io.game,
+ org.biojava.bio.seq.io.game12,
+ org.biojava.bio.seq.projection,
+ org.biojava.bio.symbol,
+ org.biojava.bio.taxa,
+ org.biojava.directory,
+ org.biojava.naming,
+ org.biojava.ontology,
+ org.biojava.ontology.io,
+ org.biojava.ontology.obo,
+ org.biojava.stats.svm,
+ org.biojava.stats.svm.tools,
+ org.biojava.utils,
+ org.biojava.utils.automata,
+ org.biojava.utils.cache,
+ org.biojava.utils.candy,
+ org.biojava.utils.io,
+ org.biojava.utils.lsid,
+ org.biojava.utils.math,
+ org.biojava.utils.net,
+ org.biojava.utils.process,
+ org.biojava.utils.regex,
+ org.biojava.utils.stax,
+ org.biojava.utils.walker,
+ org.biojava.utils.xml,
+ org.biojavax,
+ org.biojavax.bio,
+ org.biojavax.bio.alignment,
+ org.biojavax.bio.alignment.blast,
+ org.biojavax.bio.db,
+ org.biojavax.bio.db.ncbi,
+ org.biojavax.bio.seq,
+ org.biojavax.bio.seq.io,
+ org.biojavax.bio.taxa,
+ org.biojavax.bio.taxa.io,
+ org.biojavax.ga,
+ org.biojavax.ga.exception,
+ org.biojavax.ga.functions,
+ org.biojavax.ga.impl,
+ org.biojavax.ga.util,
+ org.biojavax.ontology,
+ org.biojavax.utils,
+ org.jdesktop.swingx.scrollpaneselector
 Bundle-ActivationPolicy: lazy
+Import-Package: javax.swing
+Require-Bundle: org.eclipse.swt
index 38ab0a72ca64c613b5b7b894d6a665d6afbc38a3..05dba64f189a6a8eeac1d30c54bd3e541a0f3c3d 100644 (file)
@@ -16,3 +16,7 @@ Require-Bundle: org.eclipse.ui,
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: EDIT
+Export-Package: eu.etaxonomy.taxeditor.molecular,
+ eu.etaxonomy.taxeditor.molecular.editor,
+ eu.etaxonomy.taxeditor.molecular.handler
+Bundle-ClassPath: .
index e4bf8ac385bd985f3c91555d812a0bdfba38c571..bdd1c23c42f573c05d209014e892ed57663fdf11 100644 (file)
@@ -1,4 +1,6 @@
-bin.includes = META-INF/,\
+bin.includes = .,\
+                          META-INF/,\
                plugin.xml,\
                icons/,\
                OSGI-INF/
+source.. = src/main/java/
diff --git a/eu.etaxonomy.taxeditor.molecular/lib/.gitignore b/eu.etaxonomy.taxeditor.molecular/lib/.gitignore
deleted file mode 100644 (file)
index 0557829..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/*.jar
index 2ace44ef5c2038708d29704c16ca45c31fa1c80a..86609245a3571b0d1283dfd2b75e6977e441a567 100644 (file)
          <dynamic
                class="eu.etaxonomy.taxeditor.navigation.RecentNamesContributionItem"
                id="eu.etaxonomy.taxeditor.navigation.recentnames">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </dynamic>
       </menuContribution>
       <menuContribution
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.navigator">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart">
             </parameter>
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
                id="eu.etaxonomy.taxeditor.navigation.search.toolbar">
             <control
                   class="eu.etaxonomy.taxeditor.navigation.search.SearchBar">
-               <visibleWhen
-                     checkEnabled="true">
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </visibleWhen>
             </control>
          </toolbar>
       </menuContribution>
                commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
                label="%command.label.13"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.navigation.menu.new.separator1"
                id="eu.etaxonomy.taxeditor.navigation.create.classificationHandler"
                label="%command.label.14"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
          </with>
       </definition>
    </extension>
+   <extension
+         point="eu.etaxonomy.taxeditor.store.cdmViewer">
+      <cdmViewer
+            class="eu.etaxonomy.taxeditor.navigation.NavigationCdmViewer">
+      </cdmViewer>
+   </extension>
 </plugin>
index 6075a5062f122bba9aaa72f6a72341269d26685e..09861da31f570eab8ec72987fa1871250de4df73 100644 (file)
@@ -247,6 +247,8 @@ public class PolytomousKeyViewPart extends ViewPart implements
         */
        @Override
        public boolean postOperation(CdmBase objectAffectedByOperation) {
+               getConversationHolder().bind();
+               getConversationHolder().commit(true);
                viewer.refresh();
                return true;
        }
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorContentService.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorContentService.java
new file mode 100644 (file)
index 0000000..46c659b
--- /dev/null
@@ -0,0 +1,30 @@
+package eu.etaxonomy.taxeditor.navigation.navigator;
+
+import org.eclipse.ui.internal.navigator.NavigatorContentService;
+import org.eclipse.ui.navigator.INavigatorDnDService;
+
+public class TaxonNavigatorContentService extends NavigatorContentService {
+
+       private TaxonNavigatorDnDService navigatorDnDService;
+
+       public TaxonNavigatorContentService(String viewerID) {
+               super(viewerID);
+               
+               
+       }
+       
+       public TaxonNavigatorContentService(String aViewerId,
+                       TaxonNavigatorViewer taxonNavigatorViewer) {
+               super(aViewerId, taxonNavigatorViewer);
+               getDnDService();
+       }
+
+       @Override
+       public TaxonNavigatorDnDService getDnDService() {
+               if (navigatorDnDService == null) {
+                       navigatorDnDService = new TaxonNavigatorDnDService(this);
+               }
+               return navigatorDnDService;
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDnDService.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDnDService.java
new file mode 100644 (file)
index 0000000..5de170c
--- /dev/null
@@ -0,0 +1,170 @@
+package eu.etaxonomy.taxeditor.navigation.navigator;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.ui.internal.navigator.dnd.CommonDropAdapterDescriptor;
+import org.eclipse.ui.internal.navigator.dnd.CommonDropDescriptorManager;
+import org.eclipse.ui.internal.navigator.extensions.CommonDragAssistantDescriptor;
+import org.eclipse.ui.internal.navigator.extensions.NavigatorViewerDescriptor;
+import org.eclipse.ui.navigator.CommonDragAdapterAssistant;
+import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import org.eclipse.ui.navigator.INavigatorContentService;
+import org.eclipse.ui.navigator.INavigatorDnDService;
+
+import eu.etaxonomy.taxeditor.navigation.navigator.dnd.TaxonNavigatorDragAdapterAssistant;
+
+public class TaxonNavigatorDnDService implements INavigatorDnDService {
+       private static final CommonDropAdapterAssistant[] NO_ASSISTANTS = new CommonDropAdapterAssistant[0];
+
+       private INavigatorContentService contentService;
+
+       private TaxonNavigatorDragAdapterAssistant[] dragAssistants;
+       
+       private TreeNodeDropAdapter dropAdapter;
+
+       private final Map dropAssistants = new HashMap();
+       
+       public TaxonNavigatorDnDService(INavigatorContentService contentService){
+               this.contentService = contentService;
+       }
+       
+       
+       @Override
+       public CommonDragAdapterAssistant[] getCommonDragAssistants() {
+               
+               return dragAssistants;
+       }
+
+       @Override
+       public void bindDragAssistant(CommonDragAdapterAssistant anAssistant) {
+               if(dragAssistants == null) 
+                       initializeDragAssistants(); 
+               TaxonNavigatorDragAdapterAssistant[] newDragAssistants = new TaxonNavigatorDragAdapterAssistant[dragAssistants.length + 1];
+               System.arraycopy(dragAssistants, 0, newDragAssistants, 0, dragAssistants.length);
+               newDragAssistants[dragAssistants.length] = (TaxonNavigatorDragAdapterAssistant) anAssistant;
+               dragAssistants = newDragAssistants;             
+
+       }
+       
+       private void initializeDragAssistants() {
+               int i = 0;
+               Set dragDescriptors = ((NavigatorViewerDescriptor) contentService
+                               .getViewerDescriptor()).getDragAssistants();
+               dragAssistants = new TaxonNavigatorDragAdapterAssistant[dragDescriptors
+                               .size()];
+               for (Iterator iter = dragDescriptors.iterator(); iter.hasNext();) {
+                       CommonDragAssistantDescriptor descriptor = (CommonDragAssistantDescriptor) iter
+                                       .next();
+                       dragAssistants[i++] = (TaxonNavigatorDragAdapterAssistant) descriptor.createDragAssistant();
+               }
+       }
+
+       @Override
+       public CommonDropAdapterAssistant[] findCommonDropAdapterAssistants(
+                       Object aDropTarget, TransferData aTransferType) {
+               CommonDropAdapterDescriptor[] descriptors = CommonDropDescriptorManager
+                               .getInstance().findCommonDropAdapterAssistants(aDropTarget,
+                                               contentService);
+
+               if (descriptors.length == 0) {
+                       return NO_ASSISTANTS;
+               }
+
+               if (LocalSelectionTransfer.getTransfer().isSupportedType(aTransferType)  
+                                               && LocalSelectionTransfer.getTransfer().getSelection() instanceof IStructuredSelection) {
+                       return getAssistantsBySelection(descriptors, (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection());
+               } 
+               return getAssistantsByTransferData(descriptors, aTransferType);
+       }
+       
+       private CommonDropAdapterAssistant[] getAssistantsByTransferData(
+                       CommonDropAdapterDescriptor[] descriptors,
+                       TransferData aTransferType) {
+
+               Set assistants = new LinkedHashSet();
+               for (int i = 0; i < descriptors.length; i++) {
+                       CommonDropAdapterAssistant asst = getAssistant(descriptors[i]);
+                       if (asst.isSupportedType(aTransferType)) {
+                               assistants.add(asst);
+                       }
+               }
+               return sortAssistants((CommonDropAdapterAssistant[]) assistants
+                               .toArray(new CommonDropAdapterAssistant[assistants.size()]));
+
+       }
+       
+       private CommonDropAdapterAssistant[] getAssistantsBySelection(
+                       CommonDropAdapterDescriptor[] descriptors, IStructuredSelection aSelection) {
+
+               Set assistants = new LinkedHashSet(); 
+                       
+               for (int i = 0; i < descriptors.length; i++) {
+                       if(descriptors[i].areDragElementsSupported(aSelection)) {
+                               assistants.add(getAssistant(descriptors[i]));
+                       }
+               }  
+
+               return sortAssistants((CommonDropAdapterAssistant[]) assistants
+                               .toArray(new CommonDropAdapterAssistant[assistants.size()]));
+       }
+       
+       private CommonDropAdapterAssistant getAssistant(
+                       CommonDropAdapterDescriptor descriptor) {
+               TreeNodeDropAdapterAssistant asst = (TreeNodeDropAdapterAssistant) dropAssistants
+                               .get(descriptor);
+               if (asst != null) {
+                       return asst;
+               }
+               synchronized (dropAssistants) {
+                       asst = (TreeNodeDropAdapterAssistant) dropAssistants.get(descriptor);
+                       if (asst == null) {
+                               dropAssistants.put(descriptor, (asst = (TreeNodeDropAdapterAssistant) descriptor
+                                               .createDropAssistant()));
+                               asst.init(contentService);
+                               //asst.setCommonDropAdapter(dropAdapter);
+                       }
+               }
+               return asst;
+       }
+
+
+       private CommonDropAdapterAssistant[] sortAssistants(CommonDropAdapterAssistant[] array) {
+               Arrays.sort(array, new Comparator() {
+                       public int compare(Object arg0, Object arg1) {
+                               CommonDropAdapterAssistant a = (CommonDropAdapterAssistant) arg0;
+                               CommonDropAdapterAssistant b = (CommonDropAdapterAssistant) arg1;
+                               // This is to ensure that the navigator resources drop assistant will
+                               // always be first on the list of drop assistant, if a conflict ever 
+                               // occurs.
+                               String id = "org.eclipse.ui.navigator.resources."; //$NON-NLS-1$
+                               if (a.getClass().getName().startsWith(id))
+                                       return -1;
+                               if (b.getClass().getName().startsWith(id))
+                                       return 1;
+                               return a.getClass().getName().compareTo(b.getClass().getName());
+                       }
+               });
+               return array;
+       }
+
+       @Override
+       public CommonDropAdapterAssistant[] findCommonDropAdapterAssistants(
+                       Object aDropTarget, IStructuredSelection theDragSelection) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public void setDropAdaptor(TreeNodeDropAdapter da) {
+               dropAdapter = da;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorViewer.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorViewer.java
new file mode 100644 (file)
index 0000000..8fdabb8
--- /dev/null
@@ -0,0 +1,54 @@
+package eu.etaxonomy.taxeditor.navigation.navigator;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.internal.navigator.NavigatorContentService;
+import org.eclipse.ui.internal.navigator.dnd.NavigatorDnDService;
+import org.eclipse.ui.navigator.CommonDragAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.INavigatorContentService;
+
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+
+public class TaxonNavigatorViewer extends CommonViewer {
+
+       private NavigatorContentService contentService;
+       String viewerId;
+
+       public TaxonNavigatorViewer(String aViewerId, Composite aParent, int aStyle) {
+               super(aViewerId, aParent, aStyle);
+               contentService = new TaxonNavigatorContentService(aViewerId, this);
+               viewerId = aViewerId;
+       }
+
+       @Override
+       protected void initDragAndDrop() {
+
+               int operations =  DND.DROP_MOVE ;
+
+               CommonDragAdapter dragAdapter = createDragAdapter();
+               addDragSupport(operations, dragAdapter.getSupportedDragTransfers(),
+                               dragAdapter);
+               Transfer[] transfers = new Transfer[] { TaxonNodeTransfer.getInstance() };
+               TreeNodeDropAdapter dropAdapter = createTreeNodeDropAdapter();
+               addDropSupport(operations, transfers, dropAdapter);
+
+               TaxonNavigatorDnDService dnd = (TaxonNavigatorDnDService)getNavigatorContentService().getDnDService();
+               dnd.setDropAdaptor(dropAdapter);
+       }
+       
+       
+       protected TreeNodeDropAdapter createTreeNodeDropAdapter() {
+               return new TreeNodeDropAdapter(this);
+       }
+       
+       public NavigatorContentService getNavigatorContentService(){
+               if (contentService == null){
+                       contentService = new TaxonNavigatorContentService(viewerId);
+               } 
+               return contentService;
+       }
+       
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDragListener.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDragListener.java
new file mode 100644 (file)
index 0000000..9cd02f9
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+/**
+* 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.navigation.navigator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.dnd.DragSourceAdapter;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.ui.navigator.CommonViewer;
+
+
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+import eu.etaxonomy.taxeditor.editor.definedterm.TermTransfer;
+
+/**
+ * @author k.luther
+ * @date 02.06.2015
+ *
+ */
+public class TreeNodeDragListener extends DragSourceAdapter {
+       private CommonViewer viewer;
+
+       /**
+        * 
+        */
+       public TreeNodeDragListener(CommonViewer viewer) {
+               this.viewer = viewer;
+       }
+
+       
+       public void setViewer(CommonViewer viewer){
+               this.viewer = viewer;
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
+        */
+       @Override
+       public void dragStart(DragSourceEvent event) {
+               
+               event.doit = true;// set to false if needed - default is true
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DragSourceAdapter#dragFinished(org.eclipse.swt.dnd.DragSourceEvent)
+        */
+       @Override
+       public void dragFinished(DragSourceEvent event) {
+               // TODO Auto-generated method stub
+               super.dragFinished(event);
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
+        */
+       @Override
+       public void dragSetData(DragSourceEvent event) {
+               
+               IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+               List<ITaxonTreeNode> taxonNodes = new ArrayList<ITaxonTreeNode>();
+               
+               for (Object object : selection.toList()){
+                       taxonNodes.add((ITaxonTreeNode)object);
+                       }
+                       
+               if (TaxonNodeTransfer.getInstance().isSupportedType(
+                               event.dataType)) {
+                       event.data = taxonNodes.toArray(new TaxonNode[taxonNodes.size()]);
+               }
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java
new file mode 100644 (file)
index 0000000..448da05
--- /dev/null
@@ -0,0 +1,284 @@
+// $Id$
+/**
+* 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.navigation.navigator;
+
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IconAndMessageDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerDropAdapter;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import org.eclipse.ui.navigator.CommonViewer;
+
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.OrderedTermBase;
+import eu.etaxonomy.cdm.model.common.TermBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
+import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * <p>TreeNodeDropAdapter class.</p>
+ *
+ * @author k.luther
+ * @date 02.06.2015
+ * @version 1.0
+ */
+public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOperationEnabled {
+
+       /**
+        * @param viewer
+        */
+       protected TreeNodeDropAdapter(TaxonNavigatorViewer navigatorViewer) {
+               super(navigatorViewer);
+               this.navigatorViewer = navigatorViewer;
+               
+       }
+       
+       private final TaxonNavigatorViewer navigatorViewer;
+       private static final Logger logger = Logger.getLogger(TreeNodeDropAdapter.class);
+
+       /** Constant <code>ID="eu.etaxonomy.taxeditor.navigation.navig"{trunked}</code> */
+       public static final String ID = "eu.etaxonomy.taxeditor.navigation.navigator.dropassistant"; //$NON-NLS-1$
+
+       private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
+       
+       
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.navigator.CommonDropAdapterAssistant#handleDrop(org.eclipse.ui.navigator.CommonDropAdapter, org.eclipse.swt.dnd.DropTargetEvent, java.lang.Object)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public boolean performDrop(Object target) {
+
+               
+               if (target instanceof ITaxonTreeNode) {
+                       Set<TaxonNode> taxonNodes = getSelectedTaxa();
+                       ITaxonTreeNode targetTreeNode = (ITaxonTreeNode) target;
+                       if (targetTreeNode instanceof Classification){
+                               targetTreeNode = ((Classification)targetTreeNode).getRootNode();
+                               targetTreeNode = HibernateProxyHelper.deproxy(targetTreeNode, TaxonNode.class);
+                       }
+                       if(taxonNodes != null) {
+                               if (taxonNodes.size() == 1){
+                                       return moveTaxon(taxonNodes.iterator().next(), targetTreeNode);
+                               } else{
+                                       if( MessageDialog.openConfirm(null, "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
+                                               return true;
+                                       }
+                               }
+            }
+               }
+               
+               return false;
+       }
+
+       private Set<TaxonNode> getSelectedTaxa(){
+               HashSet<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
+
+               ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
+               if (selection instanceof TreeSelection) {
+
+                       Iterator selectionIterator = ((TreeSelection) selection).iterator();
+
+                       while (selectionIterator.hasNext()){
+                               Object object = selectionIterator.next();
+                               if(object instanceof TaxonNode){
+                                       TaxonNode taxonNode = (TaxonNode) object;
+                                       taxonNodes.add(taxonNode);
+                               }
+                       }
+               }
+               return taxonNodes.size() > 0 ? taxonNodes : null;
+       }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.navigator.CommonDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
+        */
+       /** {@inheritDoc} */
+       @Override
+       public boolean validateDrop(Object target, int operation,
+                       TransferData transferType) {
+               
+               if (target instanceof ITaxonTreeNode) {
+                       
+                   // check users permissions with target taxonnode and taxon
+                   if (target instanceof TaxonNode) {
+                       TaxonNode targetNode = (TaxonNode)target;
+                       Boolean hasTargetNodePermission = CdmStore.currentAuthentiationHasPermission(targetNode, UPDATE);
+                Boolean hasTargetTaxonPermission = CdmStore.currentAuthentiationHasPermission(targetNode.getTaxon(), UPDATE);
+
+                if(logger.isDebugEnabled()){
+                    logger.debug("target: " + targetNode.getTaxon().getTitleCache());
+                }
+
+                       if(!hasTargetNodePermission || ! hasTargetNodePermission){
+                           if(logger.isDebugEnabled()){
+                               logger.debug("CANCEL_STATUS for target node: " + hasTargetNodePermission.toString() + " " + hasTargetTaxonPermission.toString() + " ");
+                           }
+                           return false;
+                       }
+                   }
+
+                   // do not allow to drop onto itself and
+                   // check users permissions with all selected taxon nodes and taxa
+                   for(TaxonNode taxonNode : getSelectedTaxa()){
+                           logger.debug("selectedTaxa: " + taxonNode.getTaxon().getTitleCache());
+                               Boolean isSameTaxonNode = taxonNode.equals(target);
+                               Boolean hasTaxonNodePermission = CdmStore.currentAuthentiationHasPermission(taxonNode, UPDATE);
+                               Boolean hasTaxonPermission = CdmStore.currentAuthentiationHasPermission(taxonNode.getTaxon(), UPDATE);
+                if (
+                               isSameTaxonNode
+                               || !hasTaxonNodePermission
+                   || !hasTaxonPermission
+                       ) {
+                    if(logger.isDebugEnabled()){
+                        logger.debug("CANCEL_STATUS for selected  " + isSameTaxonNode.toString() + " " + hasTaxonNodePermission.toString() + " " + hasTaxonPermission.toString() + " ");
+                    }
+                                       return false;
+                               }
+                       }
+                       logger.debug("OK_STATUS");
+                       return true;
+               }
+               logger.debug("CANCEL_STATUS");
+               return false;
+       }
+
+
+       /**
+        * @param childTaxonNode
+        * @param parentTaxon
+        * @return
+        */
+       private boolean moveTaxon(TaxonNode taxonNode, ITaxonTreeNode targetITaxonTreeNode) {
+
+               TaxonNavigator taxonNavigator;
+               taxonNavigator = (TaxonNavigator) NavigationUtil.showView(TaxonNavigator.ID);
+
+               if(targetITaxonTreeNode instanceof TaxonNode){
+
+                       TaxonNode targetTaxonNode = (TaxonNode) targetITaxonTreeNode;
+               // Make sure parent taxon does not have unsaved changes
+                       if (NavigationUtil.isDirty(targetTaxonNode)){
+                               MessageDialog.openWarning(NavigationUtil.getShell(), "Unsaved Parent Taxon", "There are unsaved " +
+                               "changes in the parent taxon. Pleas save first.");
+                               return false;
+                       }
+
+               }
+               if (!PreferencesUtil.getSortNodesNaturally()){
+                       IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+                       if (workspaceUndoContext == null) {
+                               logger.error("Workspace undo context is null. DND operation cancelled");
+                               return false;
+                       }
+       
+                       AbstractPostOperation operation = new MoveTaxonOperation
+                                       ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                       NavigationUtil.executeOperation(operation);
+                       
+                       logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+                       return true;
+               }else{
+                       String[] buttonLables = {"Parent", "Predecessor", "Cancel"};
+                       MessageDialog dialog = new MessageDialog(null, "Target node", null, "Do you want to use the target node as parent or do you want to move the taxon below the target.", MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
+                       dialog.open();
+                       int returnCode = dialog.getReturnCode();
+                       if (returnCode == 0){
+                               IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+                               if (workspaceUndoContext == null) {
+                                       logger.error("Workspace undo context is null. DND operation cancelled");
+                                       return false;
+                               }
+               
+                               AbstractPostOperation operation = new MoveTaxonOperation
+                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                               NavigationUtil.executeOperation(operation);
+                               
+                               logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+                               return true;
+                       }else if (returnCode == 1){
+                               IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
+                               if (workspaceUndoContext == null) {
+                                       logger.error("Workspace undo context is null. DND operation cancelled");
+                                       return false;
+                               }
+               
+                               AbstractPostOperation operation = new MoveTaxonOperation
+                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, false);
+                               NavigationUtil.executeOperation(operation);
+                               
+                               logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
+                               return true;
+                       } else{
+                               return false;
+                       }
+                       
+                       
+               }
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
+        */
+       /** {@inheritDoc} */
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
+               return true;
+       }
+
+       /**
+        * <p>onComplete</p>
+        *
+        * @return a boolean.
+        */
+       @Override
+    public boolean onComplete() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+       @Override
+       public void dragOver(DropTargetEvent event) {
+               super.dragOver(event);
+               event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_INSERT_AFTER;
+               
+       }
+       
+}
index 55df02ba26580f05fa4cc09d74df9336257d6b6e..5a8650098b30cf91fe380d90fb7f994e7be7fc87 100644 (file)
@@ -87,6 +87,7 @@ public class DeleteHandler extends AbstractHandler{
                                ITaxonTreeNode treeNode = treeNodes.iterator().next();
                                ITaxonTreeNode taxonNode =treeNode;
                                TaxonNodeDeletionConfigurator configNodes = new TaxonNodeDeletionConfigurator();
+                               //configNodes.setDeleteTaxon(false);
                                if (taxonNode instanceof Classification && taxonNode.hasChildNodes()){
                                        if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the classification? The tree has children, they will be deleted, too.")){
                                                return null;
@@ -122,9 +123,10 @@ public class DeleteHandler extends AbstractHandler{
 
                                                }
                                        }else{
-                                               if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
+                                               if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(configNodes, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
                                                        return null;
-                                               }
+                                               } 
+                                               config.setTaxonNodeConfig(configNodes);
                                        }
                                }
 
index 9d02cb1d2161281aeb6db9994cc46588b4536df7..3c21795a881653ad9f600e5db57caf48d5f776c0 100644 (file)
@@ -15,4 +15,5 @@ LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restar
 LanguageEditorPreferencePage_PleaseRestart=Please Restart\r
 LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect.\r
 OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.\r
-OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.
\ No newline at end of file
+OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.\r
+UriWithLabelElement_URL_NOT_SAVED=URL won't be saved\! \r
index 3c18fec10e3b677c3d05f72f09091afde89a3769..d03d93e3212ec61a52ba2a967485ccbf75d2d28f 100644 (file)
@@ -14,4 +14,5 @@ LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte w
 LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?\r
 LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten\r
 LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.\r
-OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.
\ No newline at end of file
+OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.\r
+UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\! 
\ No newline at end of file
index 3b026cdf1defab4f62980e29d838b4e9da7d8d98..41a4ad279bcfe7f014dca98ed5648424dd114637 100644 (file)
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
                </parameter>
-               <visibleWhen
-                     checkEnabled="true">
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </visibleWhen>
             </command>
             <separator
                   name="eu.etaxonomy.taxeditor.store.showViewMenu.details"
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.detail">
                </parameter>
-               <visibleWhen
-                     checkEnabled="true">
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </visibleWhen>
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.supplementalData">
                </parameter>
-               <visibleWhen
-                     checkEnabled="true">
-                  <reference
-                        definitionId="isCdmStoreConnected">
-                  </reference>
-               </visibleWhen>
             </command>
             <!-- Originally used by validation framework, currently not in use -->
        <!--        <command
                </parameter>
                <visibleWhen
                      checkEnabled="true">
-                  <and>
-                     <reference
-                           definitionId="isShowExperimentalFeatures">
-                     </reference>
-                     <reference
-                           definitionId="isCdmStoreConnected">
-                     </reference>
-                  </and>
+                  <reference
+                        definitionId="isShowExperimentalFeatures">
+                  </reference>
                </visibleWhen>
             </command>
          </menu>
       </menuContribution>
+      <menuContribution
+            class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenuFactory"
+            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
+      </menuContribution>
       <menuContribution
             locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
          <command
                commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
                label="%command.label.5"
                style="push">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.taxeditor.application.filemenu.login"
             </visibleWhen>
          </command>
       </menuContribution>
-      <menuContribution
-            allPopups="false"
-            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
-         <dynamic
-               class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenu"
-               id="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenu">
-            <visibleWhen
-                  checkEnabled="true">
-               <reference
-                     definitionId="isCdmStoreConnected">
-               </reference>
-            </visibleWhen>
-         </dynamic>
-      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
index b233e53f9d3ec4f27bf630e383492765ef7fbdbe..42791ec3b89d6c6967cb86041814a7d482ff7619 100644 (file)
@@ -21,8 +21,7 @@
       </annotation>
       <complexType>
          <sequence>
-            <element ref="cdmViewer" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="viewCommandMapping" minOccurs="0" maxOccurs="unbounded"/>
+            <element ref="cdmViewer" minOccurs="1" maxOccurs="unbounded"/>
          </sequence>
          <attribute name="point" type="string" use="required">
             <annotation>
       </complexType>
    </element>
 
-   <element name="viewCommandMapping">
-      <annotation>
-         <documentation>
-            Maps a viewing class, like editors or views, to a command which opens it.
-         </documentation>
-      </annotation>
-      <complexType>
-         <attribute name="commandId" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The command which opens the viewer to show the selected object
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="identifier" basedOn="org.eclipse.ui.commands/command/@id"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-         <attribute name="viewerName" type="string">
-            <annotation>
-               <documentation>
-                  The name of the viewer which shows the selected element
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="selection" type="string" use="required">
-            <annotation>
-               <documentation>
-                  The class of the selected element
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
    <annotation>
       <appInfo>
          <meta.section type="since"/>
index 9757c60b19eec36087b3f7ba0bc39a0eac1e5683..b583632dc67d605b13f78c2873294140b1f4b386 100644 (file)
@@ -36,6 +36,7 @@ public class Messages extends NLS {
     public static String CdmDataSourceViewPart_7;
     public static String CdmDataSourceViewPart_8;
     public static String CdmDataSourceViewPart_9;
+    public static String UriWithLabelElement_URL_NOT_SAVED;
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
deleted file mode 100644 (file)
index 4f3e777..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-// $Id$
-/**
-* 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.editor.definedterm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-
-import eu.etaxonomy.cdm.model.common.TermType;
-
-/**
- * Menu used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
- * for term types which when clicked open the defined term editor for the chosen term type
- *
- * @author pplitzner
- * @date 21 Jul 2015
- *
- */
-
-public class DefinedTermMenu extends CompoundContributionItem {
-
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        Collection<IContributionItem> items = new ArrayList<IContributionItem>();
-           MenuManager dtMenuManager =
-                   new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
-
-           dtMenuManager.setVisible(true);
-
-           items.add(dtMenuManager);
-           List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
-           Collections.sort(ttList,new SortByTermTypeMessage());
-           for (TermType tt : ttList)
-           {
-               // if term type has a parent, do not add it
-               // it will be added in the recursive call
-               if(tt.getKindOf() == null) {
-                   IContributionItem ici = addChildTermsToMenuManager(tt);
-                   if(ici != null) {
-                       dtMenuManager.add(ici);
-                   }
-               }
-           }
-           return items.toArray(new IContributionItem[]{});
-       }
-
-       private IContributionItem addChildTermsToMenuManager(TermType termType) {
-
-               //FIXME : need a better way to find out if a term type can be editable (ticket 3853)
-               if(termType.getEmptyDefinedTermBase() != null) {
-                       Set<TermType> children = termType.getGeneralizationOf();
-                       // term type has no children, so create menu item
-                       if(children.isEmpty()) {
-                               return createMenuItem(termType);
-                       }
-                       // term type has children, so create sub menu
-                       MenuManager dtMenuManager =
-                                       new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu");
-                       dtMenuManager.setVisible(true);
-                       dtMenuManager.add(createDefaultMenuItem(termType));
-
-                       Separator sep = new Separator();
-                       dtMenuManager.add(sep);
-                       // add child items to the sub menu
-                       for(TermType tt : children) {
-                               IContributionItem item = addChildTermsToMenuManager(tt);
-                               if(item != null) {
-                                       dtMenuManager.add(item);
-                               }
-                       }
-                       return dtMenuManager;
-               } else {
-                       return null;
-               }
-
-       }
-
-       private CommandContributionItem createMenuItem(TermType termType) {
-
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-
-        CommandContributionItemParameter p = new CommandContributionItemParameter(
-                PlatformUI.getWorkbench(),
-                "",
-                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
-                params,
-                null,
-                null,
-                null,
-                termType.getMessage(),
-                "",
-                "",
-                SWT.PUSH,
-                "",
-                true);
-
-        CommandContributionItem item = new CommandContributionItem(p);
-        return item;
-
-       }
-
-       private CommandContributionItem createDefaultMenuItem(TermType termType) {
-
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-
-        CommandContributionItemParameter p = new CommandContributionItemParameter(
-                PlatformUI.getWorkbench(),
-                "",
-                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
-                params,
-                null,
-                null,
-                null,
-                "Other " + termType.getMessage() + "s",
-                "",
-                "",
-                SWT.PUSH,
-                "",
-                true);
-
-
-
-        CommandContributionItem item = new CommandContributionItem(p);
-        return item;
-
-       }
-
-       private class SortByTermTypeMessage implements Comparator<TermType> {
-           @Override
-        public int compare(TermType t1, TermType t2) {
-               return t1.getMessage().compareTo(t2.getMessage());
-           }
-       }
-
-
-}
index f266729565dcd7e2221fcfcef4b6f27eb76435bc..9bd7ccbda2d8ed188e837b2cd847829e0abab79a 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 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.
 */
@@ -34,77 +34,78 @@ import eu.etaxonomy.cdm.model.common.TermType;
 /**
  * Menu factory used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
  * for term types which when clicked open the defined term editor for the chosen term type
- *
+ * 
  * @author c.mathew
  * @date 18 Jul 2013
  *
  */
 
-public class DefinedTermMenuFactory extends ExtensionContributionFactory {
-
+public class DefinedTermMenuFactory extends ExtensionContributionFactory {     
+       
        @Override
        public void createContributionItems(IServiceLocator serviceLocator,
-               IContributionRoot additions) {
-           MenuManager dtMenuManager =
-                   new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu");
-
-           dtMenuManager.setVisible(true);
-
-           additions.addContributionItem(dtMenuManager, null);
-           List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
-           Collections.sort(ttList,new SortByTermTypeMessage());
-           for (TermType tt : ttList)
-           {
-               // if term type has a parent, do not add it
-               // it will be added in the recursive call
-               if(tt.getKindOf() == null) {
-                   IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);
-                   if(ici != null) {
-                       dtMenuManager.add(ici);
-                   }
-               }
-           }
+                       IContributionRoot additions) {
+               
+               MenuManager dtMenuManager = 
+                               new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu"); 
+               
+               dtMenuManager.setVisible(true);
+        
+               additions.addContributionItem(dtMenuManager, null);
+               List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
+               Collections.sort(ttList,new SortByTermTypeMessage());
+        for (TermType tt : ttList)
+        {
+               // if term type has a parent, do not add it
+               // it will be added in the recursive call
+               if(tt.getKindOf() == null) {
+                       IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);                 
+                       if(ici != null) {                                                       
+                               dtMenuManager.add(ici);
+                       }
+               }
+        }                                     
        }
-
+       
        private IContributionItem addChildTermsToMenuManager(TermType termType, IServiceLocator serviceLocator) {
-
+       
                //FIXME : need a better way to find out if a term type can be editable (ticket 3853)
                if(termType.getEmptyDefinedTermBase() != null) {
                        Set<TermType> children = termType.getGeneralizationOf();
                        // term type has no children, so create menu item
-                       if(children.isEmpty()) {
+                       if(children.isEmpty()) {                        
                                return createMenuItem(termType, serviceLocator);
                        }
-                       // term type has children, so create sub menu
-                       MenuManager dtMenuManager =
-                                       new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu");
+                       // term type has children, so create sub menu           
+                       MenuManager dtMenuManager = 
+                                       new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu"); 
                        dtMenuManager.setVisible(true);
                        dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
 
                        Separator sep = new Separator();
                        dtMenuManager.add(sep);
                        // add child items to the sub menu
-                       for(TermType tt : children) {
+                       for(TermType tt : children) {                   
                                IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
-                               if(item != null) {
+                               if(item != null) {                              
                                        dtMenuManager.add(item);
-                               }
-                       }
+                               }                                       
+                       }               
                        return dtMenuManager;
                } else {
                        return null;
                }
-
+               
        }
-
+       
        private CommandContributionItem createMenuItem(TermType termType, IServiceLocator serviceLocator) {
-
+               
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-
+                               termType.getUuid().toString());         
+               
         CommandContributionItemParameter p = new CommandContributionItemParameter(
-                serviceLocator,
+                serviceLocator, 
                 "",
                 "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
                 params,
@@ -113,24 +114,24 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                 null,
                 termType.getMessage(),
                 "",
-                "",
+                "",                
                 SWT.PUSH,
                 "",
                 true);
-
-        CommandContributionItem item = new CommandContributionItem(p);
+   
+        CommandContributionItem item = new CommandContributionItem(p);   
         return item;
-
+               
        }
-
+       
        private CommandContributionItem createDefaultMenuItem(TermType termType, IServiceLocator serviceLocator) {
-
+               
                Map<String, String> params = new HashMap<String, String>();
                params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
-
+                               termType.getUuid().toString());         
+               
         CommandContributionItemParameter p = new CommandContributionItemParameter(
-                serviceLocator,
+                serviceLocator, 
                 "",
                 "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
                 params,
@@ -139,24 +140,23 @@ public class DefinedTermMenuFactory extends ExtensionContributionFactory {
                 null,
                 "Other " + termType.getMessage() + "s",
                 "",
-                "",
+                "",                
                 SWT.PUSH,
                 "",
                 true);
-
-
-
-        CommandContributionItem item = new CommandContributionItem(p);
+        
+        
+   
+        CommandContributionItem item = new CommandContributionItem(p);   
         return item;
-
+               
        }
-
+       
        private class SortByTermTypeMessage implements Comparator<TermType> {
-           @Override
-        public int compare(TermType t1, TermType t2) {
+           public int compare(TermType t1, TermType t2) {
                return t1.getMessage().compareTo(t2.getMessage());
            }
        }
-
+       
 
 }
index 54c8d498fcf6fc7592ed088d6e8f3cdd9e6b071f..b316c2a0692e06056eb5f368d5a5206dbb07c898 100644 (file)
@@ -193,6 +193,8 @@ public class MessagingUtils {
         contextInfo.add("editor version : " + version);
         contextInfo.add("server : " + server + " / " + name);
         contextInfo.add("schema version : " + schemaVersion);
+        contextInfo.add("os : " + System.getProperty("os.name")+" "+System.getProperty("os.version")+" "+System.getProperty("os.arch"));
+        contextInfo.add("java : "+System.getProperty("java.version"));
 
         return contextInfo;
     }
index 0eb45b3dd42c8ea7d90f6e83f83c7f773928d010..4025e4197ad193603deba7e8dc1218506301b9f6 100644 (file)
@@ -13,6 +13,7 @@ package eu.etaxonomy.taxeditor.store;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.UUID;
 
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
@@ -22,6 +23,7 @@ import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
+import eu.etaxonomy.cdm.api.service.IService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
@@ -29,6 +31,7 @@ import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurato
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.RelationshipBase;
 import eu.etaxonomy.cdm.model.common.User;
@@ -59,15 +62,14 @@ public class SearchManager {
        // TODO make this configurable via preferences
        private static final int MAX_RESULTS_BEFORE_WARNING = 500;
 
-       /**
-        * <p>findNames</p>
-        *
-        * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
-        * @return a {@link java.util.List} object.
-        */
        public List<TaxonNameBase> findNames(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(INameService.class).countByTitle(configurator))){
-                       return CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
+                       List<TaxonNameBase> records = CdmStore.getService(INameService.class).findByTitle(configurator).getRecords();
+                       TaxonNameBase uuidSearchResult = addUuidSearchResults(configurator, INameService.class);
+            if(uuidSearchResult!=null){
+                records.add(uuidSearchResult);
+            }
+            return records;
                }
                return NO_RESULTS;
        }
@@ -75,6 +77,7 @@ public class SearchManager {
        public List<NameRelationship> findNameRelationships(
                        IIdentifiableEntityServiceConfigurator configurator) {
                if(true){
+                   //if activated again remember to add uuid search results like in other searches
                        return NO_RESULTS;
                }
 
@@ -86,62 +89,57 @@ public class SearchManager {
                                relationships.add((NameRelationship) relationship);
                        }
                }
-
-
                return relationships;
-
        }
 
-       /**
-        * <p>findTaxaAndNames</p>
-        *
-        * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator} object.
-        * @return a {@link java.util.List} object.
-        */
        public List<UuidAndTitleCache<IdentifiableEntity>> findTaxaAndNames(IFindTaxaAndNamesConfigurator<TaxonBase> configurator){
                return CdmStore.getService(ITaxonService.class).findTaxaAndNamesForEditor(configurator);
        }
 
-
-
-
-       /**
-        * <p>findReferences</p>
-        *
-        * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
-        * @return a {@link java.util.List} object.
-        */
        public List<Reference> findReferences(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(IReferenceService.class).countByTitle(configurator))){
-                       return  CdmStore.getService(IReferenceService.class).findByTitle(configurator).getRecords();
+                       List<Reference> records = CdmStore.getService(IReferenceService.class).findByTitle(configurator).getRecords();
+                       Reference uuidSearchResult = addUuidSearchResults(configurator, IReferenceService.class);
+            if(uuidSearchResult!=null){
+                records.add(uuidSearchResult);
+            }
+            return records;
                }
                return NO_RESULTS;
        }
 
-
-       /**
-        * <p>findAgents</p>
-        *
-        * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
-        * @return a {@link java.util.List} object.
-        */
        public List<AgentBase> findAgents(IIdentifiableEntityServiceConfigurator configurator){
                if(checkLargeResult(CdmStore.getService(IAgentService.class).countByTitle(configurator))){
-                       return CdmStore.getService(IAgentService.class).findByTitle(configurator).getRecords();
+                       List<AgentBase> records = CdmStore.getService(IAgentService.class).findByTitle(configurator).getRecords();
+                       AgentBase uuidSearchResult = addUuidSearchResults(configurator, IAgentService.class);
+                       if(uuidSearchResult!=null){
+                           records.add(uuidSearchResult);
+                       }
+            return records;
                }
                return NO_RESULTS;
        }
 
-       /**
-        * <p>findTeamOrPersons</p>
-        *
-        * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
-        * @return a {@link java.util.List} object.
-        */
+    /**
+     * Check search string if it is a {@link UUID} and, if <code>true</code>, search for the corresponding entity.
+     * @param configurator the configurator holding the search string
+     * @param service the service to use for searching
+     */
+    private <T extends ICdmBase> T addUuidSearchResults(IIdentifiableEntityServiceConfigurator configurator, Class<? extends IService<T>> service) {
+        String titleSearchString = configurator.getTitleSearchString();
+               try {
+                   UUID uuid = UUID.fromString(titleSearchString);
+                   return CdmStore.getService(service).find(uuid);
+               } catch (IllegalArgumentException e) {
+                   //search string was no UUID
+               }
+               return null;
+    }
+
        @SuppressWarnings("unchecked")
        public List<TeamOrPersonBase> findTeamOrPersons(IIdentifiableEntityServiceConfigurator configurator){
-               configurator.setClazz(TeamOrPersonBase.class);
-               return (List)findAgents(configurator);
+           configurator.setClazz(TeamOrPersonBase.class);
+           return (List)findAgents(configurator);
        }
 
        /**
@@ -169,6 +167,7 @@ public class SearchManager {
         * @return
         */
        public List<SpecimenOrObservationBase> findOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator, boolean showFieldUnits){
+           List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
                if(configurator.getClazz()==null){
                    if(showFieldUnits){
                        configurator.setClazz(SpecimenOrObservationBase.class);
@@ -179,7 +178,6 @@ public class SearchManager {
                }
                if(configurator.getClazz().equals(SpecimenOrObservationBase.class)){
                    //get FieldUnits + DerivedUnits
-                   List<SpecimenOrObservationBase> records = new ArrayList<SpecimenOrObservationBase>();
                    configurator.setClazz(DerivedUnit.class);
                    int derivedUnitCount = CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator);
                    configurator.setClazz(FieldUnit.class);
@@ -191,33 +189,42 @@ public class SearchManager {
                        configurator.setClazz(FieldUnit.class);
                        records.addAll(CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords());
                    }
-                   return records;
 
                }
-               if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
-                       return CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords();
+               else if(checkLargeResult(CdmStore.getService(IOccurrenceService.class).countOccurrences(configurator))){
+                       records = CdmStore.getService(IOccurrenceService.class).findByTitle(configurator).getRecords();
                }
-               return NO_RESULTS;
+               SpecimenOrObservationBase uuidSearchResult = addUuidSearchResults(configurator, IOccurrenceService.class);
+        if(uuidSearchResult!=null){
+            records.add(uuidSearchResult);
+        }
+               return records;
        }
 
        public List<User> findUsers(IIdentifiableEntityServiceConfigurator configurator){
                String userNameSearchString = sqlizeTitleSearchString(configurator);
                // TODO why are users not identifiable entities?
-               return CdmStore.getService(IUserService.class).listByUsername(userNameSearchString, null, null, null, null, null, null);
+               List<User> records = CdmStore.getService(IUserService.class).listByUsername(userNameSearchString, null, null, null, null, null, null);
+               User uuidSearchResult = addUuidSearchResults(configurator, IUserService.class);
+               if(uuidSearchResult!=null){
+                   records.add(uuidSearchResult);
+               }
+        return records;
        }
 
 
        public List<Group> findGroups(IIdentifiableEntityServiceConfigurator configurator){
                String groupNameSearchString = sqlizeTitleSearchString(configurator);
                // TODO why are groups not identifiable entities?
-               return CdmStore.getService(IGroupService.class).listByName(groupNameSearchString, null, null, null, null, null, null);
+               List<Group> records = CdmStore.getService(IGroupService.class).listByName(groupNameSearchString, null, null, null, null, null, null);
+               Group uuidSearchResult = addUuidSearchResults(configurator, IGroupService.class);
+               if(uuidSearchResult!=null){
+                   records.add(uuidSearchResult);
+               }
+        return records;
        }
 
 
-       /**
-        * @param count
-        * @return
-        */
        private boolean checkLargeResult(int count) {
                if(count > MAX_RESULTS_BEFORE_WARNING){
                        return MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Large result expected",
@@ -228,18 +235,18 @@ public class SearchManager {
                }
        }
 
-       /**
-        *
-        * @param configurator
-        * @return
-        */
        private String sqlizeTitleSearchString(IIdentifiableEntityServiceConfigurator configurator){
                return configurator.getTitleSearchString().replace(WILDCARD, "%");
        }
 
        public List findTaxa(IIdentifiableEntityServiceConfigurator configurator) {
                if(checkLargeResult(CdmStore.getService(ITaxonService.class).countByTitle(configurator))){
-                       return CdmStore.getService(ITaxonService.class).findByTitle(configurator).getRecords();
+                       List<TaxonBase> records = CdmStore.getService(ITaxonService.class).findByTitle(configurator).getRecords();
+                       TaxonBase uuidSearchResult = addUuidSearchResults(configurator, ITaxonService.class);
+                       if(uuidSearchResult!=null){
+                           records.add(uuidSearchResult);
+                       }
+            return records;
                }
                return NO_RESULTS;
        }
index eb36edac26f314ac4853c445ef28331754b62449..647addd10ccaea42b89725ac4b201456b51c25e5 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Shell;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
 import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
 
 /**
  * Abstract subclass of MessageDialog providing the functionality to configure
@@ -49,7 +50,10 @@ public class DeleteConfiguratorDialog extends MessageDialog{
         }
         else if(configurator instanceof SpecimenDeleteConfigurator){
             composite.addConfiguratorComposite(new DeleteSpecimenConfiguratorComposite((SpecimenDeleteConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
+        } else if(configurator instanceof TaxonNodeDeletionConfigurator){
+            composite.addConfiguratorComposite(new DeleteNodeConfiguratorComposite((TaxonNodeDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE));
         }
+        
         return composite;
     }
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNodeConfiguratorComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/deleteConfigurator/DeleteNodeConfiguratorComposite.java
new file mode 100644 (file)
index 0000000..4901526
--- /dev/null
@@ -0,0 +1,76 @@
+package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
+/**
+* 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.
+*/
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.PojoProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.RowLayout;
+
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
+/**
+ * @author kluther
+ * @date Jul 13, 2015
+ *
+ */
+public class DeleteNodeConfiguratorComposite extends Composite {
+       // $Id$
+       
+       private final DataBindingContext m_bindingContext;
+
+       private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+       private final TaxonNodeDeletionConfigurator configurator;
+       private final Button btnDeleteTaxon;
+
+
+           /**
+            * Create the composite.
+            * @param parent
+            * @param style
+            */
+           public DeleteNodeConfiguratorComposite(TaxonNodeDeletionConfigurator configurator, Composite parent, int style) {
+               super(parent, style);
+               this.configurator = configurator;
+               addDisposeListener(new DisposeListener() {
+                   @Override
+                   public void widgetDisposed(DisposeEvent e) {
+                       toolkit.dispose();
+                   }
+               });
+               toolkit.paintBordersFor(this);
+               setLayout(new RowLayout(SWT.VERTICAL));
+               setBackground(getBackground());
+
+               btnDeleteTaxon = new Button(this, SWT.CHECK);
+               btnDeleteTaxon.setText("Delete taxon if possible");
+            
+               m_bindingContext = initDataBindings();
+
+           }
+
+           protected DataBindingContext initDataBindings() {
+               DataBindingContext bindingContext = new DataBindingContext();
+               //
+               IObservableValue observeSelectionBtnDeleteTaxonObserveWidget = WidgetProperties.selection().observe(btnDeleteTaxon);
+               IObservableValue deleteTaxonIfPossibleConfiguratorObserveValue = PojoProperties.value("deleteTaxon").observe(configurator);
+               bindingContext.bindValue(observeSelectionBtnDeleteTaxonObserveWidget, deleteTaxonIfPossibleConfiguratorObserveValue, null, null);
+               //
+               return bindingContext;
+           }
+       }
+
+
index 915e342f2ea4ad3a8edcff75d716b129c727c0d4..e7c1e2e7bcf37ee9deae59855b122b143ef26f6e 100644 (file)
@@ -15,6 +15,7 @@ import java.net.URI;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -26,6 +27,7 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
+import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
@@ -100,12 +102,14 @@ public class UriWithLabelElement extends TextWithLabelElement {
 
        public URI getUri(){
         try {
-            labelException.setBackground(getPersistentBackground());
-            labelException.setText("");
+            labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(getPersistentBackground());
+            labelException.setText(""); //$NON-NLS-1$
             return new URI(super.getText());
         } catch (Exception e) {
-            labelException.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-            labelException.setText(e.getMessage());
+            labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
+            labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+            labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED+e.getMessage());
             return null;
         }
        }
index f88a9d0bfbc3ea8f48e0089007a034de890463af..cf2a786c869a2fd781942d8c52231af1900b5fea 100644 (file)
@@ -129,6 +129,10 @@ public abstract class AbstractCdmDetailSection<ENTITY> extends AbstractFormSecti
                String title = "";
                if (getEntity() != null && (getEntity() instanceof IdentifiableEntity) && !(getEntity() instanceof SpecimenOrObservationBase)) {
                        title = ": " + ((IdentifiableEntity) getEntity()).getTitleCache();
+                       // we have to duplicate ampersands otherwise they are treated as
+                       // mnenomic (see Label.setText() documentation)
+                       // see also #4302
+                       title = title.replace("&", "&&");
                }
                this.setText(String.format("%s%s", getHeading(), title));
                setTextClient(createToolbar());
index c76a96279b295e40e4cf90c1fb2ba1a7cacac40c..d82f7fe444204affe3e9a0ea78794442cec94cfc 100644 (file)
@@ -51,8 +51,11 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private ITaxonTreeNode parentTreeNode;
 
        private EntitySelectionElement<Taxon> selection_reuseExistingTaxon;
+       private EntitySelectionElement<Reference> selection_SecRef;
 
        private Taxon taxon;
+       
+       private Reference secReference;
 
        private TextWithLabelElement textNewTaxonName;
 
@@ -92,6 +95,9 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                selection_parentTaxonNode = formFactory
                                .createTaxonNodeSelectionElement(getConversationHolder(), formElement, "Parent", null,
                                                EntitySelectionElement.DELETABLE, style);
+               selection_SecRef = formFactory
+                               .createSelectionElement(Reference.class,getConversationHolder(), formElement, "Secundum Reference", null,
+                                               EntitySelectionElement.DELETABLE, style);
                selection_reuseExistingTaxon = formFactory
                                .createSelectionElement(Taxon.class,
                                                getConversationHolder(), formElement,
@@ -150,12 +156,16 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                        setClassification(selection_classification.getEntity());
                } else if (eventSource == selection_parentTaxonNode) {
                        setParentTreeNode(selection_parentTaxonNode.getEntity());
+               } else if (eventSource == selection_SecRef) {
+                       setSecReference(selection_SecRef.getEntity());
                } else if (eventSource == selection_reuseExistingTaxon) {
                        boolean enabled = selection_reuseExistingTaxon.getEntity() == null;
                        selection_reuseExistingName.setEnabled(enabled);
                        textNewTaxonName.setEnabled(enabled);
 
                        setTaxon(selection_reuseExistingTaxon.getEntity());
+                       complete = !textNewTaxonName.getText().isEmpty();
+                       
                } else if (eventSource == selection_reuseExistingName) {
                        boolean enabled = selection_reuseExistingName.getEntity() == null;
                        selection_reuseExistingTaxon.setEnabled(enabled);
@@ -234,9 +244,16 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                        this.parentTreeNode = selection_classification.getEntity();
                }
        }
+       
+       private void setSecReference(Reference secRef){
+               this.secReference = secRef;
+               setTaxon(textNewTaxonName.getText());
+       }
 
        private void setTaxon(Taxon taxon) {
                this.taxon = taxon;
+               textNewTaxonName.setText(taxon.getName().getTitleCache());
+               
        }
 
        private void setTaxon(String taxonNameString) {
@@ -248,7 +265,9 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private void setTaxon(TaxonNameBase taxonName) {
                Reference secundum = null;
                if (getParentTreeNode() != null) {
-                       if (getParentTreeNode() instanceof Classification) {
+                       if (this.secReference != null){
+                               secundum = this.secReference;
+                       } else if (getParentTreeNode() instanceof Classification) {
                                secundum = ((Classification) getParentTreeNode())
                                                .getReference();
                        } else if (getParentTreeNode() instanceof TaxonNode) {
index 7da47bb4c2b0742ac5ffbe3a10ee30c48c7f726e..8e4dcea681aa717b96cf72ccf715eb49efc4d571 100644 (file)
@@ -113,7 +113,7 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                                getTaxonDescriptions(),
                 false, 
                 false, 
-                null,
+               
                 null,
                 presenceAbsenceTermColors, 
                 languages);
index b11a177a5c0b2dc1e137b3d51692c9012709bbf2..46c95c83d6c2a41313356e78855b29ded5eeaa1a 100644 (file)
@@ -64,13 +64,19 @@ public class PolytomousKeyNodeDetailElement extends
                element_statement = formFactory.createKeyStatementElement(formElement,
                                "State(ment)", entity.getStatement(), 50, style);
 
-               //if (entity.isLeaf()) {
+               if (entity.isLeaf()) {
                        selection_taxon = formFactory
                                        .createSelectionElement(Taxon.class,
                                                        getConversationHolder(), formElement, "Taxon",
                                                        entity.getTaxon(), EntitySelectionElement.NOTHING,
                                                        style);
-               //}
+               } else{
+                       selection_taxon = formFactory
+                                       .createSelectionElement(Taxon.class,
+                                                       getConversationHolder(), formElement, "Taxon",
+                                                       entity.getTaxon(), EntitySelectionElement.DELETABLE,
+                                                       style);
+               }
 
                selection_subkey = formFactory
                                .createSelectionElement(PolytomousKey.class,
index 9d016cb3175be5d881d8eb238c4c495ff5b1410d..fbde0b7e0ed056e51d0b6d809db9aa24e4a535ac 100644 (file)
@@ -119,13 +119,7 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
                        try {
                            URI uri = text_uri.getUri();
                                getEntity().setUri(uri);
-                               if(uri==null){
-                                   //buffer URI if parsing error occurred
-                                   MediaDetailElement parentMediaDetailElement = getParentMediaDetailElement();
-                                   if(parentMediaDetailElement!=null){
-                                       parentMediaDetailElement.setUriBuffer(text_uri.getText());
-                                   }
-                               }
+
 
                                loadImage(getEntity().getUri(), true);
 
index 1c27665647713fdd53c267767588114f683fb708..e05ed4064260e68d770df99dec3a5c11e950a8bd 100644 (file)
@@ -9,7 +9,6 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
-import java.net.URI;
 import java.util.List;
 import java.util.Set;
 
@@ -17,7 +16,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.media.MediaUtils;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -41,11 +39,6 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
     private ICdmFormElement parentFormElement;
     private int style;
 
-    /**
-     * Used to store the URI even if it is invalid and thus cannot be stored in CDM
-     */
-    private String uriBuffer;
-
     public MediaDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
@@ -70,25 +63,11 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
     public void handleEvent(Object eventSource){
         if(eventSource==textUri){
             textUri.setBackground(getPersistentBackground());
-            URI uri = textUri.getUri();
-            singleMediaRepresentationPart.setUri(uri);
-            if(uri==null){
-                uriBuffer=textUri.getText();
-            }
+            singleMediaRepresentationPart.setUri(textUri.getUri());
         }
     }
 
-    public void toggleAdvancedMediaView() {
-        if (getEntity().getRepresentations() != null
-                && (getEntity().getRepresentations().size() > 1 ||
-                        (getEntity().getRepresentations().size() == 1
-                        && getEntity().getRepresentations().iterator().next().getParts().size() > 1))) {
-            MessagingUtils.informationDialog("Toggling not possible",
-                    "Media has consists of multiple representations or representatio parts");
-            // toggling is only possible if there are no more than one
-            // MediaRepresentation resp. MediaRepresentationParts
-            return;
-        }
+    public void toggleAdvancedMediaView(){
         isAdvancedMediaView = !isAdvancedMediaView;
         showAdvancedView();
         reflowParentScrolledForm(true);
@@ -102,23 +81,13 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
             section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, style);
             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
-            if(uriBuffer!=null){
-                section_mediaRepresentation.getLayoutComposite().getChildren();
-            }
         }
         else{
             if(section_mediaRepresentation!=null){
                 removeElementsAndControls(section_mediaRepresentation);
             }
             textUri = formFactory.createUriWithLabelElement(parentFormElement, "Media URI", null, style);
-            URI uri = singleMediaRepresentationPart.getUri();
-            textUri.setUri(uri);
-            //set buffered uri as text if uri had parsing problems in advanced view
-            if(uri==null && uriBuffer!=null){
-                textUri.setText(uriBuffer);
-                textUri.getUri();
-            }
+            textUri.setUri(singleMediaRepresentationPart.getUri());
             textUri.getLayoutComposite().layout();
         }
     }
@@ -147,12 +116,4 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
         return isAdvancedMediaView;
     }
 
-    public void setUriBuffer(String uriBuffer) {
-        this.uriBuffer = uriBuffer;
-    }
-
-    public String getUriBuffer() {
-        return uriBuffer;
-    }
-
 }
index 663848da419d2bef3ba02e2b78c73f4c0911f147..5a295254788c851528ec31c0a1eb5e141f4d2b17 100644 (file)
@@ -58,14 +58,8 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
                        text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize()));
                }
                if(entity.getUri() != null){
-                       text_uri.setUri(entity.getUri());
-               } else {
-            String uriBuffer = getParentMediaDetailElement().getUriBuffer();
-            if(uriBuffer!=null){
-                text_uri.setText(uriBuffer);
-                text_uri.getUri();//just to update the error label
-            }
-        }
+                       text_uri.setText(entity.getUri().toString());
+               }
        }
 
        @Override
@@ -73,27 +67,8 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
                if(eventSource == text_uri){
                    URI uri = text_uri.getUri();
                    getEntity().setUri(uri);
-                   if(uri==null){
-                //buffer URI if parsing error occurred
-                MediaDetailElement parentMediaDetailElement = getParentMediaDetailElement();
-                if(parentMediaDetailElement!=null){
-                    parentMediaDetailElement.setUriBuffer(text_uri.getText());
-                }
-            }
-
                    firePropertyChangeEvent(this);
                }
        }
 
-    protected MediaDetailElement getParentMediaDetailElement() {
-        ICdmFormElement parentElement = getParentElement();
-        while(parentElement!=null){
-            parentElement = parentElement.getParentElement();
-            if(parentElement instanceof MediaDetailElement){
-                return (MediaDetailElement) parentElement;
-            }
-        }
-        return null;
-    }
-
 }
index 44aa277454c44f4cf9c4a43b6ab2543971fa4ad6..e6f79398c3e3c097d7a93c9efdb0fb66c855d044 100644 (file)
@@ -23,8 +23,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>AuthorshipDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created 05.06.2009
  * @version 1.0
@@ -33,38 +31,11 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
 
        private TaxonBase taxonBase;
 
-       /**
-        * <p>Constructor for AuthorshipDetailSection.</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 AuthorshipDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement,
                        ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /**
-        * {@inheritDoc}
-        *
-        * Author title is not in titleCache field
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
-        */
-       @Override
-       protected void setSectionTitle() {
-               if(getEntity() != null){
-                       String title = getHeading() + ": " + getEntity().getAuthorshipCache();
-               // we have to duplicate ampersands otherwise they are treated as
-               // mnenomic (see Label.setText() documentation)
-            // see also #4302
-               title = title.replace("&", "&&");
-            this.setText(title);
-               }
-       }
-
        /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase entity) {
@@ -73,27 +44,17 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<NonViralNa
                setEntity(name);
        }
 
-       /*
-        * (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.AbstractCdmDetailSection#getHeading()
-        */
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Authorship";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
-        */
        @Override
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
            return formFactory.createAuthorshipDetailElement(parentElement, style);
index a44b2e7b7008e984bcb26ff1c00c38d9067b598b..4f4c09e06ef72de7927395d69682a0d90195c6d6 100644 (file)
@@ -36,8 +36,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
- * <p>NonViralNameDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created May 20, 2010
  * @version 1.0
@@ -61,9 +59,6 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                super(formFactory, conversation, parentElement, selectionProvider, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#createToolbar()
-        */
        @Override
        protected Control createToolbar() {
                ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
@@ -122,26 +117,16 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
        }
 
 
-       /**
-        * @param nonViralName
-        *
-        */
        private boolean checkForMultipleNameUsages(NonViralName nonViralName) {
                return nonViralName.getTaxonBases().size() != 1;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
-        */
        /** {@inheritDoc} */
        @Override
        public String getHeading() {
                return "Name";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#setTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
-        */
        /** {@inheritDoc} */
        @Override
     public void setTaxonBase(TaxonBase taxon) {
@@ -150,32 +135,11 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<NonViral
                setEntity(name);
        }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
-     */
-    @Override
-    protected void setSectionTitle() {
-        super.setSectionTitle();
-        String title = getText();
-        // we have to duplicate ampersands otherwise they are treated as
-        // mnenomic (see Label.setText() documentation)
-        // see also #4302
-        title = title.replace("&", "&&");
-        setText(title);
-    }
-
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.section.ITaxonDetailSection#getTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)
-        */
        @Override
        public TaxonBase getTaxonBase() {
                return taxonBase;
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<NonViralName> createCdmDetailElement(AbstractCdmDetailSection<NonViralName> parentElement, int style) {
            return formFactory.createNonViralNameDetailElement(parentElement);
index 6681bfb8bf7a2e903ce7c4ff51dc817691ab1947..390529754a93ec98ebc8005071317ae6c814a555 100644 (file)
@@ -62,8 +62,8 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
                combo_origsourcetype = formFactory
                                .createEnumComboElement(OriginalSourceType.class,
                                                formElement, style);
+               super.createControls(formElement, style);
                text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
                text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
-               super.createControls(formElement, style);
        }
 }
index 3a3a1fad749460a9188a67ec606f7a17133a628b..86c1dece7916dc76482224e46c07f284b75192d2 100644 (file)
@@ -20,23 +20,12 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 
 /**
- * <p>TaxonBaseDetailSection class.</p>
- *
  * @author n.hoffmann
  * @created Nov 4, 2009
  * @version 1.0
  */
 public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase> {
 
-       /**
-        * <p>Constructor for TaxonBaseDetailSection.</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 TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
        }
@@ -47,26 +36,9 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase>
                return getEntity() != null ? getEntity().getClass().getSimpleName() : "TaxonBase";
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
-        */
        @Override
        protected AbstractCdmDetailElement<TaxonBase> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase> parentElement, int style) {
            return formFactory.createTaxonBaseDetailElement(parentElement, style);
        }
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#setSectionTitle()
-        */
-       @Override
-       protected void setSectionTitle() {
-           super.setSectionTitle();
-           String title = getText();
-        // we have to duplicate ampersands otherwise they are treated as
-        // mnenomic (see Label.setText() documentation)
-        // see also #4302
-        title = title.replace("&", "&&");
-        setText(title);
-       }
-
 }
index f2eef9fe3e63113dab460be3d7cf8bb122b58d87..712bec9d8a40c91ee3024b635122163b36d2e5a8 100644 (file)
@@ -3,8 +3,6 @@ package eu.etaxonomy.taxeditor.view;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.action.ContributionItem;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.viewers.ISelection;
@@ -17,10 +15,6 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
-
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 
 /**
  * Generic context menu for opening elements in the taxeditor.
@@ -34,40 +28,20 @@ public class CdmViewerContextMenu extends CompoundContributionItem {
                 new ContributionItem() {
                     @Override
                     public void fill(Menu menu, int index) {
-                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                        final ISelection selection = window.getActivePage().getSelection();
-
                         MenuItem addItem = new MenuItem(menu, SWT.CASCADE);
                         addItem.setText("Open in...");
                         Menu addMenu = new Menu(menu);
                         addItem.setMenu(addMenu);
+                        final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                        final ISelection selection = window.getActivePage().getSelection();
                         if(selection instanceof IStructuredSelection){
                             Object firstElement = ((IStructuredSelection) selection).getFirstElement();
-                            Map<String, String> availableViewers = CdmViewerUtil.getAvailableViewers(firstElement);
-                            for(Entry<String, String> entry:availableViewers.entrySet()){
-                                final String commandId = entry.getKey();
-                                String viewerName = entry.getValue();
+                            Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap = CdmViewerUtil.getNameViewerMap(firstElement);
+                            for(Entry<Entry<Class<?>, String>, ICdmViewer> entry:nameViewerMap.entrySet()){
+                                Entry<Class<?>, String> viewerClass = entry.getKey();
                                 MenuItem menuItem = new MenuItem(addMenu, SWT.NONE);
-                                menuItem.setText(viewerName);
-                                menuItem.addSelectionListener(new SelectionAdapter() {
-
-                                    @Override
-                                    public void widgetSelected(SelectionEvent e) {
-                                        ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
-
-                                        Command command = commandService.getCommand(commandId);
-                                        if(command.isEnabled()) {
-                                            IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
-                                            try {
-                                                handlerService.executeCommand(commandId, null);
-                                            } catch (NotDefinedException nde) {
-                                                throw new RuntimeException("Could not find open command: " + commandId);
-                                            } catch (Exception exception) {
-                                                MessagingUtils.error(getClass(), "An exception occured while trying execute "+commandId, exception);
-                                            }
-                                        }
-                                    }
-                                }) ;
+                                menuItem.setText(viewerClass.getValue());
+                                menuItem.addSelectionListener(new OpenInViewerListener(entry.getValue(), firstElement, viewerClass.getKey()));
                             }
                         }
                     }
index 88552f12f0310ef70e47948aa38a5608012bb516..6f5c6f67ab73666cdc2aec92a0f81f8c881aedca 100644 (file)
@@ -32,7 +32,7 @@ public class CdmViewerUtil {
 
     public static  Map<Entry<Class<?>, String>, ICdmViewer> getNameViewerMap(Object input){
         Map<Entry<Class<?>, String>, ICdmViewer> nameViewerMap = new HashMap<Entry<Class<?>, String>, ICdmViewer>();
-
+    
         IExtensionRegistry reg = Platform.getExtensionRegistry();
         IConfigurationElement[] extensions = reg
                 .getConfigurationElementsFor("eu.etaxonomy.taxeditor.store.cdmViewer");
@@ -56,30 +56,4 @@ public class CdmViewerUtil {
         return nameViewerMap;
     }
 
-    public static  Map<String, String> getAvailableViewers(Object input){
-        Map<String, String> commandViewerNameMap = new HashMap<String, String>();
-
-        if(input!=null){
-            IExtensionRegistry reg = Platform.getExtensionRegistry();
-            IConfigurationElement[] extensions = reg
-                    .getConfigurationElementsFor("eu.etaxonomy.taxeditor.store.cdmViewer");
-            for (IConfigurationElement configElement : extensions) {
-                if(configElement.getName().equals("viewCommandMapping")){
-                    String commandId = configElement.getAttribute("commandId");
-                    String viewerName = configElement.getAttribute("viewerName");
-                    try {
-                        Object selectionObject = configElement.createExecutableExtension("selection");
-                        Class<? extends Object> selectionClass = selectionObject.getClass();
-                        if(input.getClass().isAssignableFrom(selectionClass)){
-                            commandViewerNameMap.put(commandId, viewerName);
-                        }
-                    } catch (CoreException e) {
-                        MessagingUtils.error(CdmViewerChooser.class, "Could not initalize selection class element of cdmViewer extension", e);
-                    }
-                }
-            }
-        }
-        return commandViewerNameMap;
-    }
-
 }
diff --git a/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre b/eu.etaxonomy.taxeditor/eu.etaxonomy.taxeditor.product.with.jre
new file mode 100644 (file)
index 0000000..7998db3
--- /dev/null
@@ -0,0 +1,66 @@
+<?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="3.8.0.qualifier" useFeatures="true" includeLaunchers="true">
+
+   <aboutInfo>
+      <image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
+      <text>
+         %productBlurb
+      </text>
+   </aboutInfo>
+
+   <configIni use="default">
+   </configIni>
+
+   <launcherArgs>
+      <programArgs>-data @user.home/.cdmLibrary -Dserver_port=58080
+      </programArgs>
+      <programArgsLin>-vm jre/bin
+      </programArgsLin>
+      <programArgsMac>-vm ../../../jre/Contents/Home/jre/lib/jli/libjli.dylib
+      </programArgsMac>
+      <programArgsSol>-vm jre/bin
+      </programArgsSol>
+      <programArgsWin>-vm jre/bin
+      </programArgsWin>
+      <vmArgs>-Xmx512M -XX:MaxPermSize=256M -Dorg.eclipse.update.reconcile=false -Declipse.p2.unsignedPolicy=allow
+      </vmArgs>
+      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
+      </vmArgsMac>
+   </launcherArgs>
+
+   <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"
+      startupProgressRect="5,447,366,15"
+      startupMessageRect="7,432,360,20"
+      startupForegroundColor="000000" />
+   <launcher name="TaxonomicEditor">
+      <solaris/>
+      <win useIco="false">
+         <bmp/>
+      </win>
+   </launcher>
+
+   <vm>
+   </vm>
+
+   <plugins>
+   </plugins>
+
+   <features>
+      <feature id="eu.etaxonomy.taxeditor.feature"/>
+   </features>
+
+   <configurations>
+      <plugin id="eu.etaxonomy.taxeditor.application" autoStart="true" startLevel="5" />
+      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
+      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+      <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" />
+   </configurations>
+
+</product>
diff --git a/pom.xml b/pom.xml
index d6abb4c37f8c7579ab46332fe3de55759eab619c..6685cc15f6abede988b8697775ac157d6a7c4e7d 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -19,6 +19,7 @@
     <java.codelevel>1.6</java.codelevel>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <cdmlib.version>3.8.0-SNAPSHOT</cdmlib.version>
+    <!-- TODO can we use project.version ????? -->
     <tycho.version>0.22.0</tycho.version>
     <taxeditor.version>3.8.0-SNAPSHOT</taxeditor.version>
     <update.dir>snapshot</update.dir>
     <module>eu.etaxonomy.taxeditor.bulkeditor</module>
     <module>eu.etaxonomy.taxeditor.printpublisher</module>
     <module>eu.etaxonomy.taxeditor.help</module>
+    <module>eu.etaxonomy.taxeditor.molecular</module>
+    <module>eu.etaxonomy.taxeditor.molecular.lib</module>
     <module>eu.etaxonomy.taxeditor.application</module>
     <module>eu.etaxonomy.taxeditor.feature.platform</module>
     <module>eu.etaxonomy.taxeditor.feature</module>
-    <module>eu.etaxonomy.taxeditor.molecular</module>
-    <module>eu.etaxonomy.taxeditor.molecular.lib</module>
     <module>eu.etaxonomy.taxeditor</module>
   </modules>
   <scm>