Multipage Header Toolbar-, Menu- Manager population [message #328910] |
Fri, 06 June 2008 10:45  |
Eclipse User |
|
|
|
Hello,
I'm using a SharedHeaderFormEditor with Commands assigned to its headers
ToolBar- and Menu-Managers. Each FormPage included inside
SharedHeaderFormEditor have their own toolbar and menu entrys.
The Eclipse MenuService is currently used to delegate the commands
definied with 'org.eclipse.ui.menus' to the managers.
At the moment my implementation is long winded and not felxible at all to
declarations from elsewhere. With other words I don'nt like my
implementation :)
Currently on each page change the following code is getting executed:
public void pageChanged(PageChangedEvent event) {
// only if this page is getting shown
if (event.getSelectedPage() == this){
// populating the toolbar
getHeaderToolBarManager().removeAll();
getMenuService().populateContributionManager((ToolBarManager )getHeaderToolBarManager(),
"toolbar:editors.one.header");
getHeaderToolBarManager().update(true);
// populating the menu
getHeaderMenuManager().removeAll();
getMenuService().populateContributionManager((MenuManager)ge tHeaderMenuManager(),
"menu:editors.one.header");
getHeaderMenuManager().update(true);
// layouting the header to get the toolbar fit.
getHeaderForm().getForm().getForm().getHead().layout(true);
}
}
I wonder if there are better ways to delegate to this managers.
Unfortunately I was not able to find anything helpfull yet :(
How can this be done a better way?
Thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.06220 seconds