隨筆 - 6  文章 - 129  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 827222
          • 排名 - 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 閱讀(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);
          }
          }
          運行結(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ù)  更多評論
            
          主站蜘蛛池模板: 崇义县| 阿拉善右旗| 景宁| 南平市| 舒城县| 虎林市| 荣昌县| 石楼县| 重庆市| 武清区| 京山县| 古浪县| 大港区| 两当县| 天柱县| 七台河市| 左权县| 韶山市| 连平县| 信阳市| 文登市| 清水河县| 遵化市| 平江县| 广宗县| 贞丰县| 咸阳市| 株洲市| 如东县| 田阳县| 兴化市| 石门县| 边坝县| 砀山县| 三台县| 乐至县| 丹巴县| 芷江| 托里县| 涞源县| 临江市|