name="%command.name.OPEN_BULK_EDITOR_FOR_TAXON_NODE">
</command>
<command
- defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntity"
id="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity"
name="Open bulk editor for identifiable entity">
<commandParameter
</test>
</with>
</definition>
+ <definition
+ id="isBulkEditorSupported">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorSelectionPropertyTester.isBulkEditorSupported">
+ </test>
+ </with>
+ </definition>
+ <definition
+ id="isGroupEditor">
+ <with
+ variable="activeEditor">
+ <test
+ property="taxeditor-bulkeditor.propertyTester.isGroupEditor">
+ </test>
+ </with>
+ </definition>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
properties="isTeam, isPerson"
type="java.lang.Object">
</propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorSelectionPropertyTester"
+ id="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorSelectionPropertyTester"
+ namespace="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorSelectionPropertyTester"
+ properties="isBulkEditorSupported"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.ui.handlers">
class="eu.etaxonomy.taxeditor.bulkeditor.handler.ConvertPerson2TeamHandler"
commandId="eu.etaxonomy.taxeditor.bulkeditor.convertPerson2Team">
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler.OpenBulkEditorForIdentifiableEntity"
+ commandId="eu.etaxonomy.taxeditor.bulkeditor.openBulkEditorForIdentifiableEntity">
+ <activeWhen>
+ <reference
+ definitionId="isBulkEditorSupported">
+ </reference>
+ </activeWhen>
+ </handler>
</extension>
<extension
--- /dev/null
+package eu.etaxonomy.taxeditor.bulkeditor.command;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
+
+public class BulkEditorSelectionPropertyTester extends PropertyTester {
+
+ public static final String IS_BULK_EDITOR_SUPPORTED = "isBulkEditorSupported";
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ if(IS_BULK_EDITOR_SUPPORTED.equals(property)){
+ if(receiver instanceof IStructuredSelection){
+ IStructuredSelection selection = (IStructuredSelection) receiver;
+ Object selectedElement = selection.getFirstElement();
+ if(selectedElement!=null){
+ return BulkEditorInputType.getByType(selectedElement.getClass())!=null;
+ }
+ }
+ }
+ return false;
+ }
+
+}
</test>
</with>
</definition>
- <definition
- id="isGroupEditor">
- <with
- variable="activeEditor">
- <test
- property="taxeditor-bulkeditor.propertyTester.isGroupEditor">
- </test>
- </with>
- </definition>
<definition
id="isIndividualsAssociation">
<with
properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor, isIndividualsAssociation"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
- <propertyTester
- class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"
- id="taxeditor-bulkeditor.PropertyTester"
- namespace="taxeditor-bulkeditor.propertyTester"
- properties="isGroupEditor"
- type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
- </propertyTester>
<propertyTester
class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"