獨(dú)自等待
          那曾經(jīng)從自己身邊溜走的人……
          posts - 0,comments - 3,trackbacks - 0
          從插件中獲得絕對路徑:    
          AaaaPlugin.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath());  
          通過文件得到Project:
          IProject project = ((IFile)o).getProject();  
          通過文件得到全路徑:
          String path = ((IFile)o).getLocation().makeAbsolute().toFile().getAbsolutePath();   
          得到整個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 自由 閱讀(607) 評論(0)  編輯  收藏 所屬分類: Eclipse
          主站蜘蛛池模板: 郸城县| 浑源县| 兴城市| 淅川县| 赤水市| 叶城县| 大埔县| 金川县| 漾濞| 郎溪县| 闽清县| 江都市| 渑池县| 奉贤区| 怀柔区| SHOW| 家居| 霍城县| 巫山县| 恩施市| 来安县| 南和县| 宜宾市| 常州市| 广宗县| 石门县| 海伦市| 小金县| 迁安市| 金坛市| 从化市| 玛曲县| 长垣县| 浪卡子县| 沁水县| 柘荣县| 义乌市| 吉首市| 潼南县| 汉寿县| 莱西市|