Bug 399065 - FORCE_TEXT is ignored on view toolbars
Summary: FORCE_TEXT is ignored on view toolbars
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-01-25 05:49 EST by Christian Pontesegger CLA
Modified: 2014-04-29 09:27 EDT (History)
2 users (show)

See Also:


Attachments
sample project showing the bug (7.45 KB, application/zip)
2013-01-25 05:49 EST, Christian Pontesegger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Pontesegger CLA 2013-01-25 05:49:55 EST
Created attachment 226089 [details]
sample project showing the bug

I tried to have text and an icon for a toolbar entry by setting mode to FORCE_TEXT within the menuContribution. Seems the flag is ignored by the framework
Comment 1 Paul Webster CLA 2013-01-25 09:37:15 EST
What build are you running against?

PW
Comment 2 Paul Webster CLA 2013-01-25 09:49:33 EST
OK, org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem supports the tag "FORCE_TEXT" but org.eclipse.ui.internal.menus.MenuAdditionCacheEntry.createToolBarCommandAddition(IConfigurationElement) doesn't set the tag when parsing the extension command/@mode

PW
Comment 3 Christian Pontesegger CLA 2013-01-25 12:29:33 EST
(In reply to comment #1)
> What build are you running against?

Cannot look up the exact build ID before monday, but its Juno SR1.

I originally experienced this when trying to update contributions programmatically (through the IElementUpdater interface). Hope a fix will take care of the programmatic approach too.
Comment 4 Serge Rider CLA 2014-04-10 15:51:41 EDT
I think that this bug is really important. It is one of those bugs which don't let many RCP developers to migrate from Eclipse 3.x to 4.x because it breaks UI and there are no workarounds.
Moreover it is trivial and very easy to fix. Sorry, I can't provide well-formed patch, I'm RCP developer and don't have Eclipse platform dev environment. 
In MenuAdditionCacheEntry.createToolBarCommandAddition just add following code at line 503:

		if (MenuHelper.getMode(commandAddition) == CommandContributionItem.MODE_FORCE_TEXT) {
			item.getTags().add("FORCE_TEXT");
			item.setLabel(MenuHelper.getLabel(commandAddition));
		}


I've patched my local org.eclipse.ui.workbench plugin and it solved the problem. I hope this fix will be included at least in Eclipse 4.4.
Comment 5 Paul Webster CLA 2014-04-15 11:25:22 EDT
(In reply to Serge Rider from comment #4)
> I think that this bug is really important. It is one of those bugs which
> don't let many RCP developers to migrate from Eclipse 3.x to 4.x because it
> breaks UI and there are no workarounds.

See https://wiki.eclipse.org/Platform_UI/How_to_Contribute on how to set up the eclipse dev env.

PW
Comment 6 Georg Breitschopf CLA 2014-04-18 09:37:07 EDT
Pushed to master for review: https://git.eclipse.org/r/#/c/25271/
Comment 8 Paul Webster CLA 2014-04-29 09:27:00 EDT
In 4.4.0.I20140428-2000