|How to Interface Diagram Editor Drag and Drop [message #1790165]
||Wed, 06 June 2018 11:35
| Tom Strong
Registered: June 2018
I work on OpenCPI producing a UI for framework operation. We're using sapphire to create XML editors using both the forms and Diagram capability. |
I have produced our own view for framework assets and I want to be able to drag and drop elements from that view into the diagram. We've implemented the ability to do so using the Eclipse Project Explore view.
Doing a little more digging. Revising post.
I've now seen an example that does the drag source event processing. In it I see the LocalSelectionTransfer singleton carries the selection information. This information is an ISelection. ISelection is a base interface of a structured viewer item. I am using a Tree in my presentation. It looks like I need to implement it as a TreeViewer. Am I correct?
Now I need to know how a file selection in Project Explorer is setup. I assume one of the following 3 is carried in the selection data (get/setData()): IFile, IPath, or the path to the file as a string.
- I need to know what the needs to be done in setting up my dragSource and DragSourceListener.
- I've found that LocalSelectionTransfer is used and I've gotten the ObjectsTransferDropTargetListener handleDragOver method to be called. I discovered this when I set my DragSource to use the LocalSelectionTransfer in the types array.
- I see that in my (current) DragAndDropService that a Context is passed in and an IFile is pulled off. Prior Event processing is obscured.
Thanks for your help,
[Updated on: Mon, 11 June 2018 19:37]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02457 seconds