Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-04-25 08:42:52 +0000
committerBenoit Maggi2014-05-15 09:38:45 +0000
commitf29407a0123ceec8a28e93d2b33c2103d6d979e5 (patch)
tree89aa4f1999a07253238db87f1faf9b4c8eb8d1f8 /plugins/views
parent0dece8259523219654efc2b32092fcca4360649d (diff)
downloadorg.eclipse.papyrus-f29407a0123ceec8a28e93d2b33c2103d6d979e5.tar.gz
org.eclipse.papyrus-f29407a0123ceec8a28e93d2b33c2103d6d979e5.tar.xz
org.eclipse.papyrus-f29407a0123ceec8a28e93d2b33c2103d6d979e5.zip
Bug 405565 -[Papyrus Model Explorer] Papyrus Model Explorer shall enable
copy/past with views. - Refactor paste strategies to have an AbstractPasteStrategy - Add DiagramPasteStrategy for copy/paste in Model explorer Change-Id: I9286daf8b68d2555cd98d966ee2e215b47f52bb5 Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CopyHandler.java2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/PasteHandler.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CopyHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CopyHandler.java
index beb38f27133..7fd2a8382c8 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CopyHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/CopyHandler.java
@@ -51,7 +51,7 @@ public class CopyHandler extends AbstractCommandHandler {
List<IStrategy> allStrategies = PasteStrategyManager.getInstance().getAllStrategies();
for(IStrategy iStrategy : allStrategies) {
IPasteStrategy iPasteStrategy = (IPasteStrategy)iStrategy;
- iPasteStrategy.prepare(papyrusClipboard);
+ iPasteStrategy.prepare(papyrusClipboard, selectedElements);
}
return defaultCopyCommand;
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/PasteHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/PasteHandler.java
index 17f8ff5d0a8..43c4d7263b6 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/PasteHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/PasteHandler.java
@@ -60,8 +60,8 @@ public class PasteHandler extends AbstractCommandHandler {
* @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#computeEnabled()
*/
@Override
- protected boolean computeEnabled() { // paste is only available on a simple selection and wit ha full Clipboard
- if (!PapyrusClipboard.getInstance().isEmpty() && getSelectedElements().size() == 1){
+ protected boolean computeEnabled() { // paste is only available on a simple selection and with a non empty Clipboard
+ if (!PapyrusClipboard.getInstance().isEmptyWithNoAdditionalData() && getSelectedElements().size() == 1){
return !EMFHelper.isReadOnly(getSelectedElements().get(0));
} else {
return super.computeEnabled();

Back to the top