创建可拖放的简单图形组件 RCP eclipse
我正在制作一个自动化工具。我选择 Eclipse RCP 来开发它。
我对java中的RCP/swings/UI创建几乎没有任何了解,但对核心java有很好的了解。
我按照互联网上的教程创建了一个简单的 RCP 应用程序,它有两个视图和一个简单的菜单。我已经获得了有关workbenchadvisor、actionbaradvisor、viewpart 以及dragdroplister 等基本知识的知识。
我想在一个视图上创建简单的图形组件,可以将其拖放到其他视图。
应该用什么来创建图形组件?摆动或其他东西..
以及如何实现该组件的拖放..
请帮助
感谢我为按钮创建拖放的回复。我可以使用 GEF 构建自己的图形,但是当我包含 org.eclipse.draw2d 包时在我的项目中。它的贯穿错误“缺少 constarint:导入包:org.eclipse.draw2d:version =“0.0.0”'有人可以告诉我会出现什么问题吗,我也有两种观点。我应该能够将我的人物移动到该视图中的任何位置。我知道这可以在透视图中完成,但不确定如何完成![alt text][1]
i am in a process of making an automation tool. I choose Eclipse RCP to develop that.
i have hardly any knowledge on RCP/swings/UI creation in java but good in core java.
I followed a tutorial from internet and created a simple RCP app which has two views and a simple menu. i have gained knowledge on the basic thing like workbenchadvisor,actionbaradvisor , viewpart and also on dragdroplister.
I want to create simple graphic components on one view which can be dragged and droppped to other view.
what should create the grphical components with ? swings or something else..
and how to implement the dragdrop for that components..
Please help
thanks for the reply i created drag and drop for buttons.i am able build my own figures using GEF but when i include org.eclipse.draw2d package in my project. its throughs error 'Missing constarint:Import Package:org.eclipse.draw2d:version="0.0.0" ' can some one tell me what would have gone wrong and also i have two views. i should be able to move my figures any where in that view. i know this can be done in perspectives but not sure how it can be done ![alt text][1]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,在开发 Eclipse RCP 应用程序时,您不使用 Swing。你使用SWT。
您可以使用 SWT Canvas 小部件来绘制图形。
由于您要拖放图形,因此您必须编写自己的拖放代码。
这里有一些可以帮助您开始使用 SWT 图形的内容:
图形上下文 - 快速绘制
SWT 片段 - 在“拖放”上进行查找。
First of all, when developing an Eclipse RCP application, you don't use Swing. You use SWT.
You use a SWT Canvas widget to draw graphics.
You're going to have to code your own drag and drop, since you're dragging and dropping graphics.
Here's something to get you started with SWT graphics:
Graphics Context - Quick on the draw
SWT Snippets - Do a find on "Drag and Drop".
我还要添加关于拖动的本教程并放入 SWT
根据您必须开发的图形的复杂性,我还建议评估 GEF 及其图形库 Draw2D:http:// www.eclipse.org/gef/
这个是关于Draw2D的简单教程
I'd also add this tutorial about Drag and Drop in SWT
Depending on the complexity of the graphics you have to develop I also suggest evaluating GEF and it's graphic library Draw2D: http://www.eclipse.org/gef/
This is a simple tutorial about Draw2D