From: Alexander Oppermann Date: Mon, 15 Dec 2014 13:17:55 +0000 (+0000) Subject: added a new propertytester to check if the editor is connected to database X-Git-Tag: 3.6.0~278 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/cf9586f26192a0792a951842523b3df2c337893b added a new propertytester to check if the editor is connected to database hide popupmenu in taxon navigator view if not connected to database --- diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml index 23f66c05e..0489ab4f0 100644 --- a/eu.etaxonomy.taxeditor.editor/plugin.xml +++ b/eu.etaxonomy.taxeditor.editor/plugin.xml @@ -840,6 +840,12 @@ commandId="eu.etaxonomy.taxeditor.editor.handler.openDerivateView" label="Open Associated Derivates" style="push"> + + + + + + + + - - + + + + + + + + + + + + + + - - + + + definitionId="isCdmStoreConnected"> - + + + + + + + + + + + + + + + @@ -649,5 +697,14 @@ + + + + + + diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java index 8a00f1ff7..62c31c919 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencePropertyTester.java @@ -12,6 +12,8 @@ package eu.etaxonomy.taxeditor.preference; import org.eclipse.core.expressions.PropertyTester; +import eu.etaxonomy.taxeditor.store.CdmStore; + /** * @author n.hoffmann * @created Jan 26, 2011 @@ -22,7 +24,9 @@ public class PreferencePropertyTester extends PropertyTester { private static final String SHOW_EXPERIMENTAL_FEATURES = "isShowExperimentalFeatures"; - private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled"; + private static final String SHOW_CHECKLIST_EDITOR = "isChecklistEditorEnabled"; + + private static final String EDITOR_IS_CONNECTED_TO_DB = "isCdmStoreConnected"; /* (non-Javadoc) * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) @@ -37,6 +41,9 @@ public class PreferencePropertyTester extends PropertyTester { if(SHOW_CHECKLIST_EDITOR.equals(property)){ return isChecklistEditorEnabled(); } + if(EDITOR_IS_CONNECTED_TO_DB.equals(property)){ + return isCdmStoreConnected(); + } return false; } @@ -51,4 +58,9 @@ public class PreferencePropertyTester extends PropertyTester { private boolean isChecklistEditorEnabled() { return PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE); } + + private boolean isCdmStoreConnected(){ + boolean active = CdmStore.isActive(); + return active; + } }