简体   繁体   English

如何获得 IProject 属性

[英]How to get IProject Properties

In Eclipse, when you right click a project and go to Properties, you can see all the Properties for that project.在 Eclipse 中,当您右键单击一个项目并转到“属性”时,您可以看到该项目的所有属性。 I want to be able to retrieve these properties with my IProject .我希望能够使用我的IProject检索这些属性。 Is there a good way to do this?有没有好的方法可以做到这一点? I have looked into IResource and have been trying to figure out if I can use it to retrieve the properties.我查看了IResource并试图弄清楚是否可以使用它来检索属性。 The IResource API can be found here IResource API 可以在这里找到

Each property page in the properties is provided by a property page class.属性中的每个属性页都由一个属性页类提供。 This class can use any method that suits it to get the properties.这个类可以使用任何适合它的方法来获取属性。 So there is no general way to get all the properties.所以没有通用的方法来获取所有的属性。

You can study the source of an individual property page to see how it is getting the properties.您可以研究单个属性页的来源,以了解它是如何获取这些属性的。 However the API used may be an internal API which you should not use.但是,所使用的 API 可能是您不应使用的内部 API。

Use Eclipse Plugin Spy to find out which class is displaying a particular property page:使用Eclipse Plugin Spy找出显示特定属性页的类: 示例插件间谍

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

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