Fixes #1412
authorn.hoffmann <n.hoffmann@localhost>
Thu, 21 Jan 2010 13:19:25 +0000 (13:19 +0000)
committern.hoffmann <n.hoffmann@localhost>
Thu, 21 Jan 2010 13:19:25 +0000 (13:19 +0000)
taxeditor-editor/plugin.xml
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiontree/handler/DeleteHandler.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/DeleteTaxonBaseHandler.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/handler/DeleteTaxonNodeHandler.java

index 88b743a04d7a5a6e865c2bedc98f39c19ad47d1a..72a626e6985b41d99eefb15903ac714909a4a263 100644 (file)
          </run>
       </application>
    </extension>
+      <extension
+            point="org.eclipse.core.runtime.adapters">
+         <factory
+               adaptableType="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor"
+               class="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditorAdapterFactory">
+            <adapter
+                  type="eu.etaxonomy.taxeditor.editor.DuplicateArbitrator">
+            </adapter>
+         </factory>
+      </extension>
    <extension
          point="org.eclipse.ui.editors">
       <editor
             id="eu.etaxonomy.taxeditor.taxonImageEditor"
             name="Taxon Image Editor">
       </editor>
+   </extension>
+      <extension
+            point="org.eclipse.ui.views">
+         <view
+               allowMultiple="false"
+               class="eu.etaxonomy.taxeditor.namerelationsview.NameRelationsView"
+               id="taxeditor-editor.namerelationsview"
+               name="Name Relations"
+               restorable="true">
+         </view>
+         <view
+               allowMultiple="false"
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.TabbedPropertyView"
+               id="eu.etaxonomy.taxeditor.views.tabbedPropertiesView"
+               name="Tabbed Properties"
+               restorable="true">
+         </view>
+      </extension>
+   <extension
+         point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
+      <propertyContributor
+            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor"
+            labelProvider="eu.etaxonomy.taxeditor.propertysheet.tabbed.TabbedPropertyPageLabelProvider"
+            typeMapper="eu.etaxonomy.taxeditor.propertysheet.tabbed.TaxonTypeMapper">
+         <propertyCategory
+               category="taxonBase"></propertyCategory>
+      </propertyContributor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
+      <propertyTabs
+            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor">
+         <propertyTab
+               category="taxonBase"
+               id="taxonNameEditor.nameTab"
+               label="Name">
+         </propertyTab>
+         <propertyTab
+               afterTab="taxonNameEditor.nomRefTab"
+               category="taxonBase"
+               id="taxonNameEditor.nameRelationsTab"
+               label="Name Relations">
+         </propertyTab>
+         <propertyTab
+               afterTab="taxonNameEditor.nameRelationsfTab"
+               category="taxonBase"
+               id="taxonNameEditor.secundumTab"
+               label="Secundum">
+         </propertyTab>
+         <propertyTab
+               afterTab="taxonNameEditor.secundumTab"
+               category="taxonBase"
+               id="taxonNameEditor.annotationsTab"
+               label="Annotations">
+         </propertyTab>
+         <propertyTab
+               afterTab="taxonNameEditor.annotationsTab"
+               category="taxonBase"
+               id="taxonNameEditor.generalTab"
+               label="General">
+         </propertyTab>
+      </propertyTabs>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views.properties.tabbed.propertySections">
+      <propertySections
+            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor">
+         <propertySection
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NameOverviewSection"
+               id="taxonNameEditor.overview.name"
+               tab="taxonNameEditor.nameTab">
+            <input
+                  type="eu.etaxonomy.taxeditor.editor.name.AcceptedNameComposite">
+            </input>
+            <input
+                  type="eu.etaxonomy.taxeditor.editor.name.SynonymComposite">
+            </input>
+         </propertySection>
+         <propertySection
+               afterSection="taxonNameEditor.overview.name"
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NamePropertySection"
+               id="taxonNameEditor.nameSection"
+               tab="taxonNameEditor.nameTab">
+            <input
+                  type="eu.etaxonomy.taxeditor.editor.name.AcceptedNameComposite">
+            </input>
+            <input
+                  type="eu.etaxonomy.taxeditor.editor.name.SynonymComposite">
+            </input>
+         </propertySection>
+         <!--propertySection
+               afterSection="taxonNameEditor.nameSection"
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.AuthorSection"
+               id="taxonNameEditor.authorSection"
+               tab="taxonNameEditor.nameTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection>
+         <propertySection
+               afterSection="taxonNameEditor.authorSection"
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NomRefPropertySection"
+               id="taxonNameEditor.nomRefSection"
+               tab="taxonNameEditor.nameTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection-->
+         <propertySection
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.CreatedSection"
+               id="taxonNameEditor.createdSection"
+               tab="taxonNameEditor.generalTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection>
+         <propertySection
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.AnnotationSection"
+               id="taxonNameEditor.annotationSection"
+               tab="taxonNameEditor.annotationsTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection>
+         <propertySection
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NameRelationsSection"
+               id="taxonNameEditor.nameRelationSection"
+               tab="taxonNameEditor.nameRelationsTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection>
+         <propertySection
+               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.SecundumSection"
+               id="taxonNameEditor.secundumSection"
+               tab="taxonNameEditor.secundumTab">
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
+            </input>
+            <input
+                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
+            </input>
+         </propertySection>
+      </propertySections>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="eu.etaxonomy.taxeditor.application.perspective">
+         <view
+               closeable="true"
+               id="org.eclipse.ui.views.PropertySheet"
+               minimized="false"
+               moveable="true"
+               ratio="0.7"
+               relationship="right"
+               relative="org.eclipse.ui.editorss"
+               showTitle="false"
+               visible="true">
+         </view>
+      </perspectiveExtension>
+   </extension>
+   <extension
+         point="org.eclipse.ui.elementFactories">
+      <factory
+            class="eu.etaxonomy.taxeditor.editor.TaxonEditorInputFactory"
+            id="eu.etaxonomy.taxeditor.editor.TaxonEditorInputFactory">
+      </factory>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView">
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.command.showPropertySheetView"
+               label="Property Sheet"
+               style="push">
+         </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.commands.showTabbedPropertiesView"
+               label="Tabbed Properties"
+               style="push">
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.ShowPropertySheetHandler"
+            id="eu.etaxonomy.taxeditor.editor.command.showPropertySheetView"
+            name="Show Property Sheet">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.ShowTabbedPropertiesViewHandler"
+            id="eu.etaxonomy.taxeditor.editor.commands.showTabbedPropertiesView"
+            name="Show Tabbed Properties">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:org.eclipse.ui.main.menu.navigate">
+         <menu
+               id="menu:org.eclipse.ui.main.menu.navigate.goto"
+               label="Go To">
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.command.previousMember"
+                  label="Previous Member"
+                  style="push">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.command.nextMember"
+                  label="Next Member"
+                  style="push">
+            </command>
+         </menu>
+         <separator
+               name="taxeditor-editor.separator1"
+               visible="true">
+         </separator>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.command.openParent"
+               label="Open Parent"
+               style="push">
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.PreviousMemberHandler"
+            id="eu.etaxonomy.taxeditor.editor.command.previousMember"
+            name="Previous Member">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.NextMemberHandler"
+            id="eu.etaxonomy.taxeditor.editor.command.nextMember"
+            name="Next Member">
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenParentHandler"
+            id="eu.etaxonomy.taxeditor.editor.command.openParent"
+            name="Open Parent">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.menus">
                   style="push">
             </command>
       </menuContribution>
-      <menuContribution
-            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView">
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.command.showPropertySheetView"
-               label="Property Sheet"
-               style="push">
-         </command>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.commands.showTabbedPropertiesView"
-               label="Tabbed Properties"
-               style="push">
-         </command>
-         <!--command
-               commandId="eu.etaxonomy.taxeditor.editor.commands.showNameRelationsView"
-               label="Name Relations"
-               style="push">
-         </command-->
-      </menuContribution>
-      <menuContribution
-            locationURI="menu:org.eclipse.ui.main.menu.navigate">
-         <menu
-               id="menu:org.eclipse.ui.main.menu.navigate.goto"
-               label="Go To">
-            <command
-                  commandId="eu.etaxonomy.taxeditor.editor.command.previousMember"
-                  label="Previous Member"
-                  style="push">
-            </command>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.editor.command.nextMember"
-                  label="Next Member"
-                  style="push">
-            </command>
-         </menu>
-         <separator
-               name="taxeditor-editor.separator1"
-               visible="true">
-         </separator>
-         <command
-               commandId="eu.etaxonomy.taxeditor.editor.command.openParent"
-               label="Open Parent"
-               style="push">
-         </command>
-      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.handlers">
             name="Save All">
       </command-->
    </extension>
-   <extension
-         point="org.eclipse.core.expressions.definitions">
-      <definition
-            id="nameEditorActive">
-         <with
-               variable="activeEditorId">
-            <equals
-                  value="eu.etaxonomy.taxeditor.editor.multipagetaxonview">
-            </equals>
-         </with>
-      </definition>
-      <definition
-            id="isAcceptedTaxon">
-         <with
-               variable="activeMenuSelection">
-            <iterate>
-               <instanceof
-                     value="eu.etaxonomy.taxeditor.propertysheet.name.AcceptedTaxonPropertySource">
-               </instanceof>
-            </iterate>
-         </with>
-      </definition>
-      <definition
-            id="isSynonym">
-         <with
-               variable="activeMenuSelection">
-            <iterate>
-               <instanceof
-                     value="eu.etaxonomy.taxeditor.propertysheet.name.SynonymPropertySource">
-               </instanceof>
-            </iterate>
-         </with>
-      </definition>
-      <definition
-            id="isMisapplication">
-         <with
-               variable="activeMenuSelection">
-            <iterate>
-               <instanceof
-                     value="eu.etaxonomy.taxeditor.propertysheet.name.MisapplicationPropertySource">
-               </instanceof>
-            </iterate>
-         </with>
-      </definition>
-      <definition
-            id="isConceptRelation">
-         <with
-               variable="activeMenuSelection">
-            <iterate>
-               <instanceof
-                     value="eu.etaxonomy.taxeditor.propertysheet.name.ConceptPropertySource">
-               </instanceof>
-            </iterate>
-         </with>
-      </definition>
-      <definition
-            id="isCdmObject">
-         <with
-               variable="activeMenuSelection">
-            <iterate>
-               <instanceof
-                     value="eu.etaxonomy.taxeditor.propertysheet.ICdmBasePropertySource">
-               </instanceof>
-            </iterate>
-         </with>
-      </definition>
-      <definition
-            id="isSelectionNonAcceptedTaxonName">
-         <with
-               variable="selection">
-            <and>
-               <not>
-                  <iterate>
-                     <instanceof
-                           value="eu.etaxonomy.taxeditor.propertysheet.name.AcceptedTaxonPropertySource">
-                     </instanceof>
-                  </iterate>
-               </not>
-               <iterate>
-                  <instanceof
-                        value="eu.etaxonomy.taxeditor.propertysheet.name.TaxonBasePropertySource">
-                  </instanceof>
-               </iterate>
-            </and>
-         </with>
-      </definition>
-   </extension>
    <extension
          name="Name Commands"
          point="org.eclipse.ui.commands">
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.RemoveBasionymHandler"
             id="eu.etaxonomy.taxeditor.editor.name.removeBasionym"
             name="Remove Basionym / Original Combination">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeAcceptedTaxonToSynonymHandler"
-            id="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
-            name="Change Accepted Taxon to Synonym">
-      </command>
-   </extension>
-   <extension
-         point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.ShowPropertySheetHandler"
-            id="eu.etaxonomy.taxeditor.editor.command.showPropertySheetView"
-            name="Show Property Sheet">
-      </command>
-   </extension>
-   <extension
-         point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.PreviousMemberHandler"
-            id="eu.etaxonomy.taxeditor.editor.command.previousMember"
-            name="Previous Member">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.NextMemberHandler"
-            id="eu.etaxonomy.taxeditor.editor.command.nextMember"
-            name="Next Member">
-      </command>
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenParentHandler"
-            id="eu.etaxonomy.taxeditor.editor.command.openParent"
-            name="Open Parent">
-      </command>
-   </extension>
-   <extension
-         point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.ShowTabbedPropertiesViewHandler"
-            id="eu.etaxonomy.taxeditor.editor.commands.showTabbedPropertiesView"
-            name="Tabbed Properties">
-      </command>
-   </extension>
-   <extension
-         point="org.eclipse.ui.elementFactories">
-      <factory
-            class="eu.etaxonomy.taxeditor.editor.TaxonEditorInputFactory"
-            id="eu.etaxonomy.taxeditor.editor.TaxonEditorInputFactory">
-      </factory>
-   </extension>
-   <extension
-         point="org.eclipse.ui.perspectiveExtensions">
-      <perspectiveExtension
-            targetID="eu.etaxonomy.taxeditor.application.perspective">
-         <view
-               closeable="true"
-               id="org.eclipse.ui.views.PropertySheet"
-               minimized="false"
-               moveable="true"
-               ratio="0.7"
-               relationship="right"
-               relative="org.eclipse.ui.editorss"
-               showTitle="false"
-               visible="true">
-         </view>
-      </perspectiveExtension>
-   </extension>
-   <extension
-         point="org.eclipse.ui.bindings">   
-      <key
-            commandId="eu.etaxonomy.taxeditor.editor.command.nextMember"
-            contextId="org.eclipse.ui.contexts.window"
-            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
-            sequence="M2+M3+ARROW_DOWN">
-      </key>
-      <key
-            commandId="eu.etaxonomy.taxeditor.editor.command.previousMember"
-            contextId="org.eclipse.ui.contexts.window"
-            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
-            sequence="M2+M3+ARROW_UP">
-      </key>
-      <scheme
-            description="The default key binding scheme for the Taxonomic Editor"
-            id="eu.etaxonomy.taxeditor.bindings.scheme.default"
-            name="Taxonomic Editor Default Key Bindings">
-      </scheme>
-   </extension>
-   <extension
-         point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
-      <propertyContributor
-            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor"
-            labelProvider="eu.etaxonomy.taxeditor.propertysheet.tabbed.TabbedPropertyPageLabelProvider"
-            typeMapper="eu.etaxonomy.taxeditor.propertysheet.tabbed.TaxonTypeMapper">
-         <propertyCategory
-               category="taxonBase"></propertyCategory>
-      </propertyContributor>
-   </extension>
-   <extension
-         point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
-      <propertyTabs
-            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor">
-         <propertyTab
-               category="taxonBase"
-               id="taxonNameEditor.nameTab"
-               label="Name">
-         </propertyTab>
-         <propertyTab
-               afterTab="taxonNameEditor.nomRefTab"
-               category="taxonBase"
-               id="taxonNameEditor.nameRelationsTab"
-               label="Name Relations">
-         </propertyTab>
-         <propertyTab
-               afterTab="taxonNameEditor.nameRelationsfTab"
-               category="taxonBase"
-               id="taxonNameEditor.secundumTab"
-               label="Secundum">
-         </propertyTab>
-         <propertyTab
-               afterTab="taxonNameEditor.secundumTab"
-               category="taxonBase"
-               id="taxonNameEditor.annotationsTab"
-               label="Annotations">
-         </propertyTab>
-         <propertyTab
-               afterTab="taxonNameEditor.annotationsTab"
-               category="taxonBase"
-               id="taxonNameEditor.generalTab"
-               label="General">
-         </propertyTab>
-      </propertyTabs>
+      </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.ChangeAcceptedTaxonToSynonymHandler"
+            id="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
+            name="Change Accepted Taxon to Synonym">
+      </command>
    </extension>
    <extension
-         point="org.eclipse.ui.views.properties.tabbed.propertySections">
-      <propertySections
-            contributorId="eu.etaxonomy.taxeditor.taxonNameEditor">
-         <propertySection
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NameOverviewSection"
-               id="taxonNameEditor.overview.name"
-               tab="taxonNameEditor.nameTab">
-            <input
-                  type="eu.etaxonomy.taxeditor.editor.name.AcceptedNameComposite">
-            </input>
-            <input
-                  type="eu.etaxonomy.taxeditor.editor.name.SynonymComposite">
-            </input>
-         </propertySection>
-         <propertySection
-               afterSection="taxonNameEditor.overview.name"
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NamePropertySection"
-               id="taxonNameEditor.nameSection"
-               tab="taxonNameEditor.nameTab">
-            <input
-                  type="eu.etaxonomy.taxeditor.editor.name.AcceptedNameComposite">
-            </input>
-            <input
-                  type="eu.etaxonomy.taxeditor.editor.name.SynonymComposite">
-            </input>
-         </propertySection>
-         <!--propertySection
-               afterSection="taxonNameEditor.nameSection"
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.AuthorSection"
-               id="taxonNameEditor.authorSection"
-               tab="taxonNameEditor.nameTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection>
-         <propertySection
-               afterSection="taxonNameEditor.authorSection"
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NomRefPropertySection"
-               id="taxonNameEditor.nomRefSection"
-               tab="taxonNameEditor.nameTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection-->
-         <propertySection
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.CreatedSection"
-               id="taxonNameEditor.createdSection"
-               tab="taxonNameEditor.generalTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection>
-         <propertySection
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.AnnotationSection"
-               id="taxonNameEditor.annotationSection"
-               tab="taxonNameEditor.annotationsTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection>
-         <propertySection
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.NameRelationsSection"
-               id="taxonNameEditor.nameRelationSection"
-               tab="taxonNameEditor.nameRelationsTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection>
-         <propertySection
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.SecundumSection"
-               id="taxonNameEditor.secundumSection"
-               tab="taxonNameEditor.secundumTab">
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Taxon">
-            </input>
-            <input
-                  type="eu.etaxonomy.cdm.model.taxon.Synonym">
-            </input>
-         </propertySection>
-      </propertySections>
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="nameEditorActive">
+         <with
+               variable="activeEditorId">
+            <equals
+                  value="eu.etaxonomy.taxeditor.editor.multipagetaxonview">
+            </equals>
+         </with>
+      </definition>
+      <definition
+            id="isAcceptedTaxon">
+         <with
+               variable="activeMenuSelection">
+            <iterate>
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.propertysheet.name.AcceptedTaxonPropertySource">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="isSynonym">
+         <with
+               variable="activeMenuSelection">
+            <iterate>
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.propertysheet.name.SynonymPropertySource">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="isMisapplication">
+         <with
+               variable="activeMenuSelection">
+            <iterate>
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.propertysheet.name.MisapplicationPropertySource">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="isConceptRelation">
+         <with
+               variable="activeMenuSelection">
+            <iterate>
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.propertysheet.name.ConceptPropertySource">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="isCdmObject">
+         <with
+               variable="activeMenuSelection">
+            <iterate>
+               <instanceof
+                     value="eu.etaxonomy.taxeditor.propertysheet.ICdmBasePropertySource">
+               </instanceof>
+            </iterate>
+         </with>
+      </definition>
+      <definition
+            id="isSelectionNonAcceptedTaxonName">
+         <with
+               variable="selection">
+            <and>
+               <not>
+                  <iterate>
+                     <instanceof
+                           value="eu.etaxonomy.taxeditor.propertysheet.name.AcceptedTaxonPropertySource">
+                     </instanceof>
+                  </iterate>
+               </not>
+               <iterate>
+                  <instanceof
+                        value="eu.etaxonomy.taxeditor.propertysheet.name.TaxonBasePropertySource">
+                  </instanceof>
+               </iterate>
+            </and>
+         </with>
+      </definition>
    </extension>
-      <extension
-            point="org.eclipse.core.runtime.adapters">
-         <factory
-               adaptableType="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor"
-               class="eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditorAdapterFactory">
-            <adapter
-                  type="eu.etaxonomy.taxeditor.editor.DuplicateArbitrator">
-            </adapter>
-         </factory>
-      </extension>
       <extension
             point="org.eclipse.ui.menus">
          <menuContribution
             </command>
          </menuContribution>
       </extension>
+   <extension
+         point="org.eclipse.ui.bindings">   
+      <key
+            commandId="eu.etaxonomy.taxeditor.editor.command.nextMember"
+            contextId="org.eclipse.ui.contexts.window"
+            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+            sequence="M2+M3+ARROW_DOWN">
+      </key>
+      <key
+            commandId="eu.etaxonomy.taxeditor.editor.command.previousMember"
+            contextId="org.eclipse.ui.contexts.window"
+            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+            sequence="M2+M3+ARROW_UP">
+      </key>
+      <scheme
+            description="The default key binding scheme for the Taxonomic Editor"
+            id="eu.etaxonomy.taxeditor.bindings.scheme.default"
+            name="Taxonomic Editor Default Key Bindings">
+      </scheme>
+   </extension>
+      <extension
+            point="org.eclipse.ui.handlers">
+         <handler
+               class="eu.etaxonomy.taxeditor.editor.descriptiontree.handler.DeleteHandler"
+               commandId="org.eclipse.ui.edit.delete">
+            <activeWhen>
+               <reference
+                     definitionId="isDeletable">
+               </reference></activeWhen>
+         </handler>
+      </extension>
       <extension
             point="org.eclipse.ui.commands">
          <command
          <definition
                id="isDeletable">
             <with
-                  variable="activeMenuSelection">
+                  variable="selection">
                <or>
                   <iterate>
                      <instanceof
                type="org.eclipse.jface.viewers.TreeSelection">
          </propertyTester>
       </extension>
-      <extension
-            point="org.eclipse.ui.views">
-         <view
-               allowMultiple="false"
-               class="eu.etaxonomy.taxeditor.namerelationsview.NameRelationsView"
-               id="taxeditor-editor.namerelationsview"
-               name="Name Relations"
-               restorable="true">
-         </view>
-         <view
-               allowMultiple="false"
-               class="eu.etaxonomy.taxeditor.propertysheet.tabbed.TabbedPropertyView"
-               id="eu.etaxonomy.taxeditor.views.tabbedPropertiesView"
-               name="Tabbed Properties"
-               restorable="true">
-         </view>
-      </extension>
       <extension
             point="org.eclipse.ui.commands">
          <command
                name="New Editor">
          </command>
       </extension>
-      <extension
-            point="org.eclipse.ui.handlers">
-         <handler
-               class="eu.etaxonomy.taxeditor.editor.descriptiontree.handler.DeleteHandler"
-               commandId="org.eclipse.ui.edit.delete">
-            <activeWhen>
-               <reference
-                     definitionId="isDeletable">
-               </reference></activeWhen>
-         </handler>
-      </extension>
 </plugin>
index 7221836b086a56693cec7c34890fe4fa557777b7..03627cf638658c9da5d8a81462e4532decf6c666 100644 (file)
@@ -16,6 +16,7 @@ import java.util.UUID;
 import org.eclipse.core.commands.operations.IOperationHistory;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.jface.dialogs.MessageDialog;\r
+import org.eclipse.jface.viewers.ISelection;\r
 import org.eclipse.swt.widgets.Shell;\r
 import org.eclipse.ui.IEditorInput;\r
 import org.eclipse.ui.IEditorPart;\r
@@ -23,8 +24,8 @@ import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IPageLayout;\r
 import org.eclipse.ui.IViewPart;\r
 import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
 import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
 \r
 /**\r
@@ -159,6 +160,19 @@ public class EditorUtil extends AbstractUtility{
                \r
                return editor.getPage(page);\r
        }\r
+       \r
+       /**\r
+        * Returns the selection of the currently active taxon editor\r
+        * \r
+        * @return\r
+        */\r
+       public static ISelection getCurrentSelection(){\r
+               if(getActiveEditor() == null){\r
+                       return null;\r
+               }else{\r
+                       return getActiveEditor().getSite().getSelectionProvider().getSelection();\r
+               }\r
+       }\r
 \r
        public static IUndoContext getUndoContext(MultiPageTaxonEditor editor){\r
                return editor.getUndoContext();\r
index 6aade5e9a990ce118069ba257f0584da16ead8e3..2c0181eef8bdb7d44f246de3bc34f18274a95639 100644 (file)
@@ -48,43 +48,56 @@ public class DeleteHandler extends AbstractHandler {
         */
        public Object execute(ExecutionEvent event) throws ExecutionException {
                IEditorPart editor = HandlerUtil.getActiveEditor(event);
+               
                if (editor instanceof FormEditor) {
                        editor = ((FormEditor) editor).getActiveEditor();
                }
+               
                IEditorInput input = editor.getEditorInput();
+               
                if (input instanceof TaxonEditorInput) {
                        Taxon taxon = ((TaxonEditorInput) input).getTaxon();
-                       ISelection selection = HandlerUtil.getCurrentSelection(event);
+                       
+                       ISelection selection = EditorUtil.getCurrentSelection();
                        
                        Object deleteElement = ((TreeSelection) selection).getFirstElement();
                        
                        IUndoableOperation operation = null;
+                       String commandName = null;
+                       
                        try {
+                               commandName = event.getCommand().getName();
+                       } catch (NotDefinedException e) {
+                               logger.error(e);
+                               throw new RuntimeException(e);
+                       }                       
+                       
+                       // TODO use undo context specific to editor
+                       if (deleteElement instanceof DescriptionElementBase) {
+                               DescriptionElementBase descriptionElement = (DescriptionElementBase) deleteElement;
                                
-                               if (deleteElement instanceof DescriptionElementBase) {
-                                       DescriptionElementBase descriptionElement = (DescriptionElementBase) deleteElement;
-                                       // TODO use undo context specific to editor
-                                       operation = new DeleteDescriptionElementOperation(event.getCommand().getName(), 
-                                                       EditorUtil.getUndoContext(), taxon, descriptionElement, (IPostOperationEnabled) editor);
-                               }else if (deleteElement instanceof ImageFile) {
-                                       ImageFile imageFile = (ImageFile) deleteElement;
-                                       TreePath[] paths = ((TreeSelection) selection).getPaths();
-                                       TaxonDescription description = (TaxonDescription) (paths[0]).getFirstSegment();
-                                       operation = new DeleteImageOperation(event.getCommand().getName(), 
-                                                       EditorUtil.getUndoContext(), taxon, description, imageFile, (IPostOperationEnabled) editor);
-                               }else if(deleteElement instanceof TaxonDescription){
-                                       
-                                       TaxonDescription description = (TaxonDescription) deleteElement;
-                                       // TODO use undo context specific to editor
-                                       operation = new DeleteTaxonDescriptionOperation(event.getCommand().getName(), 
-                                                       EditorUtil.getUndoContext(), taxon, description, (IPostOperationEnabled) editor);
-                                       EditorUtil.executeOperation(operation);
-                               }
+                               operation = new DeleteDescriptionElementOperation(commandName, 
+                                               EditorUtil.getUndoContext(), taxon, descriptionElement, (IPostOperationEnabled) editor);
+                       }
+                       else if (deleteElement instanceof ImageFile) {
+                               ImageFile imageFile = (ImageFile) deleteElement;
+                               TreePath[] paths = ((TreeSelection) selection).getPaths();
+                               TaxonDescription description = (TaxonDescription) (paths[0]).getFirstSegment();
                                
+                               operation = new DeleteImageOperation(commandName, 
+                                               EditorUtil.getUndoContext(), taxon, description, imageFile, (IPostOperationEnabled) editor);
+                       }
+                       else if(deleteElement instanceof TaxonDescription){
+                               
+                               TaxonDescription description = (TaxonDescription) deleteElement;
+                               
+                               operation = new DeleteTaxonDescriptionOperation(commandName, 
+                                               EditorUtil.getUndoContext(), taxon, description, (IPostOperationEnabled) editor);
                                EditorUtil.executeOperation(operation);
-                       } catch (NotDefinedException e) {
-                               logger.warn("Command name not set");
                        }
+                       
+                       EditorUtil.executeOperation(operation);
+                       
                }               
                return null;
        }
index 6dcc4fa7446c560eef44e73af29a39adb05cc01f..f4aa375fe14d584af5c1c49e0c8b82fcf419462b 100644 (file)
@@ -45,21 +45,23 @@ public class DeleteTaxonBaseHandler extends AbstractHandler implements IHandler
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
         */\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(\r
-                               Page.NAME);\r
-               ISelection menuSelection = editor.getSite().getSelectionProvider().getSelection();\r
+               TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);\r
+               ISelection menuSelection = EditorUtil.getCurrentSelection();\r
                \r
                TaxonBasePropertySource taxonBasePropertySource = (TaxonBasePropertySource) ((StructuredSelection) menuSelection).getFirstElement();\r
                \r
                IUndoableOperation operation = null;\r
                String commandName = null;\r
                \r
-               try{\r
+               \r
+               try {\r
                        commandName = event.getCommand().getName();\r
-               }catch (NotDefinedException e) {\r
-                       logger.warn("Command name not set");\r
+               } catch (NotDefinedException e) {\r
+                       logger.error(e);\r
+                       throw new RuntimeException(e);\r
                }\r
                \r
+               \r
                // synonym\r
                if(taxonBasePropertySource instanceof SynonymPropertySource){\r
                        Synonym synonym = (Synonym) taxonBasePropertySource.getTaxonBase();\r
index f1387e3463842057fd4812eb80499e491a68a6f1..641075e158d1670b46aeb8a4ccfe012736790a2d 100644 (file)
@@ -25,7 +25,6 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;