commandId="taxeditor-editor.newimage"
label="New Image"
style="push">
+ <visibleWhen>
+ <reference
+ definitionId="isImageGallery">
+ </reference>
+ </visibleWhen>
</command>
<command
commandId="taxeditor-editor.command.moveimgdown"
</test>
</with>
</definition>
+ <definition
+ id="isImageGallery">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isImageGallery">
+ </test>
+ </with>
+ </definition>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
- properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer"
+ properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
</extension>
private static final String DESCRIPTION = "isDescription";
private static final String DESCRIPTION_ELEMENT = "isDescriptionElement";
private static final String DELETABLE = "isDeletable";
+ private static final String IMAGE_GALLERY = "isImageGallery";
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
else if(DELETABLE.equals(property)){
return isDeletable(selectedElements);
}
+ else if(IMAGE_GALLERY.equals(property)){
+ return isImageGallery(selectedElements);
+ }
else{
return false;
}
}
+ private boolean isImageGallery(Object[] selectedElements) {
+ for (Object object : selectedElements){
+ if(!(object instanceof DescriptionBase) || !((DescriptionBase) object).isImageGallery()){
+ return false;
+ }
+ }
+ return true;
+ }
+
private boolean isFeatureNodeContainer(Object[] selectedElements) {
for (Object object : selectedElements){
if(!(object instanceof FeatureNodeContainer)){