Community
Participate
Working Groups
ActionContributionItem#setMode(MODE_FORCE_TEXT) can enable Coolbar rendering a label under toolbar button's icon. For a RCP application, it is an important feature targeting non-expert users. In our project, we want to place the label just beside icon horizontally to save main display area, just like what Eclipse's PerspectiveSwitcher or IE can do. By hacking WorkbenchWindow class like below, we can really change toolbar label's position. public WorkbenchWindow(int number) { super(null); ... ... // Add contribution managers that are exposed to other plugins. addMenuBar(); addCoolBar(SWT.FLAT); // ==> addCoolBar(SWT.FLAT | SWT.RIGHT) addStatusLine(); ... ... But the problem is: 1. Hacking an internal class is a not good practice when considering platform's future upgrades. 2. A better way maybe use an interface simillar to IWorkbenchWindowConfigure to provid a chance of configuration. 3. User maybe want to customize the way where to show toolbar button's label or just hide it off. Dynamic configuration is expected for platform's UI component. 4. Sometime when I tried to enable label showing and disable it later, text disappeard but some ugly space still left. (I have an image file to describe the problem, but not knowing how to upload it).
Created attachment 27151 [details] Sample Image
There are currently no plans to do this but we would be happy to look at a patch
According to Eclipse 3.2 or above, there is a new internal IToolBarManager2 interface which can be used to change caption position of Coolbar button. But I have to reference to some internal implementations to create my new PresentationFactory (also see Bug#169106 to get more information): import org.eclipse.jface.internal.provisional.action.IToolBarManager2; import org.eclipse.jface.internal.provisional.action.ToolBarManager2; import org.eclipse.ui.internal.provisional.presentations.IActionBarPresentationFactory; import org.eclipse.ui.presentations.WorkbenchPresentationFactory; ... public class MyPresentationFactory extends WorkbenchPresentationFactory implements IActionBarPresentationFactory { ... final public IToolBarManager2 createToolBarManager() { return new ToolBarManager2(SWT.FLAT | SWT.BOTTOM); } } (In reply to comment #2) > There are currently no plans to do this but we would be happy to look at a > patch >
Prakash is now responsible for watching bugs in the [RCP] component area.