简体   繁体   English

Eclipse插件开发:获取项目信息

[英]Eclipse Plug-in Development: get project infos

I'm new in the Eclipse plug-in development: i need to retrieve some info of the java project selected by the user such as: 我是Eclipse插件开发的新手:我需要检索用户选择的Java项目的一些信息,例如:

  • The number of classes 班数
  • The methods of each class 每节课的方法
  • The instance variables of each class 每个类的实例变量
  • The number of LOC of each class 各班的LOC数

My plug-in has to show the java project as a graph and calculate some metrics... but i am not familiar with Eclipse APIs 我的插件必须将Java项目显示为图形并计算一些指标...但是我对Eclipse API并不熟悉

Google the Javadoc for classes IProject, IContainer, IFolder, IFile and IWorkspaceRoot. Google针对类IProject,IContainer,IFolder,IFile和IWorkspaceRoot的Javadoc。 These classes collaborate together to give you most of the information you need. 这些课程共同协作,为您提供所需的大多数信息。

In the org.eclipse.jdt.core plugin look at the ASTParser that can take some Java source and hand back a parse tree in which you can find all of the methods, variables, etc. 在org.eclipse.jdt.core插件中,查看可以获取一些Java源代码的ASTParser并返回一个解析树,您可以在其中找到所有方法,变量等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM