Custom Drag Source for container drop tool [message #1406879] |
Mon, 11 August 2014 06:45  |
Eclipse User |
|
|
|
Hi,
I have a custom view containing a TreeViewer composed of EObjects. I would like to drag these items from my treeviewer and drop them into my Sirius Editor.
Could someone give me a hint to get started ? which class should I customize, any extension points available, etc. ?
regards,
Benoit
|
|
|
|
|
|
|
|
|
|
Re: Custom Drag Source for container drop tool [message #1748403 is a reply to message #1747381] |
Tue, 22 November 2016 14:31  |
Eclipse User |
|
|
|
Is the Sirius editor only listening to drag events from model explorer-based views? It's critical to know the type of drag source listener or view that Sirius is expecting. For example, does my CNF-based tree view need to somehow extend the model explorer view or a related extension point to be recognized?
My customer only wants access to specific elements in the semantic model and does not care about any of the modeling project, design and session overhead - which is why I have a simplified tree view. This view is initialized to a semantic resource from the Sirius session. My content provider abstracts which EMF elements we want the user to see. The leaf nodes in the tree are EObjects.
When I select and drag an EObject "leaf" from this tree view into the Sirius editor, I get a visual indication that a drag is in progress (e.g. the (+) appears with the drag). The drop doesn't get recognized, however, and there's no indication that the drag target is recognized as a valid element type. There's no log or error - the drop just fails silently. I successfully used a drag-and-drop from within the Sirius editor, so we're familiar with the design syntax for this operation.
The Sirius content providers (e.g. SessionWrappedContentProvider) accept EMF objects as valid elements to be returned from its model explorer, so I don't see anything fundamentally "wrong" about my tree view's content. Do I have to extend the Sirius model explorer view for my view's drag events to be registered?
|
|
|
Powered by
FUDForum. Page generated in 0.05974 seconds