gpt4 book ai didi

java - 无法在 Eclipse 中使用 FileEditorInput 类

转载 作者:行者123 更新时间:2023-11-30 06:20:13 25 4
gpt4 key购买 nike

我正在处理一个 Eclipse 编辑器项目,我应该在其中获取编辑器中当前打开的文件的位置。我搜索了 Eclipse 文档以实际找到 FileEditorInput 类。但令我惊讶的是,我的项目无法在 Eclipse 中找到此类。怎么做到的?

最佳答案

FileEditorInputorg.eclipse.ui.part.FileEditorInput,但这仅在您打开编辑器时使用。查看现有编辑器的输入时,请使用 IFileEditorInput 接口(interface) (org.eclipse.ui.IFileEditorInput)。

编辑器的输入实际上定义为 IEditorInput,它是 IFileEditorInput 的扩展。如果编辑器正在工作区中编辑文件,它通常会使用 IFileEditorInput。编辑器还可以输入 IPathEditorInputIURIEditorInput

关于java - 无法在 Eclipse 中使用 FileEditorInput 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22164480/

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