从eclipse插件访问项目目录

时间:2022-03-19 10:42:46

This is a question already asked by someone:

这是一个人已经提出的问题:

How can an Eclipse plugin access the project directory?

Eclipse插件如何访问项目目录?

The answer was good: using ResourcesPlugin.

答案很好:使用ResourcesPlugin。

But for some reason, under no circumstances will my Ganymede eclipse recognise the existence of org.eclipse.core.resources package which contains ResourcesPlugin.

但由于某种原因,在任何情况下我的Ganymede eclipse都不会认识到包含ResourcesPlugin的org.eclipse.core.resources包的存在。

Why is that?

这是为什么?

3 个解决方案

#1


0  

This is usually something to do with the Manifest:

这通常与清单有关:

  • is the package imported (Import-Package), or the bundle required (Require-Bundle) in your plugin.
  • 是导入的包(Import-Package),还是插件中需要的包(Require-Bundle)。

  • (sanity check) is the package exported by the source bundle (Export-Bundle).
  • (完整性检查)是源包(Export-Bundle)导出的包。

If both of these check out, then I would look at the target platform. A typical base install for RCP only does not include the resources bundle.

如果这两个都检查出来,那么我会看一下目标平台。 RCP的典型基本安装仅包括资源包。

#2


0  

(*) You might have specified a version constraint in the Manifest.MF for the dependency. And the available version is different. If so, remove the constraint or just click the Match in the Properties of the depedency

(*)您可能已在Manifest.MF中为依赖项指定了版本约束。可用的版本不同。如果是这样,请删除约束或只需单击依赖项属性中的匹配

(*) Check your target platform and verify whether this org.eclipse.core.resources plugin exists

(*)检查目标平台并验证是否存在此org.eclipse.core.resources插件

(*) If the error still persist, go to the Plug-ins tab in the launch configuration of your RCP. Check whether the o.e.c.resources is added. The Validate Plug-ins buttons should be helpful to determine any issues

(*)如果错误仍然存​​在,请转到RCP启动配置中的“插件”选项卡。检查是否添加了o.e.c.resources。验证插件按钮应有助于确定任何问题

#3


0  

Add the bundle org.eclipse.core.resources in your plugin dependencies. That should work just fine.

在插件依赖项中添加包org.eclipse.core.resources。这应该工作得很好。

#1


0  

This is usually something to do with the Manifest:

这通常与清单有关:

  • is the package imported (Import-Package), or the bundle required (Require-Bundle) in your plugin.
  • 是导入的包(Import-Package),还是插件中需要的包(Require-Bundle)。

  • (sanity check) is the package exported by the source bundle (Export-Bundle).
  • (完整性检查)是源包(Export-Bundle)导出的包。

If both of these check out, then I would look at the target platform. A typical base install for RCP only does not include the resources bundle.

如果这两个都检查出来,那么我会看一下目标平台。 RCP的典型基本安装仅包括资源包。

#2


0  

(*) You might have specified a version constraint in the Manifest.MF for the dependency. And the available version is different. If so, remove the constraint or just click the Match in the Properties of the depedency

(*)您可能已在Manifest.MF中为依赖项指定了版本约束。可用的版本不同。如果是这样,请删除约束或只需单击依赖项属性中的匹配

(*) Check your target platform and verify whether this org.eclipse.core.resources plugin exists

(*)检查目标平台并验证是否存在此org.eclipse.core.resources插件

(*) If the error still persist, go to the Plug-ins tab in the launch configuration of your RCP. Check whether the o.e.c.resources is added. The Validate Plug-ins buttons should be helpful to determine any issues

(*)如果错误仍然存​​在,请转到RCP启动配置中的“插件”选项卡。检查是否添加了o.e.c.resources。验证插件按钮应有助于确定任何问题

#3


0  

Add the bundle org.eclipse.core.resources in your plugin dependencies. That should work just fine.

在插件依赖项中添加包org.eclipse.core.resources。这应该工作得很好。