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
;
14 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
18 * @created Jan 26, 2011
21 public class CdmStorePropertyTester
extends PropertyTester
{
23 private static final String EDITOR_IS_CONNECTED_TO_DB
= "isCdmStoreConnected";
24 private static final String IS_REMOTING
= "isRemoting";
25 private static final String IS_STANDALONE
= "isStandAlone";
28 public boolean test(Object receiver
, String property
, Object
[] args
,
29 Object expectedValue
) {
31 if(EDITOR_IS_CONNECTED_TO_DB
.equals(property
)){
32 return isCdmStoreConnected();
35 if(IS_REMOTING
.equals(property
)){
36 if(!isCdmStoreConnected()) {
43 if(IS_STANDALONE
.equals(property
)){
44 if(!isCdmStoreConnected()) {
53 private boolean isCdmStoreConnected(){
54 boolean active
= CdmStore
.isActive();
58 private boolean isRemoting() {
59 return CdmStore
.getCurrentSessionManager().isRemoting();