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

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 825085
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

          新創(chuàng)建的VIEW已經(jīng)加到透視圖中,但是打開程序時就是不顯示相應(yīng)的視圖.

          解決方法:

          原來是設(shè)置了這個導(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 閱讀(2415) 評論(4)  編輯  收藏 所屬分類: eclipse RCP

          FeedBack:
          # re: 通過RCP創(chuàng)建的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);
          }
          }
          運行結(jié)果還是顯示不出來  回復(fù)  更多評論
            
          # re: 通過RCP創(chuàng)建的view,怎樣直接顯示出來 2013-07-11 10:06 luoding
          還是沒有出來哦,但是打包后可以出來,不過和configurer.setSaveAndRestore(true);
          無關(guān)  回復(fù)  更多評論
            
          # re: 通過RCP創(chuàng)建的view,怎樣直接顯示出來 2013-12-17 16:06 chenliufang
          @可可
          run ->configurations->要運行的應(yīng)用->clear 勾上

          這樣eclipse 每次才會運行最新的程序  回復(fù)  更多評論
            
          # re: 通過RCP創(chuàng)建的view,怎樣直接顯示出來 2013-12-23 23:41 北大天網(wǎng)
          @chenliufang
          clean之后還是不能顯示新添加的view  回復(fù)  更多評論
            
          主站蜘蛛池模板: 隆回县| 郯城县| 旬邑县| 延庆县| 盐源县| 镇平县| 邯郸县| 将乐县| 腾冲县| 策勒县| 尚志市| 双鸭山市| 上蔡县| 德令哈市| 金湖县| 龙游县| 信阳市| 泰顺县| 肃宁县| 唐山市| 旬邑县| 新野县| 敦化市| 陵水| 博罗县| 永春县| 都安| 治县。| 大名县| 莒南县| 韩城市| 荥经县| 陈巴尔虎旗| 锡林浩特市| 德格县| 竹北市| 建平县| 辽阳县| 宁国市| 南阳市| 邵阳市|