4 package eu
.etaxonomy
.taxeditor
.featuretree
;
6 import org
.eclipse
.core
.expressions
.PropertyTester
;
7 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
9 import eu
.etaxonomy
.cdm
.model
.term
.TermTree
;
12 * Property tester used by the feature tree menu.
18 public class FeatureTreePropertyTester
extends PropertyTester
{
20 private static final String FEATURE_TREE
= "isFeatureTree"; //$NON-NLS-1$
23 public boolean test(Object receiver
, String property
, Object
[] args
,
24 Object expectedValue
) {
26 Object
[] selectedElements
= ((IStructuredSelection
) receiver
).toArray();
28 if(selectedElements
.length
== 0){
29 // nothing selected so all tests should fail
33 if(FEATURE_TREE
.equals(property
)){
34 return isFeatureTree(selectedElements
);
41 private boolean isFeatureTree(Object
[] selectedElements
) {
42 for (Object object
: selectedElements
){
43 if(!(object
instanceof TermTree
)){