工作需要,debug了eclipse的drag&drop机制。整理出下图。
[img]http://dl.iteye.com/upload/attachment/170672/c3af05d0-56f6-32bf-bcb5-761f0cc3f818.jpg[/img]
eclipse已经把本地通信机制完全的封装起来。用户如果需要使用drag&drop功能,仅仅需要为目标control增加dragListener,DropListener和相应Transfer,一般来说eclipse提供的Transfer已经够用,例如FileTansfer,SimpleObjectTransfer,等等。
[img]http://dl.iteye.com/upload/attachment/170675/2d269687-9a36-3f30-8da4-3541e5de713f.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/170672/c3af05d0-56f6-32bf-bcb5-761f0cc3f818.jpg[/img]
eclipse已经把本地通信机制完全的封装起来。用户如果需要使用drag&drop功能,仅仅需要为目标control增加dragListener,DropListener和相应Transfer,一般来说eclipse提供的Transfer已经够用,例如FileTansfer,SimpleObjectTransfer,等等。
[img]http://dl.iteye.com/upload/attachment/170675/2d269687-9a36-3f30-8da4-3541e5de713f.jpg[/img]
本文探讨了Eclipse中drag and drop(拖放)功能的工作原理,并提供了详细的内部机制流程图。用户仅需为目标控件添加监听器及指定的数据传输类型即可实现拖放功能。
4万+

被折叠的 条评论
为什么被折叠?



