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 CdmStorePropertyTester
extends PropertyTester
{
24 private static final String EDITOR_IS_CONNECTED_TO_DB
= "isCdmStoreConnected";
25 private static final String IS_REMOTING
= "isRemoting";
26 private static final String IS_STANDALONE
= "isStandAlone";
29 public boolean test(Object receiver
, String property
, Object
[] args
,
30 Object expectedValue
) {
32 if(EDITOR_IS_CONNECTED_TO_DB
.equals(property
)){
33 return isCdmStoreConnected();
36 if(IS_REMOTING
.equals(property
)){
37 if(!isCdmStoreConnected()) {
44 if(IS_STANDALONE
.equals(property
)){
45 if(!isCdmStoreConnected()) {
54 private boolean isCdmStoreConnected(){
55 boolean active
= CdmStore
.isActive();
59 private boolean isRemoting() {
60 return CdmStore
.getCurrentSessionManager().isRemoting();