Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » MMenuItem.setSelected is not reflected in the GUI(setSelected operation does change the selected state of MMenuItem but this is not reflected in the GUI)
MMenuItem.setSelected is not reflected in the GUI [message #1219049] Sat, 30 November 2013 11:05 Go to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Hi,

I use the below snippet to toggle selected states of DirectMenuItems and via debugger I can verify that the fields are modified as expected. However, the changes are not reflected in the GUI and initial selections states are retained as far as the GUI is concerned.

Am I missing anything here?

Another question is, I tried getting the MMenu which holds this MMenuItem injected in the execute method (both @Named and regular injections) but every time I'm getting 'null'. I worked this around by accessing the parent of the MMenuItem but why wouldn't the injection work?

@Execute
public void execute(MMenuItem item) {
	MElementContainer<MUIElement> elementContainer = item.getParent();
	List<MUIElement> uiElements = elementContainer.getChildren();

	for(int i = 0; i < uiElements.size(); i++) {
		MUIElement uiElement = uiElements.get(i);
		if(uiElement instanceof MMenuItem && 
                   ((MMenuItem)uiElement).getType() == ItemType.CHECK) {
			((MMenuItem)uiElement).setSelected(false);
		}
	}

	item.setSelected(true);
}


Regards,

Ozgur.

[Updated on: Mon, 02 December 2013 21:38]

Report message to a moderator

Re: MMenuItem.setSelected is not reflected in the GUI [message #1219856 is a reply to message #1219049] Fri, 06 December 2013 09:59 Go to previous messageGo to next message
Eclipse UserFriend
There's probably a listener missing. Please file a bug on Platform/UI and cc me.
Re: MMenuItem.setSelected is not reflected in the GUI [message #1221101 is a reply to message #1219856] Mon, 16 December 2013 22:35 Go to previous message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
I've raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=424192 and CC'ed Sopot.
Previous Topic:Is it possible to retrieve MPart's bounds?
Next Topic:Active Perspective Core Expression
Goto Forum:
  


Current Time: Tue Mar 19 07:49:23 GMT 2024

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

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

Back to the top