从插件/RCP中取得文件路径的方法
来源:互联网 发布:java入门基础知识书籍 编辑:程序博客网 时间:2024/05/19 16:35
从插件中获得绝对路径:
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);
URL fullPathString = BundleUtility.find(bundle, filePath);
得到Appliaction workspace:
从编辑器来获得编辑文件
IEditorPart editor = ((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();
IEditorInput input = editor.getEditorInput();
if(input instanceof IFileEditorInput){
IFile file = ((IFileEditorInput)input).getFile();
}
IEditorInput input = editor.getEditorInput();
if(input instanceof IFileEditorInput){
IFile file = ((IFileEditorInput)input).getFile();
}
Platform.asLocalURL(PRODUCT_BUNDLE.getEntry("")).getPath()).getAbsolutePath();
得到runtimeworkspace:
Platform.getInstanceLocation().getURL().getPath();
- 从插件/RCP中取得文件路径的方法
- 从插件/RCP中取得文件路径的方法
- 从插件/RCP中取得文件路径的方法
- 从插件/RCP中取得文件路径的方法
- 从插件/RCP中取得文件路径的方法
- 从插件/RCP中取得文件路径的方法
- 关于VB中用DIR函数,从完整的文件路径中取得文件名的方法
- Eclipse RCP 文件路径相关的方法
- Eclipse插件/RCP中取路径方法综合篇
- java中取得上下文路径的方法
- path2ClassLoader 提供了两个方法用于从装载的类路径中取得资源:
- RCP应用程序中读文件的路径问题
- eclipse rcp项目中获取相对路径的方法
- Delphi从路径取得文件名的简易方法
- RCP程序中集成其他插件的配置方法
- Eclipse RCP 插件开发中经常调用的几个方法
- Eclipse RCP 插件开发中经常调用的几个方法
- rcp(插件开发)RCP中控制Editor不重复打开的方法
- 用时查查,ORACLE各个服务的作用描述
- 关于Collection、Map接口!~~~~~~~
- DB2恢复数据库命令
- 在DIV+CSS中display这个属性使用方法
- 乐鱼影音盒--第一播放平台
- 从插件/RCP中取得文件路径的方法
- 在web应用中统一使用UTF-8的关键点
- 寻求帮助
- 人生就象卫生纸、没事尽量少扯!(太他妈逗了)
- 十年总结(20):售前养成计划(下) - 辽沈战役
- tomcat之内存溢出两张情况
- 日记090823
- PHP:设置文件下载对话框的文件名
- C++入门解惑——浅析cout