I want to add toolbar in eclipse rcp application, i tried to write the code in fillCoolBar function in ActionBarAdvisor.java and also using extensions. But the extensions provided by other plugins is not aligned properly. My guess is that the names of various toolbarManager inside the toolbar is not proper. Anyone can tell me how to add all the icons so that the extra icons added by other plugins and added by me are aligned properly? Every time i restart or open a new work-space the icons spacing changes! I have attached a image of the problem.
The code in fillCoolBar is as follows:
@Override
protected void fillCoolBar(ICoolBarManager coolBar){
IToolBarManager fileToolbar1 = new ToolBarManager(SWT.WRAP);
fileToolbar1.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
fileToolbar1.add(newDropDownAction);
fileToolbar1.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
fileToolbar1.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
fileToolbar1.add(saveFileAction);
fileToolbar1.add(saveAllFilesAction);
fileToolbar1.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
fileToolbar1.add(printAction);
fileToolbar1.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
coolBar.add(fileToolbar1);
}
Figured it out. Need to add CSS styling to it. Take following steps:
And thats it ! Done :)