简体   繁体   English

Eclipse插件编辑器

[英]Eclipse plugin editor

I want to create an editor in eclipse (as eclipse plug-in), for a java class that implement some interfaces i created. 我想在eclipse中创建一个编辑器(作为eclipse插件),用于实现我创建的一些接口的java类。 The editor will let the user edit some information (using a form) that will be put into the java class. 编辑器将允许用户编辑将放入java类的一些信息(使用表单)。 - very much like in EJB editor. - 非常像EJB编辑器。 I want java files that implement this interface to open the editor. 我想要实现此接口的java文件来打开编辑器。

  1. How can I replace the values in the class without the need to re-generate it (because the user might have edited some of the source code in the class)? 如何在不需要重新生成类的情况下替换类中的值(因为用户可能已经编辑了类中的一些源代码)?
  2. How can I link the editor to open just some java files? 如何链接编辑器以打开一些java文件?

Thank you. 谢谢。

Use the JDT to get access to the java class and change parts of its contents using the AST of the java class. 使用JDT来访问java类,并使用java类的AST更改其内容的一部分。

Maybe this article will help you. 也许这篇文章会对你有帮助。

1) I suggest that you read Eclipse documentation in details as I don't think that it will be trivial. 1)我建议您详细阅读Eclipse文档,因为我认为它不会是微不足道的。 2) I suppose that Eclipse has some mime-type associations API, so you'd just use that. 2)我认为Eclipse有一些mime类型关联API,所以你只需使用它。

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

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