Commit 9280c78f authored by Adrien's avatar Adrien Committed by Romain Bioteau

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

parent 28b95fe2
......@@ -443,19 +443,22 @@
commandId="org.eclipse.ui.file.refresh"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</iterate>
</or>
</and>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -478,19 +481,20 @@
commandId="org.bonitasoft.studio.renameCommand"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.application.renamablePropertyTester.isRenamable">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
<separator
......@@ -513,19 +517,20 @@
label="%deploy"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
<test
property="org.bonitasoft.studio.application.deployablePropertyTester.isDeployable">
</test>
</iterate>
</or>
</and>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.application.deployablePropertyTester.isDeployable">
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -843,18 +848,19 @@
class="org.bonitasoft.studio.application.handler.RefreshProjectHandler"
commandId="org.eclipse.ui.file.refresh">
<activeWhen>
<and>
<count
value="1">
</count>
<or>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IResource">
</instanceof>
</iterate>
</or>
</and>
</and>
</with>
</activeWhen>
</handler>
<handler
......
......@@ -53,12 +53,14 @@
label="%defineBDMMenu"
mnemonic="B"
style="push">
<visibleWhen>
<and>
<count
value="1">
</count>
<or>
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
......@@ -70,8 +72,8 @@
property="org.bonitasoft.studio.businessobject.bdmExists">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -82,8 +84,11 @@
commandId="org.bonitasoft.studio.businessobject.openH2Console"
mnemonic="h"
style="push">
<visibleWhen>
<and>
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
......@@ -93,6 +98,7 @@
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -155,30 +161,35 @@
class="org.bonitasoft.studio.businessobject.ui.handler.ImportBusinessDataModelHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.businessobject.isBDMFolder">
</test>
</iterate>
<or>
<reference
definitionId="isABonitaProduct">
</reference>
<reference
definitionId="isTeamwork">
</reference>
</or>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.businessobject.isBDMFolder">
</test>
</iterate>
<or>
<reference
definitionId="isABonitaProduct">
</reference>
<reference
definitionId="isTeamwork">
</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,22 +195,23 @@
label="%newConnectorDefMenu"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -218,22 +219,23 @@
label="%newConnectorImplementationMenu"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -307,38 +309,46 @@
class="org.bonitasoft.studio.connectors.handler.NewConnectorDefinitionHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.connectors.isConnectorDefFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.connectors.isConnectorDefFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.connectors.handler.NewConnectorImplementationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.connectors.isConnectorImplFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.connectors.isConnectorImplFolder">
</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,22 +59,25 @@
id="org.bonitasoft.studio.dependencies.manageDependencies.menu"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<or>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<test
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......
......@@ -19,13 +19,14 @@
label="%newApplicationPage"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
......@@ -33,8 +34,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -42,13 +43,14 @@
label="%newLayout"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
......@@ -56,8 +58,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -65,13 +67,14 @@
label="%newCustomWidget"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
......@@ -79,8 +82,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -92,17 +95,20 @@
label="%newApplicationPage"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebPageFolder">
</test>
</iterate>
</and>
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebPageFolder">
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
<command
......@@ -110,17 +116,20 @@
label="%newLayout"
style="push">
<visibleWhen
checkEnabled="true">
<and>
<count
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebPageFolder">
</test>
</iterate>
</and>
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebPageFolder">
</test>
</iterate>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -250,16 +259,19 @@
class="org.bonitasoft.studio.designer.ui.handler.CreateCustomWidgetHandler"
commandId="org.bonitasoft.studio.application.new">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebWidgetFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.designer.isWebWidgetFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
</extension>
......
......@@ -363,13 +363,14 @@
mnemonic="D"
id="org.bonitasoft.studio.diagram.command.newDiagram.popup.menu">
<visibleWhen
checkEnabled="true">
<and>
<count
value="1">
</count>
<or>
<iterate>
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
......@@ -377,8 +378,8 @@
property="org.bonitasoft.studio.application.isBonitaProject">
</test>
</iterate>
</or>
</and>
</and>
</with>
</visibleWhen>
</command>
</menuContribution>
......@@ -393,17 +394,21 @@
class="org.bonitasoft.studio.diagram.custom.contributionItem.RunProcessContributionItem"
id="org.bonitasoft.studio.diagram.custom.runContributionItem">
</dynamic>
<visibleWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.diagram.isDiagramFile">
</test>
</iterate>
</and>
<visibleWhen
checkEnabled="false">
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.diagram.isDiagramFile">
</test>
</iterate>
</and>