2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.bulkeditor
.command
;
11 import org
.eclipse
.core
.expressions
.PropertyTester
;
12 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
14 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
15 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
22 public class BulkEditorMenuPropertyTester
extends PropertyTester
{
25 private static final String IS_TEAM
= "isTeam";
26 private static final String IS_PERSON
= "isPerson";
28 public BulkEditorMenuPropertyTester(){
34 public boolean test(Object receiver
, String property
, Object
[] args
,
35 Object expectedValue
) {
36 if(receiver
instanceof IStructuredSelection
){
37 IStructuredSelection selection
= (IStructuredSelection
) receiver
;
38 Object selectedElement
= selection
.getFirstElement();
39 if (property
.equals(IS_PERSON
) && selectedElement
instanceof Person
){
42 if (property
.equals(IS_TEAM
) && selectedElement
instanceof Team
){