Revision f41433b9
Added by Alex Theys almost 12 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermBasePropertyTester.java | ||
---|---|---|
9 | 9 |
*/ |
10 | 10 |
package eu.etaxonomy.taxeditor.editor.definedterm; |
11 | 11 |
|
12 |
import java.util.HashSet; |
|
13 |
import java.util.Set; |
|
14 |
|
|
15 | 12 |
import org.eclipse.core.expressions.PropertyTester; |
16 | 13 |
import org.eclipse.jface.viewers.IStructuredSelection; |
17 | 14 |
|
15 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
18 | 16 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
19 | 17 |
import eu.etaxonomy.cdm.model.common.Marker; |
20 | 18 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
21 | 19 |
import eu.etaxonomy.cdm.model.common.TermBase; |
22 | 20 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
23 |
import eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement; |
|
24 | 21 |
|
25 | 22 |
/** |
26 | 23 |
* @author l.morris |
... | ... | |
40 | 37 |
Object expectedValue) { |
41 | 38 |
|
42 | 39 |
IStructuredSelection selection = (IStructuredSelection) receiver; |
43 |
TermBase selectedElement = (TermBase) selection.getFirstElement(); |
|
44 |
|
|
45 |
if(IS_MODIFIABLE.equals(property)){ |
|
46 |
return isModifiable(selectedElement); |
|
40 |
CdmBase selectedElement = (CdmBase)selection.getFirstElement(); |
|
41 |
if (selectedElement != null && selectedElement.isInstanceOf(TermBase.class)){ |
|
42 |
TermBase term = CdmBase.deproxy(selectedElement, TermBase.class); |
|
43 |
|
|
44 |
if(IS_MODIFIABLE.equals(property)){ |
|
45 |
return isModifiable(term); |
|
46 |
} |
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
return false; |
Also available in: Unified diff
AT:Committing changes post merge