Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
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.AbstractBulkEditorInput; |
|
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 |
/* (non-Javadoc) |
|
30 |
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) |
|
31 |
*/ |
|
32 |
public boolean test(Object receiver, String property, Object[] args, |
|
33 |
Object expectedValue) { |
|
34 |
BulkEditor bulkEditor = (BulkEditor) receiver; |
|
35 |
if ("isMergingEnabled".equals(property)) { |
|
36 |
IEditorInput input = bulkEditor.getEditorInput(); |
|
37 |
if (input instanceof AbstractBulkEditorInput) { |
|
38 |
return ((AbstractBulkEditorInput) input).isMergingEnabled(); |
|
39 |
} |
|
40 |
} |
|
41 |
// if (("isPublishFlagEditingEnabled").equals(property)) { |
|
42 |
// IEditorInput input = bulkEditor.getEditorInput(); |
|
43 |
// if (input instanceof NameEditorInput) { |
|
44 |
// return ((NameEditorInput) input).isPublishFlagEnabled(); |
|
45 |
// } |
|
46 |
// } |
|
47 |
return false; |
|
48 |
} |
|
49 |
} |
|
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.AbstractBulkEditorInput; |
|
19 |
|
|
20 |
/** |
|
21 |
* <p>BulkEditorPropertyTester class.</p> |
|
22 |
* |
|
23 |
* @author p.ciardelli |
|
24 |
* @created 21.09.2009 |
|
25 |
* @version 1.0 |
|
26 |
*/ |
|
27 |
public class BulkEditorPropertyTester extends PropertyTester { |
|
28 |
private static final Logger logger = Logger |
|
29 |
.getLogger(BulkEditorPropertyTester.class); |
|
30 |
|
|
31 |
/* (non-Javadoc) |
|
32 |
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) |
|
33 |
*/ |
|
34 |
/** {@inheritDoc} */ |
|
35 |
public boolean test(Object receiver, String property, Object[] args, |
|
36 |
Object expectedValue) { |
|
37 |
BulkEditor bulkEditor = (BulkEditor) receiver; |
|
38 |
if ("isMergingEnabled".equals(property)) { |
|
39 |
IEditorInput input = bulkEditor.getEditorInput(); |
|
40 |
if (input instanceof AbstractBulkEditorInput) { |
|
41 |
return ((AbstractBulkEditorInput) input).isMergingEnabled(); |
|
42 |
} |
|
43 |
} |
|
44 |
// if (("isPublishFlagEditingEnabled").equals(property)) { |
|
45 |
// IEditorInput input = bulkEditor.getEditorInput(); |
|
46 |
// if (input instanceof NameEditorInput) { |
|
47 |
// return ((NameEditorInput) input).isPublishFlagEnabled(); |
|
48 |
// } |
|
49 |
// } |
|
50 |
return false; |
|
51 |
} |
|
52 |
} |
Also available in: Unified diff
performed javacscript:fix and worked on documentation