我的RCP项目在eclipse3.x中使用eclipse自带的方法PerspectiveBarManager进行多视图的管理,但是我现在升级到Eclipse4.x之后,eclipse就没有这个方法了,请问给为谁在eclipse4.x做过多视图管理,请你们用什么方法替代eclipse3.x上的PerspectiveBarManger这个方法呢?
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
PerspectiveBarManager perspBar = ((WorkbenchWindow) win).getPerspectiveBar();
PerspectiveBarContributionItem newitem = (PerspectiveBarContributionItem) perspBar.find(newid);
if (newitem == null) {
newitem = new PerspectiveBarContributionItem(newpd, win.getActivePage());
if(perspBar.getItems().length > 0) {
perspBar.insertAfter(HomePerspective.ID, newitem);
}
//perspBar.addItem(newitem);
perspBar.update(false);
}
newitem.select();