Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Show text and image for an Action in a Toolbar
Show text and image for an Action in a Toolbar [message #330112] Tue, 15 July 2008 15:15 Go to next message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Hi,

This is probably a dumb question, but I can't find the answer...

I have created a ToolBar and added a ToolBarManager to it. I have
created an Action and setText() and setImageDescriptor() on it.

When it displays, I only see the image for the action - not the text. Is
there a way to display Image AND text for the Action?

Thanks
--
Derek
Re: Show text and image for an Action in a Toolbar [message #330123 is a reply to message #330112] Tue, 15 July 2008 18:22 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Add an ActionContributionItem instead of the Action ... you can use
org.eclipse.jface.action.ActionContributionItem.setMode(int) to force
the text to be shown.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Show text and image for an Action in a Toolbar [message #330127 is a reply to message #330123] Tue, 15 July 2008 19:01 Go to previous message
Eclipse UserFriend
Originally posted by: subs._nospam_consertum.com

Paul Webster wrote:
> Add an ActionContributionItem instead of the Action ... you can use
> org.eclipse.jface.action.ActionContributionItem.setMode(int) to force
> the text to be shown.
>
> PW
>
Perfect.

Now the next problem. I am dynamically changing the text, based on
selection in the UI. Over a certain length (about 20 characters + image
size), the action completely disappears, but reappears when the text
length shortens again.

Any ideas why this might be happening?

Thanks

--
Derek
Previous Topic:Re: Command FrameWork- loosing popup menus when I detach window
Next Topic:Empty console content when opened programmatically in the JEE perspective
Goto Forum:
  


Current Time: Fri Dec 27 05:49:10 GMT 2024

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

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

Back to the top