浏览 1634 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-07-24
- this.getClass().getResources() but this way force you have to put your resources into src directory of Eclipse, this won't work under situation: your plugin is a pure library plugin, i.e. it hasn't src directory at all and it's not a java project, which hasn't java nature in its .project file A better solution I find is: Bundle myBundle = Platform.getBundle(MY_BUNDLE_ID); URL fileUrl = myBundle.getResource("/" + resourceName); it support: - your plugin can use any package style, say, as a jar, as a directory - your resource can locate in src or just resource directory 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |