首先,大家好(/world)!

我正在制作一个 Eclipse RCP 应用程序,需要检查一些 。特性 位于一些插件中,我在运行时知道谁的 ID。

我想知道是否有 简单的 阅读它们的方式,例如我知道在我的插件 *org.anyname.myplugins 中。我的插件那个岩石 我有一个名为 令人敬畏的属性.properties*,我如何打开它并使用类似 getter/setter 系统轻松读取它

String getInProperties(String fileNameOrPath,String myPropertieId)
void setInProperties(String fileNameOrPath,String myPropertieId,String myPropertieValue)
或者
String getInProperties(File file,String myPropertieId)
void setInProperties(File file,String myPropertieId,String myPropertieValue)
或者任何其他类型的意思,如果你明白我的意思的话......

预先感谢^^

有帮助吗?

解决方案

好吧,如果这些只是普通的旧财产,那么还有好的旧财产 资源包 这样就可以了。

但是,如果您想这样做,恕我直言,更干净一点,并且更加面向 Eclipse,我建议您创建一个使用 NLS 类的类,如下所示 在这里解释.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top