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,
-<?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>
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;
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;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * <p>
- * BulkEditor class.
- * </p>
- *
* @author p.ciardelli
* @created 07.07.2009
* @version 1.0
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() {
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,
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)
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) {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.editors.text.TextEditor#dispose()
- */
/** {@inheritDoc} */
@Override
public void dispose() {
}
- /* (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() {
}
}
- /**
- *
- */
private void displayWarningDialog() {
IPreferenceStore prefs = PreferencesUtil.getPreferenceStore();
if (!prefs.getBoolean(PreferencesUtil.HIDE_BULKEDITOR_INFO)) {
}
}
- /**
- * @param control
- */
private void addToggleMergeCandidateListener(Control control) {
control.addMouseListener(new MouseAdapter() {
@Override
});
}
- /**
- * <p>toggleMergeCandidateAnnotation</p>
- *
- * @param line a int.
- */
public void toggleMergeCandidateAnnotation(int line) {
IDocument document = getSourceViewer().getDocument();
}
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor#isDirty()
- */
@Override
public boolean isDirty() {
if(isDirty){
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();
}
// firePropertyChange(PROP_DIRTY);
}
- /* (non-Javadoc)
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
- */
/** {@inheritDoc} */
public void performSearch(BulkEditorQuery query) {
if (query != null) {
}
conversation.commit();
conversation.clear();
-
+
getEditorInput().performSearch(query);
refresh();
getSelectionProvider().setSelection(selection);
}
- /**
- *
- */
public void refresh() {
if(getDocumentProvider().getAnnotationModel(getEditorInput()) != null){
((AnnotationModel) getDocumentProvider().getAnnotationModel(getEditorInput())).removeAllAnnotations();
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
* @version 1.0
*/
public class 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;
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;
}
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import eu.etaxonomy.taxeditor.store.SearchManager;
/**
- * <p>BulkEditorSearchComposite class.</p>
- *
* @author p.ciardelli
* @author e.-m.lee
* @author n.hoffmann
* @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");
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) {
}
}
});
-
+
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();
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>
}
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
// $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;
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;
/**
- * <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();
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) {
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,
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();
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
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
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
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
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>
@Override
public void setFocus() {
+ getConversationHolder().commit(true);
getConversationHolder().bind();
super.setFocus();
}
@Override
public boolean postOperation(CdmBase objectAffectedByOperation) {
viewer.refresh();
-
+ getConversationHolder().bind();
+ getConversationHolder().commit(true);
editor.changed(objectAffectedByOperation);
if (objectAffectedByOperation != null) {
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;
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);
}
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
*
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;
}
*/
public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
- /**
- * @param query
- */
public GbifImportEditorInput(OccurenceQuery query) {
super();
this.query = query;
}
- /* (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;
return result;
}
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
@Override
public boolean equals(Object obj) {
if (this == obj) {
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,
DerivateViewEditorInput derivateViewEditorInput = (DerivateViewEditorInput) getEditorInput();
return derivateViewEditorInput.getName();
}
- return "Derivative View";
+ return "Derivative Editor";
}
/* (non-Javadoc)
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()){
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;
/**
* @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)
*/
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){
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);
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);
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;
+ }
+
}
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;
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;
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));
}
}
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;
* @created Feb 8, 2011
* @version 1.0
*/
-public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation {
+public class MoveDescriptionElementsOperation extends AbstractPostTaxonOperation{
private Collection<DescriptionElementBase> descriptionElements;
private DescriptionBase targetDescription;
service.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isCopy);
+
return postExecute(targetDescription);
}
// TODO Auto-generated method stub
return null;
}
+
+
}
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
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
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: .
-bin.includes = META-INF/,\
+bin.includes = .,\
+ META-INF/,\
plugin.xml,\
icons/,\
OSGI-INF/
+source.. = src/main/java/
<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>
*/
@Override
public boolean postOperation(CdmBase objectAffectedByOperation) {
+ getConversationHolder().bind();
+ getConversationHolder().commit(true);
viewer.refresh();
return true;
}
--- /dev/null
+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;
+ }
+
+}
--- /dev/null
+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;
+ }
+}
--- /dev/null
+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;
+ }
+
+}
--- /dev/null
+// $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()]);
+ }
+ }
+}
--- /dev/null
+// $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;
+
+ }
+
+}
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;
}
}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);
}
}
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
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
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">
</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"/>
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);
+++ /dev/null
-// $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());
- }
- }
-
-
-}
// $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.
*/
/**
* 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,
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,
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());
}
}
-
+
}
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;
}
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;
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;
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;
// 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;
}
public List<NameRelationship> findNameRelationships(
IIdentifiableEntityServiceConfigurator configurator) {
if(true){
+ //if activated again remember to add uuid search results like in other searches
return NO_RESULTS;
}
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);
}
/**
* @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);
}
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);
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",
}
}
- /**
- *
- * @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;
}
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
}
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;
}
--- /dev/null
+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;
+ }
+ }
+
+
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;
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;
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;
}
}
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());
private ITaxonTreeNode parentTreeNode;
private EntitySelectionElement<Taxon> selection_reuseExistingTaxon;
+ private EntitySelectionElement<Reference> selection_SecRef;
private Taxon taxon;
+
+ private Reference secReference;
private TextWithLabelElement textNewTaxonName;
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,
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);
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) {
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) {
getTaxonDescriptions(),
false,
false,
- null,
+
null,
presenceAbsenceTermColors,
languages);
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,
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);
*/
package eu.etaxonomy.taxeditor.ui.section.media;
-import java.net.URI;
import java.util.List;
import java.util.Set;
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;
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);
}
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);
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();
}
}
return isAdvancedMediaView;
}
- public void setUriBuffer(String uriBuffer) {
- this.uriBuffer = uriBuffer;
- }
-
- public String getUriBuffer() {
- return uriBuffer;
- }
-
}
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
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;
- }
-
}
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
/**
- * <p>AuthorshipDetailSection class.</p>
- *
* @author n.hoffmann
* @created 05.06.2009
* @version 1.0
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) {
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);
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
/**
- * <p>NonViralNameDetailSection class.</p>
- *
* @author n.hoffmann
* @created May 20, 2010
* @version 1.0
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);
}
- /**
- * @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) {
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);
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);
}
}
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);
}
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);
- }
-
}
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;
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.
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()));
}
}
}
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");
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;
- }
-
}
--- /dev/null
+<?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>
<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>