Commit a4853958 authored by Adrien's avatar Adrien Committed by Romain Bioteau
Browse files

fix(project explorer) compute active handler / visible menu when (#1426)

parent 43a9d059
......@@ -110,7 +110,9 @@
mnemonic="O"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -126,6 +128,7 @@
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -137,7 +140,9 @@
label="%newFilterDefMenu"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -149,9 +154,11 @@
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test></iterate>
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -159,7 +166,9 @@
label="%newFilterImplMenu"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -175,6 +184,7 @@
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -378,6 +388,8 @@
class="org.bonitasoft.studio.actors.ui.handler.ImportOrganizationHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -388,12 +400,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportOrganizationHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -405,15 +420,19 @@
</test>
<test
property="org.bonitasoft.studio.organization.isOrganizationFile">
</test></or>
</test>
</or>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ManageOrganizationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -424,12 +443,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterDefinitionHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -440,12 +462,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterImplementationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -456,12 +481,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ImportActorFilterHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -472,12 +500,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -488,12 +519,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportSingleActorFilterHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -504,12 +538,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterFromDefinitionHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -520,6 +557,7 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
</extension>
......
......@@ -443,7 +443,9 @@
commandId="org.eclipse.ui.file.refresh"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -456,6 +458,7 @@
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -478,19 +481,20 @@
commandId="org.bonitasoft.studio.renameCommand"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<test
property="org.bonitasoft.studio.application.renamablePropertyTester.isRenamable">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
<separator
......@@ -513,19 +517,20 @@
label="%deploy"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<test
property="org.bonitasoft.studio.application.deployablePropertyTester.isDeployable">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -843,18 +848,19 @@
class="org.bonitasoft.studio.application.handler.RefreshProjectHandler"
commandId="org.eclipse.ui.file.refresh">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IResource">
</instanceof>
</iterate>
</or>
</and>
</with>
</activeWhen>
</handler>
<handler
......
......@@ -53,12 +53,14 @@
label="%defineBDMMenu"
mnemonic="B"
style="push">
<visibleWhen>
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -70,8 +72,8 @@
property="org.bonitasoft.studio.businessobject.bdmExists">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -82,7 +84,10 @@
commandId="org.bonitasoft.studio.businessobject.openH2Console"
mnemonic="h"
style="push">
<visibleWhen>
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -93,6 +98,7 @@
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -155,6 +161,8 @@
class="org.bonitasoft.studio.businessobject.ui.handler.ImportBusinessDataModelHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -173,12 +181,15 @@
</reference>
</or>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.businessobject.ui.handler.ExportBusinessDataModelHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -189,6 +200,7 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
</extension>
......
......@@ -195,12 +195,13 @@
label="%newConnectorDefMenu"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -209,8 +210,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -218,12 +219,13 @@
label="%newConnectorImplementationMenu"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -232,8 +234,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -307,6 +309,8 @@
class="org.bonitasoft.studio.connectors.handler.NewConnectorDefinitionHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -317,12 +321,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.NewConnectorImplementationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -333,12 +340,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.ImportConnectorHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -349,12 +359,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.ExportConnectorHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -365,12 +378,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.ExportSingleConnectorHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -381,12 +397,15 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.ExportConnectorFromDefinitionHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -397,6 +416,7 @@
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
</extension>
......
......@@ -59,7 +59,9 @@
id="org.bonitasoft.studio.dependencies.manageDependencies.menu"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -75,6 +77,7 @@
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......
......@@ -19,12 +19,13 @@
label="%newApplicationPage"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -33,8 +34,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -42,12 +43,13 @@
label="%newLayout"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -56,8 +58,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -65,12 +67,13 @@
label="%newCustomWidget"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -79,8 +82,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -92,7 +95,9 @@
label="%newApplicationPage"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
......@@ -103,6 +108,7 @@
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -110,7 +116,9 @@
label="%newLayout"
style="push">
<visibleWhen
checkEnabled="true">
checkEnabled="false">