Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2015-03-11 07:21:59 +0000
committerBenoit Maggi2015-03-23 12:22:08 +0000
commitd3fca6a7cec34437cb7b7ec4fe951351e89c83e2 (patch)
tree0e769a6d20166d0eea10f0ee8d529d86eb93e033 /plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu
parent5eb95c640b54ef424f5163af3e05bb3cc093eaf7 (diff)
downloadorg.eclipse.papyrus-d3fca6a7cec34437cb7b7ec4fe951351e89c83e2.tar.gz
org.eclipse.papyrus-d3fca6a7cec34437cb7b7ec4fe951351e89c83e2.tar.xz
org.eclipse.papyrus-d3fca6a7cec34437cb7b7ec4fe951351e89c83e2.zip
Bug 461734: [General]: add a quick formatting button for label
- management of EOBject from Diagram and Model explorer - version with undo operationnal but with an api modification to pass the event to the getCommand - version with enable/disable - defining a infra.ui plugin to hold the command - refactoring to delegate implementation across plugins diag,uml and nattable - api formating - adding the plugin to the feature org.eclipse.papyrus.infra.feature >actions relatives to review of Camille - reverting proposition for getCommand - adding a generic implementation for getCommend(event) >actions relatives to review of Vincent -naming convention -api simplification -string externalization -refactoring to suppress code duplication, again Change-Id: I87ef8a24e1bd5d6c9658c1d8994c86b47f466124 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=461734 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/AbstractGraphicalCommandHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/AbstractGraphicalCommandHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/AbstractGraphicalCommandHandler.java
index f525267ffb0..e302579468d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/AbstractGraphicalCommandHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.menu/src/org/eclipse/papyrus/infra/gmfdiag/menu/handlers/AbstractGraphicalCommandHandler.java
@@ -47,6 +47,10 @@ import org.eclipse.ui.handlers.HandlerUtil;
public abstract class AbstractGraphicalCommandHandler extends AbstractHandler {
protected abstract Command getCommand();
+
+ protected Command getCommand(ExecutionEvent event){
+ return getCommand(); //Implement an overridable, default behavior. Extend it only when you actually need the ExecutionEvent (i.e. for your own contribution)
+ }
/**
* Iterate over current selection and build a list of the {@link IGraphicalEditPart} contained in the selection.
@@ -77,7 +81,7 @@ public abstract class AbstractGraphicalCommandHandler extends AbstractHandler {
ISelection selection = HandlerUtil.getCurrentSelection(event);
this.selection = (selection instanceof IStructuredSelection) ? ((IStructuredSelection) selection).toList() : Collections.EMPTY_LIST;
- getEditingDomain(event).getCommandStack().execute(GEFtoEMFCommandWrapper.wrap(getCommand()));
+ getEditingDomain(event).getCommandStack().execute(GEFtoEMFCommandWrapper.wrap(getCommand(event)));
} finally {
// clear the selection
this.selection = Collections.EMPTY_LIST;
@@ -132,7 +136,7 @@ public abstract class AbstractGraphicalCommandHandler extends AbstractHandler {
TransactionalEditingDomain domain = getEditingDomain();
if ((domain != null) && !TransactionHelper.isDisposed(domain)) {
- Command command = getCommand();
+ Command command = getCommand(null);
if (command != null) {
result = command.canExecute();
command.dispose();

Back to the top