Thank you for answer !
But :
MPerspective mpOffers = (MPerspective)
modelService.find("fr.sogeti.e4.sogeti.perspective.vdoffers", application);
MMenu mmOffers = (MMenu)
modelService.find("fr.sogeti.e4.sogeti.menu.business", application);
partService.switchPerspective(mpOffers);
mmOffers.setEnabled(false);
In this code, mmOffers is null, and I think that it is bound to this bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=383403
I think that I can't change programatically the state of menu. No ?
Thank you in advance
2014/1/20 Dirk Fauth <[email protected]>
> Hi,
>
> this question was asked on the forum a while ago:
>
> http://www.eclipse.org/forums/index.php/t/627845/
>
>
> There is no equivalent for that, as there is no workbenchWindow in e4. You
> could try to workaround that by providing your own value for the definition
> which is set by a event listener that reacts on perspective changes for
> example.
>
> Greez,
> Dirk
>
>
> On Mon, Jan 20, 2014 at 10:32 AM, Nicolas Sarazin <
> [email protected]> wrote:
>
>> Hello,
>>
>> I use Eclipse 4.3.1 and Eclipse e4 Tools 0.14.0.
>>
>> How can I show / hide a menu according to the current perspective ?
>>
>> Menu : Trimmed Window -> Main Menu -> Menu
>>
>> I looked for "Visible-When Expression", but I don't find the variable
>> equivalent of "activeWorkbenchWindow.activePerspective" in e4.
>>
>> Thanks in advance !
>>
>> _______________________________________________
>> e4-dev mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/e4-dev
>>
>>
>
> _______________________________________________
> e4-dev mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/e4-dev
>
>
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev