WorkbenchPage page = (WorkbenchPage) this.getWindowConfigurer().getWindow()
.getActivePage();
LayoutPart part = page.getPerspectivePresentation().findPart(CDTPlugin.CDTView, null);
ViewPane vp = (ViewPane) part;
final ViewStack vs= (ViewStack) vp.getContainer();
TabbedStackPresentation tp = (TabbedStackPresentation) vs.getTestPresentation();
//tp.showMinMax(false);
final ViewSashContainer container = (ViewSashContainer) vs.getContainer();
container.remove(vs);
container.add(vs, IPageLayout.LEFT, 0.3f, null);
DefaultTabFolder tf = (DefaultTabFolder) tp.getTabFolder();
tf.addListener(new TabFolderListener(){
@Override
public void handleEvent(TabFolderEvent e) {
System.out.println(e.type);
//TabFolderEvent.EVENT_MAXIMIZE;//7
//TabFolderEvent.EVENT_MINIMIZE;//5
if(5==TabFolderEvent.EVENT_MINIMIZE){
//container.remove(vs);
}
}}
);
转载于:https://www.cnblogs.com/xxonehjh/archive/2013/01/29/2880957.html