gpt4 book ai didi

eclipse-rcp - 在 Eclipse API 中,如何从位于项目或工作区之外的文件中获取 IFile

转载 作者:行者123 更新时间:2023-12-01 09:11:27 25 4
gpt4 key购买 nike

我想创建 IFile 接口(interface)来打开位于项目或工作区之外的文件。

如何获取IFile接口(interface)?

问候,西蒙

最佳答案

http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_a_file_outside_the_workspace%3F

您可以创建一个链接资源:

IPath location = new Path(name);
IFile file = project.getFile(location.lastSegment());
file.createLink(location, IResource.NONE, null);

或者,如果您可以使用 EFS 接口(interface)(自 Eclipse 3.3 起),您可以使用它来代替 IFile。

关于eclipse-rcp - 在 Eclipse API 中,如何从位于项目或工作区之外的文件中获取 IFile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/624897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com