(no commit message)
authorKatja Luther <k.luther@bgbm.org>
Wed, 28 May 2014 09:27:35 +0000 (09:27 +0000)
committerKatja Luther <k.luther@bgbm.org>
Wed, 28 May 2014 09:27:35 +0000 (09:27 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java

index 7c59ac5871bfba47eea27db5162f4a0b6a7145a7..acc7a08c9927192df6e8c6d5f057af4e6fb3dbb7 100644 (file)
@@ -16,9 +16,12 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 
 import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
+import eu.etaxonomy.taxeditor.ui.section.description.DerivedUnitElement;
 
 /**
  * <p>BulkEditorPropertyTester class.</p>
@@ -32,6 +35,7 @@ public class BulkEditorPropertyTester extends PropertyTester {
                        .getLogger(BulkEditorPropertyTester.class);
 
        private static final String GROUP = "isGroup";
+       private static final String DERIVEDUNIT = "isDerivedUnit";
        /* (non-Javadoc)
         * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
         */
@@ -49,6 +53,11 @@ public class BulkEditorPropertyTester extends PropertyTester {
                if(GROUP.equals(property)){
                        return isGroup(bulkEditor);
                }
+               
+               if (DERIVEDUNIT.equals(property)){
+                       
+                       return isDerivedUnit(bulkEditor);
+               }
 //             if (("isPublishFlagEditingEnabled").equals(property)) {
 //                     IEditorInput input = bulkEditor.getEditorInput();
 //                     if (input instanceof NameEditorInput) {
@@ -58,6 +67,11 @@ public class BulkEditorPropertyTester extends PropertyTester {
                return false;
        }
        
+       private boolean isDerivedUnit(BulkEditor bulkEditor) {
+               IEditorInput input = bulkEditor.getEditorInput();
+               return (input instanceof OccurrenceEditorInput) ? true : false;
+       }
+
        private boolean isGroup(BulkEditor bulkEditor) {
                IEditorInput input = bulkEditor.getEditorInput();
                return (input instanceof GroupEditorInput) ? true : false;