如何将外部资源包含到Eclipse中的WorkingSet中

huangapple 未分类评论46阅读模式
标题翻译

How to include an external resource to WorkingSet in Eclipse

问题

我正在开发一个与自定义工作集一起使用的Eclipse插件。这些工作集可以包含来自工作区的项目,还可以包含用户通过向导选择的外部项目。

在选择文件夹后,我的插件将返回一个具有文件夹路径的java.io.File。现在,我想将此文件夹作为资源添加到我的自定义工作集中。目前,将元素添加到工作集的操作是通过向List<IAdaptable>添加IAdaptable的实例来完成的,然后将该列表提供给IWorkingSetManager,因此将File转换为类似IResourceIFolder的对象应该可以实现。所以我的问题是,如何使我的java.io.File变为IAdaptable

英文翻译

I'm developing an Eclipse Plug-in that is working with custom working sets. Those working sets can contain projects from the workspace but also external projects which are selected by the user through a wizard.

After selecting a folder, my plugin returns a java.io.File with the path of the folder. Now I'd like to add this folder as a resource to my custom working set. Right now adding elements to working-sets works by adding instances of IAdaptable to a List&lt;IAdaptable&gt;, which is then given to the IWorkingSetManager, so casting/converting the File to something like IResource or IFolder should work. So my question is, how do I make my java.io.File IAdaptable?

huangapple
  • 本文由 发表于 2020年3月16日 21:45:38
  • 转载请务必保留本文链接:https://java.coder-hub.com/60707157.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定