Added a bunch of functionality that will be needed when opening the editor with an...
[taxeditor.git] / taxeditor-navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / TaxonNodePropertyTester.java
1 /**
2 *
3 */
4 package eu.etaxonomy.taxeditor.navigation.navigator;
5
6 import org.eclipse.core.expressions.PropertyTester;
7
8 import eu.etaxonomy.cdm.model.taxon.Taxon;
9 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
10
11 public class TaxonNodePropertyTester extends PropertyTester {
12
13 private static final Object HAS_SYNONYMS = "hasSynonyms";
14
15 public boolean test(Object receiver, String property, Object[] args,
16 Object expectedValue) {
17 if (receiver instanceof TaxonNode && HAS_SYNONYMS.equals(property)) {
18 Taxon taxon = ((TaxonNode) receiver).getTaxon();
19 return taxon.hasSynonyms();
20 }
21
22 return false;
23 }
24 }