SWT: Internal object with drag and drop

My application has a canvas and a table, I need to add drag and drop capabilities to it. However, I read in a tutorial that Transfer converts the data that I want to move to a platform-independent type. I do not need to drag anything outside of my program, and it is important that the exact object is sent. How can I do that?

+3
source share
1 answer

Ok, I figured it out. Obviously, you can use some kind of dummy transfer object and save the objects you want to move into your own variable. Define the variable when you start dragging (from DragSource) and get the element from the variable in DropTarget. Just ignore the dummy transfer object.

+2
source

Source: https://habr.com/ru/post/1793745/


All Articles