elipse中路径大全
来源:互联网 发布:mac版本的office 编辑:程序博客网 时间:2024/05/17 07:50
//得到运行是工程路径
Platform.getInstanceLocation().getURL().getPath();
[Java|Eclipse|RCP|Plugin]从插件/RCP中取得文件路径的方法[转载]
从插件中获得绝对路径:
MyPlugin.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);
得到Appliaction workspace:
Platform.asLocalURL(PRODUCT_BUNDLE.getEntry("")).getPath()).getAbsolutePath();
得到runtimeworkspace:
Platform.getInstanceLocation().getURL().getPath();
从编辑器来获得编辑文件:
IEditorPart editor = ((DefaultEditDomain)(parent.getViewer().getEditDomain())).getEditorPart();
IEditorInput input = editor.getEditorInput();
if(input instanceof IFileEditorInput){
IFile file = ((IFileEditorInput)input).getFile();
}
/** 刷新导航树
*/
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = (IResource)root.findMember(new Path("projects"));
IContainer container = (IContainer) resource;
container.refreshLocal(IResource.DEPTH_INFINITE,null);
- elipse中路径大全
- Elipse 快捷键大全
- Elipse中各种快捷键
- elipse中cvs环境配置
- Elipse中UTF-8设置
- elipse中批量导入项目
- 学习如何在elipse中配置tomcat
- 在elipse中安装tomcat插件
- Elipse中如何快速安装SVN?
- Elipse 插件开发中中加载图片的方法-1
- elipse中新建的xml在class文件中找不到
- elipse中新建tld标签库描述符文件
- elipse中配置jadclipe之后无法双击编译
- elipse中清理项目后R文件消失了
- Elipse中发布一个Maven项目到Tomcat
- Elipse中发布一个Maven项目到Tomcat
- iPhone 路径大全
- Apache 路径大全
- 对于clone在结点中的一点见解
- 最简单jmx示例
- UTF-8 and Unicode FAQ
- 设计模式:设计自己的MVC框架
- 从湖南大学可笑的四星比赛投票看公平
- elipse中路径大全
- Java的多进程运行模式分析
- rcp中日志处理-调用eclipsePDE中的日志视图
- 想想,做做
- Java对各种文件的操作详解
- 转:win2003的IIS设置方法
- jasperreport生成简单的报表
- OO设计模式和设计原则
- eclipse导出rcp时: 找不到应用程序标识。