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,22 +110,25 @@ ...@@ -110,22 +110,25 @@
mnemonic="O" mnemonic="O"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
<iterate> </count>
<instanceof <or>
value="org.eclipse.core.resources.IProject"> <iterate>
</instanceof> <instanceof
<test value="org.eclipse.core.resources.IProject">
property="org.bonitasoft.studio.application.isBonitaProject"> </instanceof>
</test> <test
</iterate> property="org.bonitasoft.studio.application.isBonitaProject">
</or> </test>
</and> </iterate>
</or>
</and>
</with>
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
...@@ -137,21 +140,25 @@ ...@@ -137,21 +140,25 @@
label="%newFilterDefMenu" label="%newFilterDefMenu"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
<iterate> </count>
<instanceof <or>
value="org.eclipse.core.resources.IProject"> <iterate>
</instanceof> <instanceof
<test value="org.eclipse.core.resources.IProject">
property="org.bonitasoft.studio.application.isBonitaProject"> </instanceof>
</test></iterate> <test
</or> property="org.bonitasoft.studio.application.isBonitaProject">
</and> </test>
</iterate>
</or>
</and>
</with>
</visibleWhen> </visibleWhen>
</command> </command>
<command <command
...@@ -159,22 +166,25 @@ ...@@ -159,22 +166,25 @@
label="%newFilterImplMenu" label="%newFilterImplMenu"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
<iterate> </count>
<instanceof <or>
value="org.eclipse.core.resources.IProject"> <iterate>
</instanceof> <instanceof
<test value="org.eclipse.core.resources.IProject">
property="org.bonitasoft.studio.application.isBonitaProject"> </instanceof>
</test> <test
</iterate> property="org.bonitasoft.studio.application.isBonitaProject">
</or> </test>
</and> </iterate>
</or>
</and>
</with>
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
...@@ -378,148 +388,176 @@ ...@@ -378,148 +388,176 @@
class="org.bonitasoft.studio.actors.ui.handler.ImportOrganizationHandler" class="org.bonitasoft.studio.actors.ui.handler.ImportOrganizationHandler"
commandId="org.bonitasoft.studio.application.import"> commandId="org.bonitasoft.studio.application.import">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.organization.isOrganizationFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.organization.isOrganizationFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ExportOrganizationHandler" class="org.bonitasoft.studio.actors.ui.handler.ExportOrganizationHandler"
commandId="org.bonitasoft.studio.application.export"> commandId="org.bonitasoft.studio.application.export">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<or> </count>
<test <iterate>
property="org.bonitasoft.studio.organization.isOrganizationFolder"> <or>
</test> <test
<test property="org.bonitasoft.studio.organization.isOrganizationFolder">
property="org.bonitasoft.studio.organization.isOrganizationFile"> </test>
</test></or> <test
</iterate> property="org.bonitasoft.studio.organization.isOrganizationFile">
</and> </test>
</or>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ManageOrganizationHandler" class="org.bonitasoft.studio.actors.ui.handler.ManageOrganizationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard"> commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.organization.isOrganizationFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.organization.isOrganizationFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterDefinitionHandler" class="org.bonitasoft.studio.actors.ui.handler.NewFilterDefinitionHandler"
commandId="org.bonitasoft.studio.application.newWithWizard"> commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterDefFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterDefFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterImplementationHandler" class="org.bonitasoft.studio.actors.ui.handler.NewFilterImplementationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard"> commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterImplFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ImportActorFilterHandler" class="org.bonitasoft.studio.actors.ui.handler.ImportActorFilterHandler"
commandId="org.bonitasoft.studio.application.import"> commandId="org.bonitasoft.studio.application.import">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterImplFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterHandler" class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterHandler"
commandId="org.bonitasoft.studio.application.export"> commandId="org.bonitasoft.studio.application.export">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterImplFolder"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ExportSingleActorFilterHandler" class="org.bonitasoft.studio.actors.ui.handler.ExportSingleActorFilterHandler"
commandId="org.bonitasoft.studio.application.export"> commandId="org.bonitasoft.studio.application.export">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterImplFile"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterImplFile">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterFromDefinitionHandler" class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterFromDefinitionHandler"
commandId="org.bonitasoft.studio.application.export"> commandId="org.bonitasoft.studio.application.export">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<iterate> value="1">
<test </count>
property="org.bonitasoft.studio.actors.isActorFilterDefFile"> <iterate>
</test> <test
</iterate> property="org.bonitasoft.studio.actors.isActorFilterDefFile">
</and> </test>
</iterate>
</and>
</with>
</activeWhen> </activeWhen>
</handler> </handler>
</extension> </extension>
......
...@@ -443,19 +443,22 @@ ...@@ -443,19 +443,22 @@
commandId="org.eclipse.ui.file.refresh" commandId="org.eclipse.ui.file.refresh"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
<iterate> </count>
<instanceof <or>
value="org.eclipse.core.resources.IProject"> <iterate>
</instanceof> <instanceof
</iterate> value="org.eclipse.core.resources.IProject">
</or> </instanceof>
</and> </iterate>
</or>
</and>
</with>
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
...@@ -478,19 +481,20 @@ ...@@ -478,19 +481,20 @@
commandId="org.bonitasoft.studio.renameCommand" commandId="org.bonitasoft.studio.renameCommand"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
</count>
<iterate> <iterate>
<test <test
property="org.bonitasoft.studio.application.renamablePropertyTester.isRenamable"> property="org.bonitasoft.studio.application.renamablePropertyTester.isRenamable">
</test> </test>
</iterate> </iterate>
</or> </and>
</and> </with>
</visibleWhen> </visibleWhen>
</command> </command>
<separator <separator
...@@ -513,19 +517,20 @@ ...@@ -513,19 +517,20 @@
label="%deploy" label="%deploy"
style="push"> style="push">
<visibleWhen <visibleWhen
checkEnabled="true"> checkEnabled="false">
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
<iterate> </count>
<test <iterate>
property="org.bonitasoft.studio.application.deployablePropertyTester.isDeployable"> <test
</test> property="org.bonitasoft.studio.application.deployablePropertyTester.isDeployable">
</iterate> </test>
</or> </iterate>
</and> </and>
</with>
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
...@@ -843,18 +848,19 @@ ...@@ -843,18 +848,19 @@
class="org.bonitasoft.studio.application.handler.RefreshProjectHandler" class="org.bonitasoft.studio.application.handler.RefreshProjectHandler"
commandId="org.eclipse.ui.file.refresh"> commandId="org.eclipse.ui.file.refresh">
<activeWhen> <activeWhen>
<and> <with
<count variable="activeMenuSelection">
value="1"> <and>
</count> <count
<or> value="1">
</count>
<iterate> <iterate>
<instanceof <instanceof
value="org.eclipse.core.resources.IResource"> value="org.eclipse.core.resources.IResource">
</instanceof> </instanceof>
</iterate> </iterate>
</or> </and>
</and> </with>
</activeWhen> </activeWhen>
</handler> </handler>
<handler <handler
......
...@@ -53,12 +53,14 @@ ...@@ -53,12 +53,14 @@
label="%defineBDMMenu" label="%defineBDMMenu"
mnemonic="B" mnemonic="B"
style="push"> style="push">
<visibleWhen> <visibleWhen
<and> checkEnabled="false">
<count <with
value="1"> variable="activeMenuSelection">
</count> <and>
<or> <count
value="1">
</count>
<iterate> <iterate>
<instanceof <instanceof
value="org.eclipse.core.resources.IProject"> value="org.eclipse.core.resources.IProject">
...@@ -70,8 +72,8 @@ ...@@ -70,8 +72,8 @@
property="org.bonitasoft.studio.businessobject.bdmExists"> property="org.bonitasoft.studio.businessobject.bdmExists">
</test> </test>
</iterate> </iterate>
</or> </and>
</and> </with>
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
...@@ -82,8 +84,11 @@ ...@@ -82,8 +84,11 @@
commandId="org.bonitasoft.studio.businessobject.openH2Console"