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