3202d3f180636d5cee8766e155eed9342b1f84d2
[taxeditor.git] / taxeditor-bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / command / BulkEditorPropertyTester.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.bulkeditor.command;
12
13 import org.apache.log4j.Logger;
14 import org.eclipse.core.expressions.PropertyTester;
15 import org.eclipse.ui.IEditorInput;
16
17 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
18 import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
19
20 /**
21 * @author p.ciardelli
22 * @created 21.09.2009
23 * @version 1.0
24 */
25 public class BulkEditorPropertyTester extends PropertyTester {
26 private static final Logger logger = Logger
27 .getLogger(BulkEditorPropertyTester.class);
28
29
30 /* (non-Javadoc)
31 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
32 */
33 public boolean test(Object receiver, String property, Object[] args,
34 Object expectedValue) {
35 BulkEditor bulkEditor = (BulkEditor) receiver;
36 if ("isMergingEnabled".equals(property)) {
37
38 IEditorInput input = bulkEditor.getEditorInput();
39 if (input instanceof NameEditorInput) {
40 return false;
41 } else {
42 return true;
43 }
44 }
45 return false;
46 }
47 }