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

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827168
          • 排名 - 49

          最新評論

          閱讀排行榜

          評論排行榜

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

          這樣eclipse 每次才會運行最新的程序  回復  更多評論
            
          # re: 通過RCP創(chuàng)建的view,怎樣直接顯示出來 2013-12-23 23:41 北大天網
          @chenliufang
          clean之后還是不能顯示新添加的view  回復  更多評論
            
          主站蜘蛛池模板: 宝坻区| 通化县| 聂荣县| 海伦市| 蓬安县| 沅陵县| 常州市| 伽师县| 砚山县| 聂拉木县| 灵丘县| 通城县| 昭通市| 彭水| 凤阳县| 温泉县| 韩城市| 淳化县| 富平县| 珲春市| 双城市| 西城区| 新龙县| 永州市| 郁南县| 阿鲁科尔沁旗| 祁东县| 建阳市| 赤城县| 伊吾县| 弋阳县| 吉木萨尔县| 祁东县| 墨江| 东城区| 辽阳县| 弋阳县| 溧水县| 铜鼓县| 湖南省| 高陵县|