Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2016-06-21 13:50:05 +0000
committerLaurent Redor2016-06-24 15:54:30 +0000
commit818037cab466c47e60983061d80246a224d862c0 (patch)
treea3a0b7f52aa71457996a1dd02f27f55d37818383
parent00392405793fe522b104537cd28e05250f00fcd3 (diff)
downloadorg.eclipse.sirius-818037cab466c47e60983061d80246a224d862c0.tar.gz
org.eclipse.sirius-818037cab466c47e60983061d80246a224d862c0.tar.xz
org.eclipse.sirius-818037cab466c47e60983061d80246a224d862c0.zip
[496466] Add specification
Bug: 496466 Change-Id: I4f35e14cac6ebe627cd269ce884f63aede9399b8 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs1
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/491895_paste_special/images/copyPasteMenu.pngbin4256 -> 6296 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.html250
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.textile145
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/ApplyAppearanceProperties.pngbin0 -> 1166 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyLayout.gifbin0 -> 413 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyPasteMenu.pngbin0 -> 5112 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/layoutDataMMChanges.pngbin0 -> 20365 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayout.gifbin0 -> 598 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayoutStyle.pngbin0 -> 1207 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteStyle.pngbin0 -> 1207 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarCopy.pngbin0 -> 987714 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarPaste.pngbin0 -> 69626 bytes
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/.project11
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/copyPasteMenu.screen40
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/tabbarPasteLayoutStyle.screen15
-rw-r--r--plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/tabbar.xcfbin0 -> 462327 bytes
17 files changed, 462 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs
index 0787b61c5d..5472bd8271 100644
--- a/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.sirius.doc/.settings/org.eclipse.core.resources.prefs
@@ -22,4 +22,5 @@ encoding//specs/proposal/440296_Required_side_for_border_nodes/440296_Required_s
encoding//specs/proposal/459993_VSM_Internationalization/VSM_Internationalization.html=utf-8
encoding//specs/proposal/490360_SnapToShapeForBorderNodes/490360.html=UTF-8
encoding//specs/proposal/491895_paste_special/491895.html=UTF-8
+encoding//specs/proposal/496466_extendCopyPasteLayout/496466.html=UTF-8
encoding//specs/proposal/connections_to_figure_border/connections_between_figures_borders_and_edges.html=utf-8
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/491895_paste_special/images/copyPasteMenu.png b/plugins/org.eclipse.sirius.doc/specs/proposal/491895_paste_special/images/copyPasteMenu.png
index 5d8f75e991..4d3224de33 100644
--- a/plugins/org.eclipse.sirius.doc/specs/proposal/491895_paste_special/images/copyPasteMenu.png
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/491895_paste_special/images/copyPasteMenu.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.html b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.html
new file mode 100644
index 0000000000..05f6e38484
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.html
@@ -0,0 +1,250 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ </head>
+ <body>
+ <h1 id="SiriusEvolutionSpecificationExtendcopypastelayoutfeaturewithstylenotions">Sirius Evolution Specification: Extend copy/paste layout feature with style notions</h1>
+ <h2 id="Preamble">Preamble</h2>
+ <p>
+ <em>Summary</em>: Have the capability to also paste style along with the layout.
+ </p>
+ <table>
+ <tr>
+ <th>Version</th>
+ <th>Status</th>
+ <th>Date</th>
+ <th>Authors</th>
+ <th>Changes</th>
+ </tr>
+ <tr>
+ <td>v0.1</td>
+ <td>DRAFT</td>
+ <td>2016-06-22</td>
+ <td>lredor</td>
+ <td>Initial version.</td>
+ </tr>
+ <tr>
+ <td>v0.2</td>
+ <td>DRAFT</td>
+ <td>2016-06-23</td>
+ <td>lredor</td>
+ <td>Add improvement and limitations.</td>
+ </tr>
+ <tr>
+ <td>v0.3</td>
+ <td>PROPOSED</td>
+ <td>2016-06-23</td>
+ <td>lredor</td>
+ <td>Internal review.</td>
+ </tr>
+ </table>
+ <p>
+ <em>Relevant tickets</em>:
+ </p>
+ <ul>
+ <li>
+ <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=496466">Bug 496466 &#8211; Extend copy/paste layout feature with style notions</a>
+ </li>
+ </ul>
+ <h2 id="Introduction">Introduction</h2>
+ <p>Currently there are two kinds of copy/paste in Sirius:</p>
+ <ul>
+ <li>The
+ <a href="http://www.eclipse.org/sirius/doc/user/diagrams/Diagrams.html#Copypasteoflayout">copy/paste layout</a> copies the location and size of elements of a source diagram and pastes them to elements of a target diagram. By default, the layout is applied on graphical elements representing the same semantic element (same
+ <code>target</code> reference of
+ <code>DSemanticDecorator</code>). It is possible to apply specific rules for matching between source semantic elements and target semantic elements with the
+ <code>org.eclipse.sirius.diagram.ui.layoutDataManager</code> extension point.
+ </li>
+ <li>The standard copy/paste allows to copy and paste the semantic elements. The paste action can be customized by a
+ <a href="http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#paste_description">paste tool</a> in the VSM on the receiver. Contrary to the copy/paste layout, the standard copy/paste is also possible by using the same diagram for copy and paste.
+ </li>
+ </ul>
+ <p>In addition to these, there is also an
+ <em>Apply Appearance Properties</em> action <img src="images/ApplyAppearanceProperties.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/> that allows to copy all common style attributes from the last selected shapes to all other selected shapes.
+ </p>
+ <p>The goal of this evolution is to have a copy/paste format feature (in replacement of the existing copy/paste layout feature). This new feature extends the copy/paste layout feature with the style notions (with the same behavior as
+ <em>Apply Appearance Properties</em> action). The standard copy/paste mechanism is not impacted in any way by this change.
+ </p>
+ <h2 id="DetailedSpecification">Detailed Specification</h2>
+ <p>The user interaction will be the same as the current
+ <em>copy/paste layout</em> feature. As a reminder, currently the end-user must:
+ </p>
+ <ul>
+ <li>Select the source elements in a diagram</li>
+ <li>Copy the layout (Ctrl+Alt+Shift+C, or contextual menu
+ <code>Edit/Copy layout</code>, or corresponding icon in tab-bar <img src="images/copyLayout.gif" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>)
+ </li>
+ <li>Select the target elements, or the container of these elements, in another diagram</li>
+ <li>Paste the layout (Ctrl+Alt+Shift+V, or contextual menu
+ <code>Edit/Paste layout</code>, or corresponding icon in tab-bar <img src="images/pasteLayout.gif" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>)
+ </li>
+ </ul>
+ <p>The feature will be renamed in
+ <code>Copy/Paste Format</code>. There is one action for
+ <em>Copy</em> and 3 actions for
+ <em>Paste</em>:
+ </p>
+ <ul>
+ <li>Paste Format (ie Layout and Style)</li>
+ <li>Paste Layout Only</li>
+ <li>Paste Style Only</li>
+ </ul>
+ <h3 id="PasteLayoutOnly">Paste Layout Only</h3>
+ <p>The
+ <em>Paste Layout Only</em> action is equivalent to the current behavior when the user calls the
+ <em>Paste Layout</em> action.
+ </p>
+ <h3 id="PasteStyleOnly">Paste Style Only</h3>
+ <p>The
+ <em>Paste Style Only</em> action will replicate the style, by default, on graphical elements representing the same semantic element (same
+ <code>target</code> reference of
+ <code>DSemanticDecorator</code>). All the source elements style properties (customized or not) will be applied to the target elements as custom styles if they are different than the default ones. That means, for example, if the copied element background is different from the one to paste, the background will appear as a custom feature. If the background is the same, nothing is modified.
+ <br/>The paste style will have a similar behavior to the
+ <em>Apply Appearance Properties</em> action, but with a different workflow.
+ </p>
+ <p>It will be also possible to use the same extension point as for
+ <em>Paste Layout</em> action to customize the matching between source elements and target elements.
+ </p>
+ <h3 id="PasteFormat">Paste Format</h3>
+ <p>This action is a combination of both above actions. The layout and the style will be pasted.</p>
+ <h3 id="UI">User Interface</h3>
+ <p>To default paste behavior, when called from the keyboard shortcut, will be a paste format (layout and style). In the tab-bar and in the contextual menu, there is the possibility to launch the 3 kinds of paste.</p>
+ <p>
+ <img border="0" src="images/copyPasteMenu.png"/>
+ <br/>This sketch shows the future menu.
+ </p>
+ <p>
+ <img border="0" src="images/tabbarCopy.png"/>
+ <br/>
+ <code>Copy Format</code> button in tab-bar
+ </p>
+ <p>
+ <img border="0" src="images/tabbarPaste.png"/>
+ <br/>
+ <code>Paste</code> buttons in tab-bar. All 3 actions are represented with a drop-down button. At the opening of a diagram, the action
+ <code>Paste Format</code> is the default one. Then, the drop-down button retains the last used action in the diagram.
+ </p>
+ <h3 id="Technicaldetails">Technical details</h3>
+ <p>The current
+ <em>Apply Appearance Properties</em> action is handled by
+ <code>org.eclipse.sirius.diagram.ui.tools.internal.actions.SiriusCopyAppearancePropertiesAction</code> (that creates an
+ <code>org.eclipse.gmf.runtime.diagram.ui.internal.requests.ApplyAppearancePropertiesRequest</code>) and then by
+ <code>org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusPropertyHandlerEditPolicy</code>.
+ <br/>The
+ <code>SiriusPropertyHandlerEditPolicy</code> copies the &#171;Sirius style attributes&#187; (
+ <code>SiriusPropertyHandlerEditPolicy.buildApplyAppearancePropertiesCommand(ApplyAppearancePropertiesRequest)</code>) and the &#171;GMF style attributes&#187; by using
+ <code>org.eclipse.gmf.runtime.diagram.core.util.ViewRefactorHelper.copyViewAppearance(View, View, List)</code>.
+ </p>
+ <p>The
+ <code>CopyLayoutAction</code> and
+ <code>PasteLayoutAction</code> from
+ <code>org.eclipse.sirius.diagram.ui.tools.internal.actions.layout</code> will be adapted and renamed to correctly handle this new feature. This is the same for the associated commands
+ <code>CopyLayoutDataCommand</code> and
+ <code>PasteLayoutDataCommand</code>. Both of them use the
+ <code>org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager</code> from the extension point
+ <code>org.eclipse.sirius.diagram.ui.layoutDataManager</code>.
+ </p>
+ <h3 id="ImprovementcomparedtoCopyPasteLayout">Improvement compared to
+ <em>Copy/Paste Layout</em>
+ </h3>
+ <p>For the copy/paste layout, if the selection is an edge for the paste, there is no effect. Indeed, apply the layout an edge is a non sense without applying the layout on its source node and target node layout. For the style, it is not the same; it&#8217;s authorized for an end-user to copy the style of an edge to another. This case must now be handled in the
+ <em>paste style only</em> and if the
+ <em>paste format</em> is launched in this case, only the style will be paste (must be documented in the end-user documentation).
+ </p>
+ <h3 id="applyAppearanceLimitation">Known limitation of
+ <em>Apply Appearance Properties</em>
+ </h3>
+ <p>There is a limitation in the current
+ <em>Apply Appearance Properties</em> action. Indeed, if in the selection there are both containers and nodes, the Sirius style is only applied to elements of the same kind as the source. Only the GMF style is applied (and therefore passed to some Sirius style attributes with pre-commit listeners). For example, the color attributes are not copied from a node to a container (and conversely).
+ <br/>List (non exhastive) of attributes not copied from node to container (and conversely):
+ </p>
+ <ul>
+ <li>border coloer</li>
+ <li>border line style</li>
+ <li>border size</li>
+ <li>color</li>
+ <li>icon path</li>
+ <li>label alignment</li>
+ <li>label color</li>
+ <li>show icon</li>
+ <li>...</li>
+ </ul>
+ <p>In other words, there are only few label attributes that are copied in this case:</p>
+ <ul>
+ <li>Font name</li>
+ <li>Font size</li>
+ <li>Font format (normal, bold, italic)</li>
+ </ul>
+ <p>The feature
+ <em>Apply Appearance Properties</em> is probably, most of time, used for shapes of same type, this is why this limitation was not problematic. In the scope of this feature, we consider that it is the same. Another improvement will be to match individually each style attributes between a node style and a container style.
+ </p>
+ <h2 id="BackwardCompatibilityandMigrationPaths">Backward Compatibility and Migration Paths</h2>
+ <h3 id="MetamodelChanges">Metamodel Changes</h3>
+ <p>The Sirius meta-model is not impacted by this feature.</p>
+ <h3 id="APIChanges">API Changes</h3>
+ <p>To avoid a too important API break in Sirius 4.1, we can not rename the extension point and all the linked classes that speak about LayoutData. So they will be kept for this version but they will become deprecated. They will be removed in Sirius 5.0 in favor of the new
+ <code>org.eclipse.sirius.diagram.ui.formatDataManager</code> extension point, and associated classes, added in Sirius 4.1.
+ <br/>We can not just keep the existing extension point and classes because there will be an inconsistency between the naming and the meaning.
+ </p>
+ <p>The
+ <code>org.eclipse.sirius.diagram.layoutdata.AbstractLayoutData</code> will be completed with:
+ </p>
+ <ul>
+ <li>a reference of type
+ <code>org.eclipse.sirius.viewpoint.Style</code> that is a copy of the style of the current
+ <code>DDiagramElement</code>
+ </li>
+ <li>a reference of type
+ <code>org.eclipse.gmf.runtime.notation.View</code> that is a copy of the
+ <code>View</code> representing the current
+ <code>DDiagramElement</code>. The
+ <code>element</code> field of this copy will be cleaned to avoid possible cross-references to this copy.
+ </li>
+ </ul>
+ <p>
+ <img border="0" src="images/layoutDataMMChanges.png"/>
+ </p>
+ <p>These fields will be set during the copy action with the
+ <code>SiriusLayoutDataManager.storeLayoutData(IGraphicalEditPart)</code>. And they are then use when
+ <code>SiriusLayoutDataManager.applyLayout((IGraphicalEditPart)</code> is called.
+ </p>
+ <h3 id="UserInterfaceChanges">User Interface Changes</h3>
+ <p>As described in the
+ <a href="#UI">
+ <em>Detailed Specification</em>
+ </a> section, the diagram contextual menu and edit menu will have additional entries for the new paste options. The old
+ <em>Copy Layout</em> and
+ <em>Paste Layout</em> actions will also be renamed in
+ <em>Copy Format</em> and
+ <em>Paste Format</em>. The Paste actions will appear in a drop-down menu in the tab-bar.
+ </p>
+ <h3 id="DocumentationChanges">Documentation Changes</h3>
+ <p>The User documentation will be updated to describe the new behavior of the Copy/Paste Format feature (in replacement of the current
+ <a href="http://www.eclipse.org/sirius/doc/user/diagrams/Diagrams.html#Copypasteoflayout">Copy/Paste Layout</a> ).
+ </p>
+ <p>The documentation of the extension point must also be adapted.</p>
+ <h2 id="TestsandNonregressionstrategy">Tests and Non-regression strategy</h2>
+ <p>Starting from a typical diagram with lists, containers, nodes, border-nodes and with an exhaustive list of customized styles, we should test the different combinations of copy/paste:</p>
+ <ul>
+ <li>paste format (layout + style)</li>
+ <li>only paste layout</li>
+ <li>only paste style</li>
+ </ul>
+ <p>For each combination, check the behavior with and without the use of the extension point.</p>
+ <h2 id="Implementationchoicesandtradeoffs">Implementation choices and tradeoffs</h2>
+ <p>Another improvement will be to have a &#171;Brush&#187; action , like in many other tools. We retrieve the same behavior but with a different workflow:</p>
+ <ul>
+ <li>A click on the corresponding button copies the current layout and style and enables the &#171;brush&#187; mode. Then another click on element paste the layout and style.</li>
+ <li>A double click on the corresponding button copies the current layout and style and enables the &#171;brush&#187; mode (for many elements). Then it is possible to make several clicks on elements to paste the layout and style on these elements. Escape key must be pressed to leave the &#171;brush&#187; mode.</li>
+ </ul>
+ <p>We can also imagine a global copy/paste mechanism (with semantic part). This is the goal of the
+ <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=491895">bugzilla 491895</a>.
+ </p>
+ <p>As explained in
+ <a href="#applyAppearanceLimitation">Known limitation of
+ <em>Apply Appearance Properties</em>
+ </a> chapter, another improvement will be to enhance the copy/paste style between a node and a container (and conversely).
+ </p>
+ </body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.textile b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.textile
new file mode 100644
index 0000000000..27ac678a99
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/496466.textile
@@ -0,0 +1,145 @@
+h1. Sirius Evolution Specification: Extend copy/paste layout feature with style notions
+
+h2. Preamble
+
+_Summary_: Have the capability to also paste style along with the layout.
+
+|_. Version |_. Status |_. Date |_. Authors |_. Changes |
+| v0.1 | DRAFT | 2016-06-22 | lredor | Initial version. |
+| v0.2 | DRAFT | 2016-06-23 | lredor | Add improvement and limitations. |
+| v0.3 | PROPOSED | 2016-06-23 | lredor | Internal review. |
+
+_Relevant tickets_:
+* "Bug 496466 - Extend copy/paste layout feature with style notions":https://bugs.eclipse.org/bugs/show_bug.cgi?id=496466
+
+h2. Introduction
+
+Currently there are two kinds of copy/paste in Sirius:
+
+* The "copy/paste layout":http://www.eclipse.org/sirius/doc/user/diagrams/Diagrams.html#Copypasteoflayout copies the location and size of elements of a source diagram and pastes them to elements of a target diagram. By default, the layout is applied on graphical elements representing the same semantic element (same @target@ reference of @DSemanticDecorator@). It is possible to apply specific rules for matching between source semantic elements and target semantic elements with the @org.eclipse.sirius.diagram.ui.layoutDataManager@ extension point.
+* The standard copy/paste allows to copy and paste the semantic elements. The paste action can be customized by a "paste tool":http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#paste_description in the VSM on the receiver. Contrary to the copy/paste layout, the standard copy/paste is also possible by using the same diagram for copy and paste.
+
+In addition to these, there is also an _Apply Appearance Properties_ action <img src="images/ApplyAppearanceProperties.png" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/> that allows to copy all common style attributes from the last selected shapes to all other selected shapes.
+
+The goal of this evolution is to have a copy/paste format feature (in replacement of the existing copy/paste layout feature). This new feature extends the copy/paste layout feature with the style notions (with the same behavior as _Apply Appearance Properties_ action). The standard copy/paste mechanism is not impacted in any way by this change.
+
+h2. Detailed Specification
+
+The user interaction will be the same as the current _copy/paste layout_ feature. As a reminder, currently the end-user must:
+* Select the source elements in a diagram
+* Copy the layout (Ctrl+Alt+Shift+C, or contextual menu @Edit/Copy layout@, or corresponding icon in tab-bar <img src="images/copyLayout.gif" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>)
+* Select the target elements, or the container of these elements, in another diagram
+* Paste the layout (Ctrl+Alt+Shift+V, or contextual menu @Edit/Paste layout@, or corresponding icon in tab-bar <img src="images/pasteLayout.gif" style="box-shadow:none;display:inline;margin:0px;padding:0px;"/>)
+
+The feature will be renamed in @Copy/Paste Format@. There is one action for _Copy_ and 3 actions for _Paste_:
+* Paste Format (ie Layout and Style)
+* Paste Layout Only
+* Paste Style Only
+
+h3. Paste Layout Only
+
+The _Paste Layout Only_ action is equivalent to the current behavior when the user calls the _Paste Layout_ action.
+
+h3. Paste Style Only
+
+The _Paste Style Only_ action will replicate the style, by default, on graphical elements representing the same semantic element (same @target@ reference of @DSemanticDecorator@). All the source elements style properties (customized or not) will be applied to the target elements as custom styles if they are different than the default ones. That means, for example, if the copied element background is different from the one to paste, the background will appear as a custom feature. If the background is the same, nothing is modified.
+The paste style will have a similar behavior to the _Apply Appearance Properties_ action, but with a different workflow.
+
+It will be also possible to use the same extension point as for _Paste Layout_ action to customize the matching between source elements and target elements.
+
+h3. Paste Format
+
+This action is a combination of both above actions. The layout and the style will be pasted.
+
+h3(#UI). User Interface
+
+To default paste behavior, when called from the keyboard shortcut, will be a paste format (layout and style). In the tab-bar and in the contextual menu, there is the possibility to launch the 3 kinds of paste.
+
+!images/copyPasteMenu.png!
+This sketch shows the future menu.
+
+
+!images/tabbarCopy.png!
+@Copy Format@ button in tab-bar
+
+
+!images/tabbarPaste.png!
+@Paste@ buttons in tab-bar. All 3 actions are represented with a drop-down button. At the opening of a diagram, the action @Paste Format@ is the default one. Then, the drop-down button retains the last used action in the diagram.
+
+h3. Technical details
+
+The current _Apply Appearance Properties_ action is handled by @org.eclipse.sirius.diagram.ui.tools.internal.actions.SiriusCopyAppearancePropertiesAction@ (that creates an @org.eclipse.gmf.runtime.diagram.ui.internal.requests.ApplyAppearancePropertiesRequest@) and then by @org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusPropertyHandlerEditPolicy@.
+The @SiriusPropertyHandlerEditPolicy@ copies the "Sirius style attributes" (@SiriusPropertyHandlerEditPolicy.buildApplyAppearancePropertiesCommand(ApplyAppearancePropertiesRequest)@) and the "GMF style attributes" by using @org.eclipse.gmf.runtime.diagram.core.util.ViewRefactorHelper.copyViewAppearance(View, View, List)@.
+
+The @CopyLayoutAction@ and @PasteLayoutAction@ from @org.eclipse.sirius.diagram.ui.tools.internal.actions.layout@ will be adapted and renamed to correctly handle this new feature. This is the same for the associated commands @CopyLayoutDataCommand@ and @PasteLayoutDataCommand@. Both of them use the @org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager@ from the extension point @org.eclipse.sirius.diagram.ui.layoutDataManager@.
+
+h3. Improvement compared to _Copy/Paste Layout_
+
+For the copy/paste layout, if the selection is an edge for the paste, there is no effect. Indeed, apply the layout an edge is a non sense without applying the layout on its source node and target node layout. For the style, it is not the same; it's authorized for an end-user to copy the style of an edge to another. This case must now be handled in the _paste style only_ and if the _paste format_ is launched in this case, only the style will be paste (must be documented in the end-user documentation).
+
+h3(#applyAppearanceLimitation). Known limitation of _Apply Appearance Properties_
+
+There is a limitation in the current _Apply Appearance Properties_ action. Indeed, if in the selection there are both containers and nodes, the Sirius style is only applied to elements of the same kind as the source. Only the GMF style is applied (and therefore passed to some Sirius style attributes with pre-commit listeners). For example, the color attributes are not copied from a node to a container (and conversely).
+List (non exhastive) of attributes not copied from node to container (and conversely):
+* border coloer
+* border line style
+* border size
+* color
+* icon path
+* label alignment
+* label color
+* show icon
+* ...
+
+In other words, there are only few label attributes that are copied in this case:
+* Font name
+* Font size
+* Font format (normal, bold, italic)
+
+The feature _Apply Appearance Properties_ is probably, most of time, used for shapes of same type, this is why this limitation was not problematic. In the scope of this feature, we consider that it is the same. Another improvement will be to match individually each style attributes between a node style and a container style.
+
+h2. Backward Compatibility and Migration Paths
+
+h3. Metamodel Changes
+
+The Sirius meta-model is not impacted by this feature.
+
+h3. API Changes
+
+To avoid a too important API break in Sirius 4.1, we can not rename the extension point and all the linked classes that speak about LayoutData. So they will be kept for this version but they will become deprecated. They will be removed in Sirius 5.0 in favor of the new @org.eclipse.sirius.diagram.ui.formatDataManager@ extension point, and associated classes, added in Sirius 4.1.
+We can not just keep the existing extension point and classes because there will be an inconsistency between the naming and the meaning.
+
+The @org.eclipse.sirius.diagram.layoutdata.AbstractLayoutData@ will be completed with:
+* a reference of type @org.eclipse.sirius.viewpoint.Style@ that is a copy of the style of the current @DDiagramElement@
+* a reference of type @org.eclipse.gmf.runtime.notation.View@ that is a copy of the @View@ representing the current @DDiagramElement@. The @element@ field of this copy will be cleaned to avoid possible cross-references to this copy.
+!images/layoutDataMMChanges.png!
+
+These fields will be set during the copy action with the @SiriusLayoutDataManager.storeLayoutData(IGraphicalEditPart)@. And they are then use when @SiriusLayoutDataManager.applyLayout((IGraphicalEditPart)@ is called.
+
+h3. User Interface Changes
+
+As described in the "_Detailed Specification_":#UI section, the diagram contextual menu and edit menu will have additional entries for the new paste options. The old _Copy Layout_ and _Paste Layout_ actions will also be renamed in _Copy Format_ and _Paste Format_. The Paste actions will appear in a drop-down menu in the tab-bar.
+
+h3. Documentation Changes
+
+The User documentation will be updated to describe the new behavior of the Copy/Paste Format feature (in replacement of the current "Copy/Paste Layout":http://www.eclipse.org/sirius/doc/user/diagrams/Diagrams.html#Copypasteoflayout ).
+
+The documentation of the extension point must also be adapted.
+
+h2. Tests and Non-regression strategy
+
+Starting from a typical diagram with lists, containers, nodes, border-nodes and with an exhaustive list of customized styles, we should test the different combinations of copy/paste:
+* paste format (layout + style)
+* only paste layout
+* only paste style
+For each combination, check the behavior with and without the use of the extension point.
+
+h2. Implementation choices and tradeoffs
+
+Another improvement will be to have a "Brush" action , like in many other tools. We retrieve the same behavior but with a different workflow:
+* A click on the corresponding button copies the current layout and style and enables the "brush" mode. Then another click on element paste the layout and style.
+* A double click on the corresponding button copies the current layout and style and enables the "brush" mode (for many elements). Then it is possible to make several clicks on elements to paste the layout and style on these elements. Escape key must be pressed to leave the "brush" mode.
+
+We can also imagine a global copy/paste mechanism (with semantic part). This is the goal of the "bugzilla 491895":https://bugs.eclipse.org/bugs/show_bug.cgi?id=491895.
+
+As explained in "Known limitation of _Apply Appearance Properties_":#applyAppearanceLimitation chapter, another improvement will be to enhance the copy/paste style between a node and a container (and conversely). \ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/ApplyAppearanceProperties.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/ApplyAppearanceProperties.png
new file mode 100644
index 0000000000..2a40d123b1
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/ApplyAppearanceProperties.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyLayout.gif b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyLayout.gif
new file mode 100644
index 0000000000..c350685e97
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyLayout.gif
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyPasteMenu.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyPasteMenu.png
new file mode 100644
index 0000000000..e1f81d2aea
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/copyPasteMenu.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/layoutDataMMChanges.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/layoutDataMMChanges.png
new file mode 100644
index 0000000000..2a12726c20
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/layoutDataMMChanges.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayout.gif b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayout.gif
new file mode 100644
index 0000000000..d6d4ac1a70
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayout.gif
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayoutStyle.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayoutStyle.png
new file mode 100644
index 0000000000..416508e49a
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteLayoutStyle.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteStyle.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteStyle.png
new file mode 100644
index 0000000000..d27845ac0e
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/pasteStyle.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarCopy.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarCopy.png
new file mode 100644
index 0000000000..2b41bb2be1
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarCopy.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarPaste.png b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarPaste.png
new file mode 100644
index 0000000000..ca77b3ed1a
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/images/tabbarPaste.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/.project b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/.project
new file mode 100644
index 0000000000..0afb23085b
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CopyPaste</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/copyPasteMenu.screen b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/copyPasteMenu.screen
new file mode 100644
index 0000000000..41921e88d4
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/copyPasteMenu.screen
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<model:Screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:model="http://wireframesketcher.com/1.0/model.ecore" theme="clean">
+ <widgets xsi:type="model:List" id="1" x="40" y="71" width="200" text="Cut Ctrl+X&#xA;Copy Ctrl+C&#xA;%(color:gray)Paste Ctrl+V%&#xA;" measuredWidth="200" measuredHeight="67">
+ <font/>
+ <items x="0" y="2" width="200" height="21" text="Cut Ctrl+X"/>
+ <items x="0" y="23" width="200" height="21" text="Copy Ctrl+C"/>
+ <items x="0" y="44" width="200" height="21" text="%(color:gray)Paste Ctrl+V%"/>
+ </widgets>
+ <widgets xsi:type="model:List" id="4" x="40" y="26" width="200" text="Undo&#xD;&#xA;%(color:gray)Redo%" measuredWidth="200" measuredHeight="46">
+ <font/>
+ <items x="0" y="2" width="200" height="21" text="Undo"/>
+ <items x="0" y="23" width="200" height="21" text="%(color:gray)Redo%"/>
+ </widgets>
+ <widgets xsi:type="model:Menu" id="5" text="&amp;File,&amp;Edit,&amp;Diagram,&amp;Navigate, ...,&amp;Help" measuredWidth="240" measuredHeight="27">
+ <items x="5" y="0" width="29" height="27" text="&amp;File"/>
+ <items x="34" y="0" width="31" height="27" text="&amp;Edit"/>
+ <items x="65" y="0" width="56" height="27" text="&amp;Diagram"/>
+ <items x="121" y="0" width="58" height="27" text="&amp;Navigate"/>
+ <items x="179" y="0" width="20" height="27" text="..."/>
+ <items x="199" y="0" width="36" height="27" text="&amp;Help"/>
+ </widgets>
+ <widgets xsi:type="model:List" id="7" x="40" y="133" width="200" text="Delete Delete&#xA;Select All Ctrl+A&#xA;Deselect All Esc" measuredWidth="200" measuredHeight="67">
+ <font/>
+ <items x="0" y="2" width="200" height="21" text="Delete Delete"/>
+ <items x="0" y="23" width="200" height="21" text="Select All Ctrl+A"/>
+ <items x="0" y="44" width="200" height="21" text="Deselect All Esc"/>
+ </widgets>
+ <widgets xsi:type="model:List" id="8" x="40" y="199" width="200" text="Copy Format Ctrl+Alt+Shift+C&#xA;%(color:gray)Paste Format Ctrl+Alt+Shift+V%&#xA;%(color:gray)Paste Layout Only%&#xA;%(color:gray)Paste Style Only%" measuredWidth="200" measuredHeight="88">
+ <font/>
+ <items x="0" y="2" width="200" height="21" text="Copy Format Ctrl+Alt+Shift+C"/>
+ <items x="0" y="23" width="200" height="21" text="%(color:gray)Paste Format Ctrl+Alt+Shift+V%"/>
+ <items x="0" y="44" width="200" height="21" text="%(color:gray)Paste Layout Only%"/>
+ <items x="0" y="65" width="200" height="21" text="%(color:gray)Paste Style Only%"/>
+ </widgets>
+ <hRuler/>
+ <vRuler>
+ <guides position="133"/>
+ </vRuler>
+ <font size="12px"/>
+</model:Screen>
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/tabbarPasteLayoutStyle.screen b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/tabbarPasteLayoutStyle.screen
new file mode 100644
index 0000000000..a696f17d41
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/CopyPaste/tabbarPasteLayoutStyle.screen
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<model:Screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:model="http://wireframesketcher.com/1.0/model.ecore" theme="clean">
+ <widgets xsi:type="model:Label" id="20" x="48" y="46" text="Paste Layout Only" measuredWidth="117" measuredHeight="23" textAlignment="Center" icon="image (small)">
+ <font/>
+ </widgets>
+ <widgets xsi:type="model:Label" id="21" x="48" y="24" text="Paste Format" measuredWidth="91" measuredHeight="23" textAlignment="Center" icon="image (small)">
+ <font/>
+ </widgets>
+ <widgets xsi:type="model:Label" id="22" x="48" y="68" text="Paste Style Only" measuredWidth="106" measuredHeight="23" textAlignment="Center" icon="image (small)">
+ <font/>
+ </widgets>
+ <hRuler/>
+ <vRuler/>
+ <font size="12px"/>
+</model:Screen>
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/tabbar.xcf b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/tabbar.xcf
new file mode 100644
index 0000000000..664f4164cd
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/496466_extendCopyPasteLayout/sources/tabbar.xcf
Binary files differ

Back to the top