Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339525 - Add information to IPasteContext so that a paste action can instantiate AddContexts relative to the mouse pointer location.
Summary: Add information to IPasteContext so that a paste action can instantiate AddCo...
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno M3 Theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 09:27 EST by Rhett Hudson CLA
Modified: 2012-06-28 10:44 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rhett Hudson CLA 2011-03-10 09:27:42 EST
Build Identifier: 20100917-0705

Currently, the position information available to guide the paste action in placing graphical representations includes whatever arrives from the clipboard and whatever is selected in the current diagram. This enables use cases like pasting at the same location as the copy, at an offset from the copy, at the location of the selection, at an offset from the selection, or replacement of the selection. 

I propose another use case: pasting at or at an offset from the location at the mouse pointer when the user issues the paste command. This is useful whether the paste operation occurs in the same diagram as the copy or a different diagram. It prevents the user from having to drag the pasted result an arbitrary distance across the diagram.

One way to achieve this is to add methods to IPasteContext that supply the target diagram, and the X and Y location of the mouse within that diagram. The paste() method could then optionally use this information to place its graphical representations.

Supplying the target diagram may be generally useful beyond this specific use case since acquiring it from the objects supplied by the getPictogramElements() method is something that every paste() method has to do and it is possible that it would be easier for the framework to do than for the client.

Reproducible: Always
Comment 1 Michael Wenz CLA 2011-07-18 07:05:29 EDT
Would like to target for Juno
Comment 2 Michael Wenz CLA 2011-10-06 10:32:06 EDT
The paste context is now also a LocationContext and provides the x and y coordinates of the paste location (right click location in case paste is triggered via context menu resp. cursor position in case of keyboard - at that location the menu is opened in this case as well).
The target diagram could already be retrieved via getDiagram defined in the AbstractFeature base class of DefaultPasteFeature.
Checked in to head and pushed to Eclipse.
commit 204c03948f84d847b1c2a38d686e6f82198a8fa3
Author: mwenz <michael.wenz@sap.com> 2011-10-06 15:49:33
Committer: mwenz <michael.wenz@sap.com> 2011-10-06 15:49:33
Parent: d8dfc13b1735b16de99369ab3d453105cade5dd1
Comment 3 Michael Wenz CLA 2012-04-11 10:38:48 EDT
Bookkeeping: Set target release
Comment 4 Michael Wenz CLA 2012-06-28 10:44:36 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)