Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to disable MenuItems from Fragment
How to disable MenuItems from Fragment [message #1745759] Mon, 17 October 2016 09:11 Go to next message
Stefan Weiser is currently offline Stefan WeiserFriend
Messages: 53
Registered: February 2012
Member
Hello,

I would like to disable MenuItems from a fragment.e4xmi, which get initialized in the Application.e4xmi.

I tried to use a "Model Fragment", where I defined the "Extended Element ID" to my MenuItem, but there is no feature name for e.g. "enabled". I started to debug the model code but haven't found the solution till now. I googled for a solution, but couldn't find anything useful.
Re: How to disable MenuItems from Fragment [message #1745828 is a reply to message #1745759] Tue, 18 October 2016 06:13 Go to previous message
Stefan Weiser is currently offline Stefan WeiserFriend
Messages: 53
Registered: February 2012
Member
As nobody seem to have a solution, I did it on my own:

- It is possible to redefine the whole MenuItem by reassigning the ID of the MenuItem. Then the old MenuItem is no longer displayed I the possition is also correct. Furthermore I can exchange the ContributionURI and assign a new implementation, when using DirectMenuItem.
- Another solution is not to define the enabled-status in the E4 model than controlling the behavior by the @CanExecute annotation. For the visibility I implemented my own annotation @Visible, which also works fine and uses the concept of e4. I wish that Eclipse would introduce such an annotation in the future, so I don't have to implement such things on my own.
Previous Topic:Launch e4 RCP application by code?
Next Topic:SWT Browser
Goto Forum:
  


Current Time: Fri Sep 22 08:19:59 GMT 2017

Powered by FUDForum. Page generated in 0.01880 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software