Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 399065

Summary: FORCE_TEXT is ignored on view toolbars
Product: [Eclipse Project] Platform Reporter: Christian Pontesegger <christian.pontesegger>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: georg.breitschopf, serge
Version: 4.2.1Keywords: helpwanted
Target Milestone: 4.4 M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
sample project showing the bug none

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