隨筆 - 6  文章 - 129  trackbacks - 0
          <2013年12月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 828832
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          新創建的VIEW已經加到透視圖中,但是打開程序時就是不顯示相應的視圖.

          解決方法:

          原來是設置了這個導致的

          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 閱讀(2430) 評論(4)  編輯  收藏 所屬分類: eclipse RCP

          FeedBack:
          # re: 通過RCP創建的view,怎樣直接顯示出來[未登錄] 2013-03-19 10:22 可可
          package com.checkout.view;

          import org.eclipse.swt.widgets.Composite;
          import org.eclipse.ui.part.ViewPart;
          import org.eclipse.swt.widgets.Text;
          import org.eclipse.swt.SWT;

          public class CheckoutView extends ViewPart {
          private Text text;

          public CheckoutView() {
          // TODO Auto-generated constructor stub
          }

          @Override
          public void createPartControl(Composite parent) {

          text = new Text(parent, SWT.BORDER);
          text.setText("sssss");
          // TODO Auto-generated method stub

          }

          @Override
          public void setFocus() {
          // TODO Auto-generated method stub

          }

          }
          perspective.java中也添加的view
          package checkout;

          import org.eclipse.ui.IPageLayout;
          import org.eclipse.ui.IPerspectiveFactory;

          public class Perspective implements IPerspectiveFactory {

          public void createInitialLayout(IPageLayout layout) {
          String editorArea = layout.getEditorArea();
          layout.addView("com.Checkout.view1", IPageLayout.TOP,
          IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);
          }
          }
          運行結果還是顯示不出來  回復  更多評論
            
          # re: 通過RCP創建的view,怎樣直接顯示出來 2013-07-11 10:06 luoding
          還是沒有出來哦,但是打包后可以出來,不過和configurer.setSaveAndRestore(true);
          無關  回復  更多評論
            
          # re: 通過RCP創建的view,怎樣直接顯示出來 2013-12-17 16:06 chenliufang
          @可可
          run ->configurations->要運行的應用->clear 勾上

          這樣eclipse 每次才會運行最新的程序  回復  更多評論
            
          # re: 通過RCP創建的view,怎樣直接顯示出來 2013-12-23 23:41 北大天網
          @chenliufang
          clean之后還是不能顯示新添加的view  回復  更多評論
            
          主站蜘蛛池模板: 蕉岭县| 怀远县| 巩留县| 雷山县| 清丰县| 时尚| 乌鲁木齐市| 永川市| 祁门县| 碌曲县| 台安县| 灌南县| 江津市| 剑川县| 南岸区| 缙云县| 祁东县| 曲松县| 桃源县| 长汀县| 德令哈市| 河间市| 融水| 巴青县| 上杭县| 个旧市| 黎川县| 峨眉山市| 广州市| 阿瓦提县| 丰城市| 云龙县| 磴口县| 淳安县| 富顺县| 黔江区| 蒲城县| 资中县| 安塞县| 宽城| 玉溪市|