Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Can not register multiple widget for the same menuContribution ID
Can not register multiple widget for the same menuContribution ID [message #1816981] Wed, 13 November 2019 10:35 Go to next message
Dieter Mai is currently offline Dieter MaiFriend
Messages: 5
Registered: August 2019
Junior Member
Hello

At my company we develop our own eclipse distribution with some additional features for our use case. We have an editor with multiple pages. Each page contains a table with a context menu. This worked fine, but when we switched from eclipse 2019-6 to 2019-9, the context menus stopped working working - non of them where displayed.
After some research i discovered the issue. All context menus used the same menuContribution id of the extension point "org.eclipse.ui.menus". Since
eclipse 2019-09, when ever a context menu is registered, previous registrations with the same menuContribution ID stop working. Since we registered all context menus of the
tables in the construction of the pages, only the last table created has a context menu.

Here our code that we used.
Node
- "attributesTable" is TableViewer
- "editor.getEditorSite()" returns a org.eclipse.ui.internal.EditorSite

	private void registerContextMenu() {
		Table table = attributesTable.getTable();
		tableMenuManager = new MenuManager();

		Menu menu = tableMenuManager.createContextMenu(table);
		table.setMenu(menu);
		editor.getEditorSite().registerContextMenu(getAttributesTableContextMenuId(), tableMenuManager, attributesTable,
				false);
		tableMenuManager.updateAll(true);
	}


I was able to work around the issue by invoking registerContextMenu when ever the editor page is displayed instead of during construction of the page.
Still i was wondering if there was an intended changed that prevents multiple widgets being registered for the same menuContribution or is this a bug?

I'm writing this in the jface section of this forum because i didn't find a section for "org.eclipse.ui".
Re: Can not register multiple widget for the same menuContribution ID [message #1817181 is a reply to message #1816981] Mon, 18 November 2019 06:42 Go to previous message
Dieter Mai is currently offline Dieter MaiFriend
Messages: 5
Registered: August 2019
Junior Member
never mind, I found a related bug ticket in the bugzilla
Previous Topic:TreeViewer doesn't work well on Ubuntu
Next Topic:Undo/Redo keyboard shortcuts in a JFace dialog
Goto Forum:
  


Current Time: Thu Apr 18 02:04:12 GMT 2024

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

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

Back to the top