Bug 455753 - Redefine Sirius copy
Summary: Redefine Sirius copy
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-12-19 09:32 EST by Nathalie Lepine CLA
Modified: 2014-12-22 11:04 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathalie Lepine CLA 2014-12-19 09:32:31 EST
It could be great to have a copy operation with the paste operation in the odesign to specify what elements we want to copy and not just the DDiagramElement and DDiagramElement.getTarget.
For example, DDiagramElement.getTarget references could be copied too.
Comment 1 Pierre-Charles David CLA 2014-12-22 10:27:08 EST
The current behavior was a compromise with less flexibility to ensure more safety, in particular leaks when copy/pasting across different editing domains. But I agree it should be possible to be more open/configurable here.

It looks like the behavior in question is mostly isolated in SiriusClipboardGlobalActionHandler.getCopyCommand(), and in particular in extractDSelection() and extractSemanticSelection(). extractSemanticSelection() in particular could be more configurable than just taking each DSemanticDecorator's target. Maybe mappings could have an additional interpreted expression (somewhat similar to "Additional Semantic Elements") to return other elements than just the target to include in the copy. Would that solve your use case?
Comment 2 Nathalie Lepine CLA 2014-12-22 10:38:35 EST
yes, that solve it.
Comment 3 Pierre-Charles David CLA 2014-12-22 10:57:42 EST
Adding Maxime in CC, as he's the most knowledgeable in this area of Sirius and may have remarks on the solution I propose.
Comment 4 Pierre-Charles David CLA 2014-12-22 11:04:08 EST
Note that if we start to interpret user-supplied expressions inside getCopyCommand(), the actual copying code should be transfered during the command's execution, not during getCopyCommand() as it is right now, or it will slow down the whole diagram usage as soon as the selection contains a significant number of elements.