public IActionBars getActionBars() {
if (actionBars != null)
return actionBars;
final IActionBars global = getViewSite().getActionBars();
actionBars = new IActionBars(){
public void clearGlobalActionHandlers() {
global.clearGlobalActionHandlers();
}
public IAction getGlobalActionHandler( String actionId ) {
return global.getGlobalActionHandler(actionId);
}
public IMenuManager getMenuManager() {
return null;
}
public IStatusLineManager getStatusLineManager() {
return global.getStatusLineManager();
}
public IToolBarManager getToolBarManager() {
if (toolbarManager == null) {
toolbarManager = new ToolBarManager(){
public void update( boolean force ) {
super.update(force);
/*
* IToolBarManager gtbm = global.getToolBarManager(); //remove all
* the items in the config group IContributionItem[] items =
* gtbm.getItems(); boolean remove = false; for (int i = 0; i <
* items.length; i++) { if (items[i].isGroupMarker()) { GroupMarker
* marker = (GroupMarker)items[i]; remove =
* marker.getId().equals(CONFIG_MENU_GROUP); } else { if (remove) {
* gtbm.remove(items[i]); } } } //add items to the config group
* items = getItems(); for (int i = 0; i < items.length; i++) {
* gtbm.appendToGroup(CONFIG_MENU_GROUP, items[i]); }
* gtbm.update(false);
*/
}
};
}
return toolbarManager;
}
public void setGlobalActionHandler( String actionId, IAction handler ) {
global.setGlobalActionHandler(actionId, handler);
}
public void updateActionBars() {
global.updateActionBars();
}
public IServiceLocator getServiceLocator() {
return global.getServiceLocator();
}
};
return actionBars;
}