Revision d02e900a
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CdmStorePropertyTester.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.preference; |
11 | 10 |
|
12 | 11 |
import org.eclipse.core.expressions.PropertyTester; |
... | ... | |
16 | 15 |
/** |
17 | 16 |
* @author n.hoffmann |
18 | 17 |
* @created Jan 26, 2011 |
19 |
* @version 1.0 |
|
20 | 18 |
*/ |
21 | 19 |
public class CdmStorePropertyTester extends PropertyTester { |
22 | 20 |
|
23 | 21 |
private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected"; |
24 | 22 |
private static final String IS_REMOTING = "isRemoting"; |
25 |
private static final String IS_STANDALONE = "isStandAlone"; |
|
26 | 23 |
private static final String IS_CONNECTED_AND_NOT_LOCAL_ACTIVATED = "isCdmStoreConnectedAndNotLocalActivated"; |
27 | 24 |
private static final String IS_CONNECTED_AND_LOCAL_ACTIVATED = "isCdmStoreConnectedAndLocalActive"; |
28 | 25 |
|
... | ... | |
38 | 35 |
if(!isCdmStoreConnected()) { |
39 | 36 |
return false; |
40 | 37 |
} else { |
41 |
return isRemoting();
|
|
38 |
return true;
|
|
42 | 39 |
} |
43 | 40 |
} |
44 | 41 |
|
45 |
if(IS_STANDALONE.equals(property)){ |
|
46 |
if(!isCdmStoreConnected()) { |
|
47 |
return false; |
|
48 |
} else { |
|
49 |
return !isRemoting(); |
|
50 |
} |
|
51 |
} |
|
52 | 42 |
if(IS_CONNECTED_AND_NOT_LOCAL_ACTIVATED.equals(property)){ |
53 | 43 |
return isCdmStoreConnectedAndNotLocalActive(); |
54 | 44 |
} |
... | ... | |
73 | 63 |
active = active & PreferencesUtil.getLocalActive(); |
74 | 64 |
return active; |
75 | 65 |
} |
76 |
|
|
77 |
private boolean isRemoting() { |
|
78 |
return CdmStore.getCurrentSessionManager().isRemoting(); |
|
79 |
} |
|
80 | 66 |
} |
Also available in: Unified diff
force usage of remoting everywhere