拖放图像
我想为我们的应用程序使用图像拖放。我从 http://www.vogella.de/articles/EclipseDragAndDrop 获得了一个示例应用程序/article.html。事实上它非常有用。但是除了 TextTransfer 之外,我还可以使用什么作为图像传输类型呢? 我找不到 ImageTransfer 作为图像拖放的传输类型。 我的要求是我需要将一个图像从一个视图拖动到另一个视图\编辑器。 是否有用于图像拖放的 ImageTransfer 类?我不知道。
I want to use image drag and drop for our application. I have got one sample application from the http://www.vogella.de/articles/EclipseDragAndDrop/article.html. It is very useful in fact. But instead of TextTransfer what could I use for transfer type for images?
I could not find out ImageTransfer as transfer type for image drag and drop.
My requirement is that I need to drag one image from one view to the another view\editor.
Is there any class for as ImageTransfer for image drag and drop? I could not find out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您同时实现编辑器和视图,则不必使用像 ImageTransfer 这样的本机传输类型,除非您想接受来自其他应用程序的 DnD。请改用 org.eclipse.jface.util.LocalSelectionTransfer,因为它允许轻松地将对象从一个 Eclipse 部分传递到另一部分。
如果您想接受来自其他应用程序/桌面的 DnD,FileTransfer 将是最佳选择。
干杯,
最大限度
If you implement both editor and view, you don't have to use native transfer types like ImageTransfer unless you want to accept DnD from other applications. Use org.eclipse.jface.util.LocalSelectionTransfer instead since it allow easily pass a object(s) from one Eclipse part into another.
In case you want to accept DnD from other applications/Desktop, FileTransfer would be the best choice.
Cheers,
Max