eclipse java 视图,Java源代码编辑器作为Eclipse视图

I have defined an EMF metamodel in which some elements have a String field which will contain some Java code.

I am trying to create/reuse a (Java) source code editor as part of the tabbed properties view to be able to edit that field with some IDE-like functionality. It would be great to adapt the JDT editor to use it here, but for I have read, it is not feasible. Extending org.eclipse.swt.widgets.Text to provide all that functionality seems to be too much of an overkill for this simple project.

Therefore, the question would be, which approach would you recommend as the best functionality/effort ratio to achieve this?, do you now of any source code editor which may be reusable as/within a view?

解决方案

Buddy...

This is really going to be a hard task.

Re-Using EditorParts in SWT widgets/ViewParts is not easy. The only thing that I got to manage was to reuse the EPF RichText-Widget which was designed for use as an EditorPart.

In that case it was easy, because it only needed an IEditorSite as a constructor parameter. I then extended it and adapted the IViewSite to an IEditorSite.

But concerning JDT: There is so much funcionality which is directly related to the Base-Text-Editor functionality from eclipses IEditorParts... I think it won't be worth the effort.

Could't you find a Java-IDE for Java-Code? Isn't there anything working with Swing/AWT?

You could then possibly include a Source-Code-Editor-Swing-Frame using a SWT_AWT-Brigde-Widget. This way I successfully integrated an Swing-PDF-Viewer into an eclipse ViewPart.

Take a look at the eclipse API desciption.

And as a first rough try for the Java IDE:

drJava

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值