新創(chuàng)建的VIEW已經(jīng)加到透視圖中,但是打開程序時(shí)就是不顯示相應(yīng)的視圖.
解決方法:
原來是設(shè)置了這個(gè)導(dǎo)致的
configurer.setSaveAndRestore(true);
代碼如下:
package com.act.mac.upload.intro;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
private static final String PERSPECTIVE_ID = "com.act.mac.upload.perspective";
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
//configurer.setSaveAndRestore(true);//注釋掉就OK了
}
public String getInitialWindowPerspectiveId() {
return PERSPECTIVE_ID;
}
}
posted on 2012-06-08 11:25
Ke 閱讀(2417)
評論(4) 編輯 收藏 所屬分類:
eclipse RCP