學(xué)無止境  
          日歷
          <2005年9月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678
          統(tǒng)計(jì)
          • 隨筆 - 9
          • 文章 - 0
          • 評(píng)論 - 2
          • 引用 - 0

          導(dǎo)航

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

           
          Recently I had a problem in converting java.io.File to IFile for external files. The external files sind the files which are not located in the eclipse workspace. So they are not eclipse "resources" and can not be converted into IFile instances. With the following code you can solve this problem:

                           IEditorInput input= createEditorInput(selectedFile);
                           String editorId= getEditorId(selectedFile);
                           IWorkbenchPage page= fWindow.getActivePage();
                           try {
                               page.openEditor(input, editorId);
                           } catch (PartInitException e) {
                               //EditorsPlugin.log(e.getStatus());
                           }

          This idea comes from org.eclipse.ui.internal.editors.text.OpenExternalFileAction. In this class you can also find the implementation for the methods "createEditorInput" and "getEditorId".
          posted on 2005-09-21 17:50 lucia 閱讀(586) 評(píng)論(0)  編輯  收藏 所屬分類: Eclipse Plugin
           
          Copyright © lucia Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 清丰县| 韶关市| 南康市| 赫章县| 马公市| 绍兴县| 丰都县| 延边| 鄢陵县| 田阳县| 错那县| 改则县| 贵阳市| 兴仁县| 合江县| 平顶山市| 华池县| 金阳县| 新郑市| 民权县| 林西县| 文水县| 雷波县| 鹰潭市| 财经| 醴陵市| 历史| 新乡市| 祁连县| 雷州市| 汤原县| 浪卡子县| 罗源县| 巴塘县| 西青区| 昌图县| 昌邑市| 衡山县| 西平县| 沂水县| 邓州市|