Add "Open in..." menu to polytomous key editors and navigator #5610
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 12 Apr 2016 04:36:04 +0000 (06:36 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 12 Apr 2016 09:10:36 +0000 (11:10 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListEditor.java
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/PolytomousKeyViewPart.java

index 9c977a7..9db3b0b 100644 (file)
@@ -49,6 +49,8 @@ import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.INameService;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
+import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.ITermService;
@@ -64,6 +66,8 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.name.NonViralName;
@@ -239,6 +243,10 @@ public class ReferencingObjectsView extends AbstractCdmViewPart {
                 referencedObject = CdmStore.getService(IDescriptionService.class).loadDescriptionElement(entity, null);
             } else if (objectClass.equals(Sequence.class)){
                 referencedObject = CdmStore.getService(ISequenceService.class).load(entity, null);
+            } else if (PolytomousKey.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IPolytomousKeyService.class).load(entity, null);
+            } else if (PolytomousKeyNode.class.isAssignableFrom(objectClass)){
+                referencedObject = CdmStore.getService(IPolytomousKeyNodeService.class).load(entity, null);
             } else if (DefinedTermBase.class.isAssignableFrom(objectClass)){
                 referencedObject = CdmStore.getService(ITermService.class).load(entity, null);
             } else if (EventBase.class.isAssignableFrom(objectClass)){
index 22b08f1..a2287ed 100644 (file)
                label="%command.label.20"
                style="push">
          </command>
-         <separator
-               name="taxeditor-editor.separator1"
-               visible="true">
-         </separator>
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.delete"
                label="%command.label.21"
                label="%command.label.24"
                style="push">
          </command>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.editor.polytomous.list.cdmViewerContextMenu">
+         </dynamic>
          <command
                commandId="eu.etaxonomy.taxeditor.key.polytomous.command.refresh"
                label="%command.label.25"
                label="%command.label.26"
                style="push">
          </command>
+         <separator
+               name="eu.etaxonomy.taxeditor.editor.separator1">
+         </separator>
       </menuContribution>
       <menuContribution
             locationURI="popup:eu.etaxonomy.taxeditor.editor.view.descriptive">
index c86490e..69883cb 100644 (file)
@@ -277,6 +277,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
 
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
+               menuManager.setRemoveAllWhenShown(true);
                control.setMenu(menu);
        }
 
index c01bb7a..e34d01f 100644 (file)
                label="%command.label.15"
                style="push">
          </command>
+         <dynamic
+               class="eu.etaxonomy.taxeditor.view.CdmViewerContextMenu"
+               id="eu.etaxonomy.taxeditor.navigation.polytomous.cdmViewerContextMenu">
+         </dynamic>
          <command
                commandId="eu.etaxonomy.taxeditor.navigation.key.polytomous.editNodes"
                label="%command.label.16"
index e6757a3..6dc2729 100644 (file)
@@ -197,6 +197,7 @@ public class PolytomousKeyViewPart extends ViewPart implements
 
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
+               menuManager.setRemoveAllWhenShown(true);
 
                control.setMenu(menu);
        }