Custom control contribution in view toolbar [message #517599] |
Mon, 01 March 2010 13:44 |
|
I have added programmatically a control contribution to a view toolbar like this:
IActionBars aBars = getViewSite().getActionBars();
IToolBarManager tbMgr = aBars.getToolBarManager();
// Add combo to change graph type
IContributionItem scaleItem = new ControlContribution("type") {
protected Control createControl(Composite parent) { ... code of the contribution ... };
};
tbMgr.add(scaleItem);
tbMgr.update(true);
aBars.updateActionBars();
The control contribution consists of the following:
Button_with_image:Scale:Button_with_image:Separator:Button_w ith_image. All images are 16x16 pixels.
Problems:
1. The control contribution is displayed in the right of the view's toolbar. How can I display it in the left of the view toolbar? (for example like the breadcrumb is displayed).
2. The scale is not displayed completely. I can see the top of the scale but not all of it. I have tried to set a GridData.heightHint to the scale to 16 but it did not worked. As far I could detect from the code the default height of a scale is 41 pixels. Assuming that I do not want to change the height of the images to match the one of the scale how can I have a nice looking control contribution to the view's toolbar?
Any help would be appreciated since I have ran out of ideas.
Time is what you make of it.
|
|
|
Powered by
FUDForum. Page generated in 0.03642 seconds