Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348673 - [diagram] Problem with drop action handler API
Summary: [diagram] Problem with drop action handler API
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Shenxue Zhou CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 341518
  Show dependency tree
 
Reported: 2011-06-07 22:58 EDT by Konstantin Komissarchik CLA
Modified: 2021-11-19 09:21 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Komissarchik CLA 2011-06-07 22:58:11 EDT
I ran into problems trying to implement a sample of drop action handler. It looks like drop action handlers must implement SapphireDiagramDropActionHandler, which has a newModelElement( Object ) -> IModelElement method. 

There are two problems with this:

1. The action handler's execute method isn't called.

2. The newModelElement method assumes that one drop corresponds to one element/node. In my case I am trying to drop a file that has a list of cities. One drop should produce N elements/nodes.

I believe a better approach would be to pass requisite information (what is being dropped and location of the drop) into the handler's execute method via a subclass of SapphireRenderingContext. The action handler should take on the responsibility for creating elements, node parts and positioning them on canvas. 

The problem is similar to the Add action and resolution of these should probably be done concurrently.
Comment 1 Shenxue Zhou CLA 2011-06-16 18:34:16 EDT
The drop action handler has been reworked. There is only one drop action handler per diagram page. It should use DiagramRendingContext passed into run() method to get the object to be dropped and mouse location.
Comment 2 Konstantin Komissarchik CLA 2011-06-17 14:27:02 EDT
Looks good. Closing.