的解決方案是使用org.eclipse.ui.SubActionBars的實例,並添加選項卡專用的行動,就像這樣......
@Override
public void createControls(Composite parent, final TabbedPropertySheetPage aTabbedPropertySheetPage)
{
...
makeActions();
subActionBars = new SubActionBars(tabbedPropertySheetPage.getSite().getActionBars());
subActionBars.getToolBarManager().add(refreshAction);
subActionBars.getMenuManager().add(refreshAction);
}
..然後覆蓋aboutToBeShown()和aboutToBeHidden ()像這樣...
@Override
public void aboutToBeShown()
{
super.aboutToBeShown();
subActionBars.activate();
subActionBars.updateActionBars();
}
@Override
public void aboutToBeHidden()
{
super.aboutToBeHidden();
subActionBars.deactivate();
subActionBars.updateActionBars();
}