Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Can I put controls other than buttons on the cool bar?(I'd like to put a text field there)
icon5.gif  Can I put controls other than buttons on the cool bar? [message #660320] Thu, 17 March 2011 21:06 Go to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
I'd like to place a text field or combo on the cool bar next to the buttons. Is this possible? If so, how?
Re: Can I put controls other than buttons on the cool bar? [message #660361 is a reply to message #660320] Fri, 18 March 2011 06:24 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 18/03/11 2:36 AM, SBS wrote:
> I'd like to place a text field or combo on the cool bar next to the
> buttons. Is this possible? If so, how?

In the o.e.ui.menuContributions extension, use a control contribution

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: Can I put controls other than buttons on the cool bar? [message #660385 is a reply to message #660320] Fri, 18 March 2011 08:53 Go to previous messageGo to next message
Elvis Dominguez is currently offline Elvis DominguezFriend
Messages: 52
Registered: July 2009
Location: Switzerland
Member
On Thu, 17 Mar 2011 17:06:15 -0400, SBS wrote:

> I'd like to place a text field or combo on the cool bar next to the
> buttons. Is this possible? If so, how?

I.ex.:
IToolBarManager myTb = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
coolBar.add(new ToolBarContributionItem(myTb, "MyTB"));

ControlContribution cc = new ControlContribution("my.cc"){
protected Control createControl(Composite parent)
{
final Combo combo = new Combo(parent);
return combo;
}
};
myTb.add(cc);




--
kindly Elvis Dominguez
icon5.gif  Re: Can I put controls other than buttons on the cool bar? [message #660553 is a reply to message #660385] Sat, 19 March 2011 10:24 Go to previous messageGo to next message
SBS  is currently offline SBS Friend
Messages: 57
Registered: January 2011
Member
Thanks, but where does this code belong?
Re: Can I put controls other than buttons on the cool bar? [message #660749 is a reply to message #660553] Mon, 21 March 2011 12:44 Go to previous messageGo to next message
Elvis Dominguez is currently offline Elvis DominguezFriend
Messages: 52
Registered: July 2009
Location: Switzerland
Member
On Sat, 19 Mar 2011 06:24:12 -0400, SBS wrote:

> Thanks, but where does this code belong?
I have it in
ApplicationActionBarAdvisor.fillCoolBar(ICoolBarManager)



--
kindly Elvis Dominguez
Re: Can I put controls other than buttons on the cool bar? [message #661891 is a reply to message #660749] Mon, 28 March 2011 13:06 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/21/2011 08:44 AM, Elvis Dominguez wrote:
> On Sat, 19 Mar 2011 06:24:12 -0400, SBS wrote:
>
>> Thanks, but where does this code belong?
> I have it in
> ApplicationActionBarAdvisor.fillCoolBar(ICoolBarManager)
>

This works if you are writing your own RCP app ... but unless you have a
reason to, use org.eclipse.ui.menus and place a toolbar with a control
element in toolbar:org.eclipse.ui.main.toolbar

PW

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


Previous Topic:running multiple configurations of an rcp
Next Topic:Anyway to specify new KeyEvent.keyLocation in plugin.xml?
Goto Forum:
  


Current Time: Thu Apr 25 12:00:49 GMT 2024

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

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

Back to the top