bugfix for CCE in TermEditor, #2924
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 19 Jun 2012 16:53:55 +0000 (16:53 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 19 Jun 2012 16:53:55 +0000 (16:53 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermBasePropertyTester.java

index 6c9e0f4834458e80b99f3bc47936837a0fad3679..c07f8650f46a90cf4f978b6f3d0a15fe6f5e5773 100644 (file)
@@ -9,18 +9,15 @@
 */\r
 package eu.etaxonomy.taxeditor.editor.definedterm;\r
 \r
-import java.util.HashSet;\r
-import java.util.Set;\r
-\r
 import org.eclipse.core.expressions.PropertyTester;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 \r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.Marker;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
-import eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement;\r
 \r
 /**\r
  * @author l.morris\r
@@ -40,10 +37,13 @@ public class TermBasePropertyTester extends PropertyTester {
                        Object expectedValue) {\r
                \r
                IStructuredSelection selection = (IStructuredSelection) receiver;\r
-               TermBase selectedElement = (TermBase) selection.getFirstElement();\r
-               \r
-               if(IS_MODIFIABLE.equals(property)){\r
-                       return isModifiable(selectedElement);\r
+               CdmBase selectedElement = (CdmBase)selection.getFirstElement();\r
+               if (selectedElement.isInstanceOf(TermBase.class)){\r
+                       TermBase term = CdmBase.deproxy(selectedElement, TermBase.class);\r
+\r
+                       if(IS_MODIFIABLE.equals(property)){\r
+                               return isModifiable(term);\r
+                       }\r
                }\r
                \r
                return false;\r