name="%command.name.4">
</command>
<command
+ defaultHandler="eu.etaxonomy.taxeditor.navigation.navigator.handler.ChangeAcceptedTaxonToSynonymHandler"
id="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym"
name="%command.name.5">
</command>
class="eu.etaxonomy.taxeditor.navigation.navigator.handler.ChangeAcceptedTaxonToSynonymHandler"
commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym">
<activeWhen>
- <test
- property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isRemoting">
- </test>
+ <reference
+ definitionId="isStandAlone">
+ </reference>
+ </activeWhen>
+ </handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.navigation.navigator.handler.RemotingChangeAcceptedTaxonToSynonymHandler"
+ commandId="eu.etaxonomy.taxeditor.navigator.command.update.changeAcceptedToSynonym">
+ <activeWhen>
+ <reference
+ definitionId="isRemoting">
+ </reference>
</activeWhen>
</handler>
</extension>
class="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
id="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
namespace="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester"
- properties="isCdmStoreConnected"
+ properties="isCdmStoreConnected,isRemoting,isStandAlone"
type="java.lang.Object">
</propertyTester>
</extension>
</test>
</with>
</definition>
+ <definition
+ id="isRemoting">
+ <test
+ property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isRemoting">
+ </test>
+ </definition>
+ <definition
+ id="isStandAlone">
+ <test
+ property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isStandAlone">
+ </test>
+ </definition>
</extension>
<extension
point="eu.etaxonomy.taxeditor.store.cdmViewer">
public IStatus allowOperations(ExecutionEvent event) {
TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
// check that only a single taxon has been selected
- if(selection.size() > 0) {
+ if(selection.size() > 1) {
return new Status(IStatus.ERROR,
"unknown",
SINGLE_TAXON_SELECTION_MESSAGE);
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,
}
if(IS_REMOTING.equals(property)){
- return isRemoting();
+ if(!isCdmStoreConnected()) {
+ return false;
+ } else {
+ return isRemoting();
+ }
+ }
+
+ if(IS_STANDALONE.equals(property)){
+ if(!isCdmStoreConnected()) {
+ return false;
+ } else {
+ return !isRemoting();
+ }
}
return false;
}
private boolean isRemoting() {
return CdmStore.getCurrentSessionManager().isRemoting();
+
}