Copying Cutting Pasting in Papyrus

Introduction

Papyrus's policy is to ensure consistency between models and diagrams, so by default the cut/copy/paste functionalities act both on diagram and model elements. The Copy/Cut/Paste functionalities are available between models and diagrams but not between eclipse instances. The Cut/Paste functionalities are disable on root and read only elements.

User Interface

Model Explorer Menu

Right click on a model explorer element

Model Explorer KeyBinding

M1 is the COMMAND key on MacOS X, and the CTRL key on most other platforms.
M2 is the SHIFT key.

Diagram Menu

On a Diagram element Right Click>EDIT

Diagram KeyBinding

Preferences

Papyrus copy/paste/cut preferences is accessible on Window>Preferences>Papyrus>Paste The preference page lists all the available strategies and the checkbox to select whether the references should be kept.

List of Paste strategies

Common Strategies

Default Paste Strategy

The strategy paste all copied elements in the selected place. It is required for all other strategies.

SterotypeStrategy

The strategy reapplies profiles and stereotypes on the newly copied elements. Concerning the stereotype itself, several cases are possible for its properties:

Here, an illustration of this strategy, in the next model, we use the following profile.

Here, the initial state of the model.

Now the user selects these elements ( ClassToCopy, ClassRef1, ClassRef3, StereotypedClass1 and StereotypedClass3.

and paste them in the TargetPackage. The stars indicate the copied elements

As we can see in the previous image, the 5 elements have been copied in the TargetPackage and the required stereotypes have been applied. The values of the StereotypeWithReferences have been updated to reference the pasted elements. The updated element

Preferences

Rename Strategy

Diagram in Model Explorer Strategy

The strategy allows copy/paste for diagrams in model explorer. Several usecases have been implemented. The first thing to know is that a Diagram has 2 contexts:

The copy/paste of diagram follows these rules:

Here, the implemented usecases for a Copy/Paste in the ModelExplorer, with the previous model in snapshot as initial values: Diagram#rootElement= Class1 and Diagram#owner= Package1.

Table in model Explorer Strategy

The strategy allows copy/paste for tables in model explorer.

Uml Strategies

The following strategies will only apply on uml models

Constraint Paste Strategy

This strategy works only on uml class diagrams. It draws the constraint "context" link after a paste.

Sysml Strategies

The following strategies will only apply on sysml models

Part Paste Strategy

This strategy duplicates the linked association for each property pasted.