Another common feature is to place SWT controls in the toolbar instead of just buttons. Again, the key here is to put an IContributionItem into the toolbar instead of an IAction. This works because ToolItems and CoolItems both allow controls to be set as their contents. JFace includes a helper class, ControlContribution, that supports adding controls to toolbars and coolbars. The code for ControlContribution is shown below:
org.eclipse.jface/ControlContribution
To add your own control, subclass ControlContribution and implement createControl(Composite) to return the desired control. The returned control is added to the toolbar by placing it in a dedicated tool item. The following snippet from Hyperbola's ActionBarAdvisor shows how to place a ComboBox into the Hyperbola main toolbar:
org.eclipsercp.hyperbola/ApplicationActionBarAdvis