2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.preference
;
12 import org
.eclipse
.core
.expressions
.PropertyTester
;
16 * @created Jan 26, 2011
19 public class PreferencePropertyTester
extends PropertyTester
{
22 private static final String SHOW_EXPERIMENTAL_FEATURES
= "isShowExperimentalFeatures";
24 private static final String SHOW_CHECKLIST_EDITOR
= "isChecklistEditorEnabled";
26 private static final String SHOW_IO_MENU
= "isShowIOMenuEnabled";
28 private static final String SHOW_SPECIMEN_MENU
= "isShowSpecimenMenuEnabled";
31 public boolean test(Object receiver
, String property
, Object
[] args
,
32 Object expectedValue
) {
33 if(SHOW_EXPERIMENTAL_FEATURES
.equals(property
)){
34 return isShowExperimentalFeatures();
36 if(SHOW_CHECKLIST_EDITOR
.equals(property
)){
37 return isChecklistEditorEnabled();
39 if(SHOW_IO_MENU
.equals(property
)){
40 boolean test
= isShowIOMenuEnabled();
41 return isShowIOMenuEnabled();
43 if(SHOW_SPECIMEN_MENU
.equals(property
)){
44 return isShowSpecimenMenuEnabled();
52 private boolean isShowExperimentalFeatures() {
53 return PreferencesUtil
.getBooleanValue(IPreferenceKeys
.SHOW_EXPERIMENTAL_FEATURES
);
56 private boolean isChecklistEditorEnabled() {
57 return PreferencesUtil
.getBooleanValue(EditorPreferencePredicate
.DistributionEditorActivated
.getKey());
59 private boolean isShowIOMenuEnabled() {
60 return PreferencesUtil
.getBooleanValue(EditorPreferencePredicate
.ShowImportExportMenu
.getKey());
63 private boolean isShowSpecimenMenuEnabled() {
64 return PreferencesUtil
.getBooleanValue(EditorPreferencePredicate
.ShowSpecimen
.getKey());