Project

General

Profile

Download (1.31 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
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.
8
*/
9

    
10
package eu.etaxonomy.taxeditor.preference;
11

    
12
import org.eclipse.core.expressions.PropertyTester;
13

    
14
/**
15
 * @author n.hoffmann
16
 * @created Jan 26, 2011
17
 * @version 1.0
18
 */
19
public class PreferencePropertyTester extends PropertyTester {
20

    
21

    
22
	private static final String SHOW_EXPERIMENTAL_FEATURES = "isShowExperimentalFeatures";
23

    
24
    private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled";
25

    
26
	@Override
27
	public boolean test(Object receiver, String property, Object[] args,
28
			Object expectedValue) {
29
		if(SHOW_EXPERIMENTAL_FEATURES.equals(property)){
30
			return isShowExperimentalFeatures();
31
		}
32
	    if(SHOW_CHECKLIST_EDITOR.equals(property)){
33
	        return isChecklistEditorEnabled();
34
	    }
35
		return false;
36
	}
37

    
38
	/**
39
	 * @return
40
	 */
41
	private boolean isShowExperimentalFeatures() {
42
		return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES);
43
	}
44

    
45
	private boolean isChecklistEditorEnabled() {
46
        return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
47
    }
48

    
49
}
(20-20/27)