通过eclipse插件访问项目构建路径 [英] Access project build path through an eclipse plugin

查看:141
本文介绍了通过eclipse插件访问项目构建路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式检查项目的构建路径是否已经包含指定的库。这是一个快速修复提案,要知道这是否已经修复,不能成为问题。

I need to programmatically check if a project's build path already contains a specified library. It's for a quick fix proposal, to know if this was already "fixed" and cannot be the problem.

我可以访问当前的 IInvocationContext ,因此(围绕某些角落)到相应的 IProject 对象。

I have access to the current IInvocationContext, and therefore (around some corners) to the corresponding IProject object.

我可以检查哪些库在其构建路径中被引用?

How can I check which libraries are referenced in its build path already?

推荐答案


  1. 使用JavaCore .core)从IProject创建一个IJavaProject(使用create()方法)。这个IJavaProject是一个能够回答关于项目的java环境问题的IProject。

  2. IJavaProject有几种可用于查询项目类路径的findType()方法。

我会留下,但如果您需要更多信息,请告知我。

I'll leave it at that, but let me know if you need more info.

这篇关于通过eclipse插件访问项目构建路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆