Reputation: 4099
Is it possible in a standalone SWT/JFace application to add a custom widget in a CoolBarManager (a text box for exemple) ?
I look for IContributionItem but I didn't find useful examples.
HelpSearchContributionItem seems to work only with a RCP application (it uses objects from RCP : IWorkbenchWindow for example).
Thanks in advance
Upvotes: 1
Views: 207
Reputation: 4892
You should subclass ControlContribution and implement createControl() method.
Then add a ToolBarManager/ToolBarManagerContributionItem
to the coolbar, and your subclass of ControlContribution
to the ToolBarManager
.
Upvotes: 4
Reputation: 13712
Although it is not recommended, you can subclass the ToolItem class and provide your own implementation. To do this you also have to override the checkSubclass method.
public class MyToolItem extends ToolItem {
@Override
protected void checkSubClass(){
// leave it empty
}
}
Upvotes: 0