學無止境  
          日歷
          <2005年9月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678
          統計
          • 隨筆 - 9
          • 文章 - 0
          • 評論 - 2
          • 引用 - 0

          導航

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

           
          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 閱讀(589) 評論(0)  編輯  收藏 所屬分類: Eclipse Plugin
           
          Copyright © lucia Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 水城县| 巴林左旗| 烟台市| 丹寨县| 龙南县| 通化市| 浦北县| 乌兰浩特市| 北京市| 磴口县| 将乐县| 慈利县| 宁德市| 濮阳县| 抚州市| 洮南市| 兴安盟| 永清县| 改则县| 白玉县| 利辛县| 阿勒泰市| 射洪县| 南安市| 乐都县| 炎陵县| 兴城市| 三亚市| 大宁县| 三门峡市| 明水县| 无棣县| 肃南| 临江市| 驻马店市| 瑞丽市| 民勤县| 晋中市| 定远县| 灌云县| 汕头市|