diff options
author | Sebastien Gabel | 2016-07-22 15:30:12 +0000 |
---|---|---|
committer | Patrick Tessier | 2016-08-26 10:25:28 +0000 |
commit | 847c62ff92d54a0723a0b143afa12771d6855c72 (patch) | |
tree | 76ab94bd6273a021f68daf476c8b2ba4bcb30e1e | |
parent | a937b51a4246168383f1067e741de50679e39b55 (diff) | |
download | org.eclipse.papyrus-847c62ff92d54a0723a0b143afa12771d6855c72.tar.gz org.eclipse.papyrus-847c62ff92d54a0723a0b143afa12771d6855c72.tar.xz org.eclipse.papyrus-847c62ff92d54a0723a0b143afa12771d6855c72.zip |
Bug 498357: Avoid adding non executable command that will block all
others in CustomizableDropEditPolicy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=498357
Test the returned command before adding it to the array list.
Change-Id: I103c559385e8077e2c373f8c971f9535c688eca9
Signed-off-by: Sebastien Gabel <sebastien.gabel@esterel-technologies.com>
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/policy/CustomizableDropEditPolicy.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/policy/CustomizableDropEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/policy/CustomizableDropEditPolicy.java index 3391c69e53b..36dffd84eaf 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/policy/CustomizableDropEditPolicy.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.dnd/src/org/eclipse/papyrus/infra/gmfdiag/dnd/policy/CustomizableDropEditPolicy.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2012, 2016 CEA LIST, Christian W. Damus, Esterel Technologies SAS and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -10,6 +10,7 @@ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation * Christian W. Damus - bug 433206 * Christian W. Damus - bug 477384 + * Sebastien Bordes (Esterel Technologies SAS) - bug 498357 *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.dnd.policy; @@ -477,9 +478,12 @@ public class CustomizableDropEditPolicy extends DragDropEditPolicy { } //Retrieve defaultStrategy - ArrayList<Command> selectedCommands = new ArrayList<Command>(); - selectedCommands.add(defaultDropStrategy.getCommand(request, getHost())); - matchingStrategies.put(defaultDropStrategy, selectedCommands); + Command command = defaultDropStrategy.getCommand(request, getHost()); + if (command != null && command.canExecute()) { + List<Command> selectedCommands = new ArrayList<Command>(); + selectedCommands.add(command); + matchingStrategies.put(defaultDropStrategy, selectedCommands); + } return matchingStrategies; } |