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

          常用鏈接

          留言簿(14)

          隨筆檔案(6)

          文章分類(467)

          文章檔案(423)

          相冊(cè)

          收藏夾(18)

          JAVA

          搜索

          •  

          積分與排名

          • 積分 - 825085
          • 排名 - 49

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

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

          解決方法:

          原來(lái)是設(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 閱讀(2415) 評(píng)論(4)  編輯  收藏 所屬分類: eclipse RCP

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

          這樣eclipse 每次才會(huì)運(yùn)行最新的程序  回復(fù)  更多評(píng)論
            
          # re: 通過(guò)RCP創(chuàng)建的view,怎樣直接顯示出來(lái) 2013-12-23 23:41 北大天網(wǎng)
          @chenliufang
          clean之后還是不能顯示新添加的view  回復(fù)  更多評(píng)論
            
          主站蜘蛛池模板: 卢龙县| 汉川市| 萍乡市| 突泉县| 浏阳市| 宜君县| 新平| 武山县| 吐鲁番市| 岱山县| 镇沅| 安阳县| 桦南县| 安西县| 周口市| 五原县| 西峡县| 乐都县| 铁岭市| 兴文县| 伊吾县| 五大连池市| 镇沅| 武川县| 阿拉善左旗| 上思县| 当雄县| 清涧县| 山东| 泽普县| 蒲城县| 察哈| 阿克| 大荔县| 古丈县| 石狮市| 博客| 万山特区| 台山市| 宁武县| 玉林市|