// $Id$
/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
package eu.etaxonomy.taxeditor.preference;
*/
public class CdmStorePropertyTester extends PropertyTester {
- private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
+ private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected";
+ private static final String IS_REMOTING = "isRemoting";
+ private static final String IS_STANDALONE = "isStandAlone";
+
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+
+ if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
+ return isCdmStoreConnected();
+ }
+
+ if(IS_REMOTING.equals(property)){
+ if(!isCdmStoreConnected()) {
+ return false;
+ } else {
+ return isRemoting();
+ }
+ }
+
+ if(IS_STANDALONE.equals(property)){
+ if(!isCdmStoreConnected()) {
+ return false;
+ } else {
+ return !isRemoting();
+ }
+ }
+ return false;
+ }
+
+ private boolean isCdmStoreConnected(){
+ boolean active = CdmStore.isActive();
+ return active;
+ }
+
+ private boolean isRemoting() {
+ return CdmStore.getCurrentSessionManager().isRemoting();
- @Override
- public boolean test(Object receiver, String property, Object[] args,
- Object expectedValue) {
+ }
- if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){
- return isCdmStoreConnected();
- }
- return false;
- }
- private boolean isCdmStoreConnected(){
- boolean active = CdmStore.isActive();
- return active;
- }
}