Saturday, August 2, 2014

Hide toolbar in eclipse programatically


You might want to remove eclipse toolbar completely in your Eclipse RCP product to make use of that space or you might not have any useful toolbar actions which are specific to your product.

This how you can remove programatically.

private void hideCoolbar() {
try {
IHandlerService service = (IHandlerService) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getService(IHandlerService.class);
if (service != null)
service.executeCommand("org.eclipse.ui.ToggleCoolbarAction", null);
} catch (Exception e) {
KEditorPlugin.logError("Unable to hide the eclipse toolbar.",e);
}
}








No comments:

Post a Comment