Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Changing MenuItem Text when contributed via plugin.xml in 3.8.1 (4.2.1)(Changing MenuItem Text when contributed via plugin.xml in 3.8.1 (4.2.1))
Changing MenuItem Text when contributed via plugin.xml in 3.8.1 (4.2.1) [message #1048734] Wed, 24 April 2013 22:28
Andy Gifford is currently offline Andy GiffordFriend
Messages: 2
Registered: July 2009
Junior Member
We have an application that uses plugin.xml files to specify the default menu contributions (File, Help, etc.), see below. We then created API to allow specific workflows the ability to change the text of those menu items via the setText method on MenuItem (see snippet below). This worked fine with the 3.7.1 (4.1.1) [1] versions of the SWT jars, but as soon as we upgraded to 3.8.1 (4.2.1) [2] this functionality no longer works.

What changed between 4.1.1 and 4.2.1 that would have broken this? Any ideas on how we can work around this issue?

[1] org.eclipse.swt.win32.win32.x86-3.7.1-SDK-4.1.1
[2] org.eclipse.swt.win32.win32.x86-3.100.1-SDK-4.2.1

    <extension point="org.eclipse.ui.menus">
        <menuContribution locationURI="">
            <menu id="file" label="File">
                <separator name="additions" visible="true" />
        <menuContribution locationURI="">
            <menu id="help" label="Help">
                <separator name="additions" visible="true" />

            final MenuDelegate menuDelegate = MenuDelegate.create();
            if (menuDelegate != null) {
                final MenuLabels menuLabels = menuDelegate.getMenuLabels();
                final Menu appMenuBar = window.getShell().getMenuBar();
                for (final MenuItem item : appMenuBar.getItems()) {
                    final String id = ((MenuManager) item.getData()).getId();
                    if (FILE_MENU_ID.equals(id)) {
Previous Topic:Display not available when plugin starts()
Next Topic:Questions about migrating from 3.5 to 4.3
Goto Forum:

Current Time: Wed May 23 22:55:53 GMT 2018

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

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

Back to the top