commit dd7f77fb2ba204324c67b15e3c35161b67b9ea6f
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon Oct 5 11:29:19 2015 +0200

    Disable menu items when not connected to CDM store (#4901)

diff --git a/eu.etaxonomy.taxeditor.application/plugin.xml b/eu.etaxonomy.taxeditor.application/plugin.xml
index 40453cf2d..7453e2147 100644
--- a/eu.etaxonomy.taxeditor.application/plugin.xml
+++ b/eu.etaxonomy.taxeditor.application/plugin.xml
@@ -152,11 +152,23 @@
                commandId="org.eclipse.ui.file.import"
                label="%command.label.3"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.file.export"
                label="%command.label.4"
                style="push">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <separator
                name="eu.etaxonomy.taxeditor.application.filemenu.io"
diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml
index 8891d1df9..e227ad702 100644
--- a/eu.etaxonomy.taxeditor.editor/plugin.xml
+++ b/eu.etaxonomy.taxeditor.editor/plugin.xml
@@ -321,6 +321,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.descriptive">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
@@ -330,6 +336,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.media">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
@@ -339,6 +351,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.concept">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
@@ -349,10 +367,15 @@
                   value="eu.etaxonomy.taxeditor.editor.view.concept.graph">
             </parameter>
             <visibleWhen
-                  checkEnabled="false">
-               <reference
-                     definitionId="isShowExperimentalFeatures">
-               </reference>
+                  checkEnabled="true">
+               <and>
+                  <reference
+                        definitionId="isShowExperimentalFeatures">
+                  </reference>
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </and>
             </visibleWhen>
          </command>
       </menuContribution>
@@ -1026,6 +1049,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.editor.view.validation.problems">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
       </menuContribution>
    </extension>
diff --git a/eu.etaxonomy.taxeditor.navigation/plugin.xml b/eu.etaxonomy.taxeditor.navigation/plugin.xml
index 20ce35a52..9767c38e9 100644
--- a/eu.etaxonomy.taxeditor.navigation/plugin.xml
+++ b/eu.etaxonomy.taxeditor.navigation/plugin.xml
@@ -47,6 +47,12 @@
          <dynamic
                class="eu.etaxonomy.taxeditor.navigation.RecentNamesContributionItem"
                id="eu.etaxonomy.taxeditor.navigation.recentnames">
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </dynamic>
       </menuContribution>
       <menuContribution
@@ -59,6 +65,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.navigator">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
          <command
                commandId="org.eclipse.ui.views.showView"
@@ -68,6 +80,12 @@
                   name="org.eclipse.ui.views.showView.viewId"
                   value="eu.etaxonomy.taxeditor.navigation.key.polytomous.polytomousKeyViewPart">
             </parameter>
+            <visibleWhen
+                  checkEnabled="true">
+               <reference
+                     definitionId="isCdmStoreConnected">
+               </reference>
+            </visibleWhen>
          </command>
       </menuContribution>
       <menuContribution
diff --git a/eu.etaxonomy.taxeditor.store/plugin.xml b/eu.etaxonomy.taxeditor.store/plugin.xml
index fb44e4eda..a09f26a7c 100644
--- a/eu.etaxonomy.taxeditor.store/plugin.xml
+++ b/eu.etaxonomy.taxeditor.store/plugin.xml
@@ -303,6 +303,12 @@
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.derivateSearch.DerivateSearchView">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
             <separator
                   name="eu.etaxonomy.taxeditor.store.showViewMenu.details"
@@ -316,6 +322,12 @@
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.detail">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
             <command
                   commandId="org.eclipse.ui.views.showView"
@@ -326,6 +338,12 @@
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.supplementalData">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
             <!-- Originally used by validation framework, currently not in use -->
 	<!--        <command
@@ -370,9 +388,14 @@
                </parameter>
                <visibleWhen
                      checkEnabled="true">
-                  <reference
-                        definitionId="isShowExperimentalFeatures">
-                  </reference>
+                  <and>
+                     <reference
+                           definitionId="isShowExperimentalFeatures">
+                     </reference>
+                     <reference
+                           definitionId="isCdmStoreConnected">
+                     </reference>
+                  </and>
                </visibleWhen>
             </command>
             <command
@@ -383,6 +406,12 @@
                      name="org.eclipse.ui.views.showView.viewId"
                      value="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart">
                </parameter>
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isCdmStoreConnected">
+                  </reference>
+               </visibleWhen>
             </command>
          </menu>
       </menuContribution>
