獨(dú)自等待
          那曾經(jīng)從自己身邊溜走的人……
          posts - 0,comments - 3,trackbacks - 0
          從插件中獲得絕對(duì)路徑:    
          AaaaPlugin.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath());  
          通過文件得到Project:
          IProject project = ((IFile)o).getProject();  
          通過文件得到全路徑:
          String path = ((IFile)o).getLocation().makeAbsolute().toFile().getAbsolutePath();   
          得到整個(gè)Workspace的根:
          IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();   
          從根來查找資源:
          IResource resource = root.findMember(new Path(containerName));   
          從Bundle來查找資源:
          Bundle bundle = Platform.getBundle(pluginId);    
          URL fullPathString 
          = BundleUtility.find(bundle, filePath);  
          從編輯器來獲得編輯文件
          IEditorPart editor = ((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();    
          IEditorInput input 
          = editor.getEditorInput();    
          if(input instanceof IFileEditorInput){    
            IFile file 
          = ((IFileEditorInput)input).getFile();    
          }
             
          得到runtimeworkspace:
          Platform.getInstanceLocation().getURL().getPath();   
          得到Appliaction workspace:
          Platform.asLocalURL(PRODUCT_BUNDLE.getEntry("")).getPath()).getAbsolutePath();   


          posted on 2008-11-20 19:39 自由 閱讀(605) 評(píng)論(0)  編輯  收藏 所屬分類: Eclipse

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 平乐县| 岳阳县| 淄博市| 武隆县| 汝州市| 岑巩县| 济源市| 大姚县| 山西省| 兴业县| 剑川县| 唐山市| 隆子县| 蕉岭县| 揭西县| 庆元县| 苏尼特右旗| 辽阳市| 金昌市| 泸西县| 南召县| 靖宇县| 丹凤县| 开封县| 海门市| 甘泉县| 新余市| 华阴市| 利津县| 宜良县| 桐庐县| 凯里市| 昌邑市| 黄平县| 冀州市| 苏尼特右旗| 定安县| 扶绥县| 宜都市| 长垣县| 贺州市|