Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Context menu not visible, at least sometimes
Context menu not visible, at least sometimes [message #1033394] Thu, 04 April 2013 07:37
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 183
Registered: January 2013
Senior Member

In some of my Parts I have a JFace Table which has a PopupMenu registred:

Depending on the selection I won't show two of the menu's elements:
private void showContextMenu(Object a) {
		boolean show = false;
		List<?> list = (List<?>) tableViewer.getInput();
		if (a == null || tableViewer.getSelection().isEmpty()
				|| !list.contains(a))
			show = false;
			show = true;
		for (MMenuElement elem : popupMenu.getChildren()) {
			if (elem.getElementId().endsWith("delete"))
			else if (elem.getElementId().endsWith("edit"))


This works, but only sometimes. My scenario is:

- I select an item in a tree.
- The part with the table shows up.
- I right-click in the table.
- The menu shows up with only one item (that is the way it should be).
- I select another item in a tree and another part opens.
- I go back to the first item and the part with the table shows up.
- I right-click on the table and nothing happens.
- BUT: It might be, that everything works fine and the menu shows up, like it should.

One could say the menu only doesn't show up every fourth time. But it always shows up, if an item is selected and all of the three MMenuElements are visible.

Hopefully someone has an idea, how this could be solved.

Best regards

Previous Topic:Dependency Injection in eclipse plugins (not RCP apps)
Next Topic:Testing my RCP app on Eclipse 4.3 - unwanted progress bar is showing
Goto Forum:

Current Time: Fri Apr 27 01:06:16 GMT 2018

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

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