Project

General

Profile

Download (1.87 KB) Statistics
| Branch: | Tag: | Revision:
1 57e6fef9 n.hoffmann
/**
2
* Copyright (C) 2007 EDIT
3 4db49a38 Alexander Oppermann
* European Distributed Institute of Taxonomy
4 57e6fef9 n.hoffmann
* http://www.e-taxonomy.eu
5 4db49a38 Alexander Oppermann
*
6 57e6fef9 n.hoffmann
* 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 4db49a38 Alexander Oppermann
24 cf9586f2 Alexander Oppermann
    private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled";
25
26 3b975922 Katja Luther
    private static final String SHOW_IO_MENU = "isShowIOMenuEnabled";
27
28 69be3e73 Katja Luther
    private static final String SHOW_SPECIMEN_MENU = "isShowSpecimenMenuEnabled";
29
30 57e6fef9 n.hoffmann
	@Override
31
	public boolean test(Object receiver, String property, Object[] args,
32
			Object expectedValue) {
33
		if(SHOW_EXPERIMENTAL_FEATURES.equals(property)){
34
			return isShowExperimentalFeatures();
35
		}
36 4db49a38 Alexander Oppermann
	    if(SHOW_CHECKLIST_EDITOR.equals(property)){
37
	        return isChecklistEditorEnabled();
38
	    }
39 3b975922 Katja Luther
	    if(SHOW_IO_MENU.equals(property)){
40
            return isShowIOMenuEnabled();
41 69be3e73 Katja Luther
        }
42
	    if(SHOW_SPECIMEN_MENU.equals(property)){
43
            return isShowSpecimenMenuEnabled();
44 3b975922 Katja Luther
        }
45 57e6fef9 n.hoffmann
		return false;
46
	}
47
48
	/**
49
	 * @return
50
	 */
51
	private boolean isShowExperimentalFeatures() {
52 69e82edd Katja Luther
		return PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_EXPERIMENTAL_FEATURES);
53 57e6fef9 n.hoffmann
	}
54 4db49a38 Alexander Oppermann
55
	private boolean isChecklistEditorEnabled() {
56 69e82edd Katja Luther
        return PreferencesUtil.getBooleanValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE);
57 4db49a38 Alexander Oppermann
    }
58 3b975922 Katja Luther
	private boolean isShowIOMenuEnabled() {
59 69e82edd Katja Luther
        return PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_IO_MENU);
60 3b975922 Katja Luther
    }
61 cf9586f2 Alexander Oppermann
62 69be3e73 Katja Luther
	private boolean isShowSpecimenMenuEnabled() {
63 69e82edd Katja Luther
        return PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SPECIMEN);
64 69be3e73 Katja Luther
    }
65
66 57e6fef9 n.hoffmann
}