3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.preference
;
13 import org
.eclipse
.core
.expressions
.PropertyTester
;
15 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
19 * @created Jan 26, 2011
22 public class PreferencePropertyTester
extends PropertyTester
{
25 private static final String SHOW_EXPERIMENTAL_FEATURES
= "isShowExperimentalFeatures";
27 private static final String SHOW_CHECKLIST_EDITOR
= "isChecklistEditorEnabled";
29 private static final String EDITOR_IS_CONNECTED_TO_DB
= "isCdmStoreConnected";
32 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
35 public boolean test(Object receiver
, String property
, Object
[] args
,
36 Object expectedValue
) {
38 if(SHOW_EXPERIMENTAL_FEATURES
.equals(property
)){
39 return isShowExperimentalFeatures();
41 if(SHOW_CHECKLIST_EDITOR
.equals(property
)){
42 return isChecklistEditorEnabled();
44 if(EDITOR_IS_CONNECTED_TO_DB
.equals(property
)){
45 return isCdmStoreConnected();
54 private boolean isShowExperimentalFeatures() {
55 return PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.SHOW_EXPERIMENTAL_FEATURES
);
58 private boolean isChecklistEditorEnabled() {
59 return PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DISTRIBUTION_AREA_PREFRENCES_ACTIVE
);
62 private boolean isCdmStoreConnected(){
63 boolean active
= CdmStore
.isActive();