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 @@
mnemonic="O"
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>
......@@ -137,21 +140,25 @@
label="%newFilterDefMenu"
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>
<command
......@@ -159,22 +166,25 @@
label="%newFilterImplMenu"
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>
......@@ -378,148 +388,176 @@
class="org.bonitasoft.studio.actors.ui.handler.ImportOrganizationHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportOrganizationHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<or>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
<test
property="org.bonitasoft.studio.organization.isOrganizationFile">
</test></or>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<or>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
<test
property="org.bonitasoft.studio.organization.isOrganizationFile">
</test>
</or>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ManageOrganizationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.organization.isOrganizationFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterDefinitionHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterDefFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterDefFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.NewFilterImplementationHandler"
commandId="org.bonitasoft.studio.application.newWithWizard">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ImportActorFilterHandler"
commandId="org.bonitasoft.studio.application.import">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFolder">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportSingleActorFilterHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFile">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterImplFile">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
<handler
class="org.bonitasoft.studio.actors.ui.handler.ExportActorFilterFromDefinitionHandler"
commandId="org.bonitasoft.studio.application.export">
<activeWhen>
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterDefFile">
</test>
</iterate>
</and>
<with
variable="activeMenuSelection">
<and>
<count
value="1">
</count>
<iterate>
<test
property="org.bonitasoft.studio.actors.isActorFilterDefFile">
</test>
</iterate>
</and>
</with>
</activeWhen>
</handler>
</extension>
......
......@@ -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
defini