X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=base%2Fruntime%2Forg.argeo.eclipse.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Feclipse%2Fui%2Futils%2FCommandUtils.java;h=d150551bb67f1ad7cde8da54524142d83a270d6c;hb=8c22d7886269ed699336cddfb4783cb786447f00;hp=7bb5c27916c504669562f4f723f0d95ae2fb9236;hpb=d9981e639bcf212209cddb86ddc7d703859efdea;p=lgpl%2Fargeo-commons.git diff --git a/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/ui/utils/CommandUtils.java b/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/ui/utils/CommandUtils.java index 7bb5c2791..d150551bb 100644 --- a/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/ui/utils/CommandUtils.java +++ b/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/ui/utils/CommandUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -171,6 +171,8 @@ public class CommandUtils { Command cmd = cmdService.getCommand(commandID); ArrayList parameters = null; + ParameterizedCommand pc; + if (paramMap != null) { // Set parameters of the command to launch : parameters = new ArrayList(); @@ -181,15 +183,17 @@ public class CommandUtils { cmd.getParameter(id), paramMap.get(id)); parameters.add(parameterization); } - } - // build the parameterized command - ParameterizedCommand pc = new ParameterizedCommand(cmd, - parameters.toArray(new Parameterization[parameters.size()])); + pc = new ParameterizedCommand(cmd, + parameters.toArray(new Parameterization[parameters + .size()])); + } else + pc = new ParameterizedCommand(cmd, null); + // execute the command handlerService.executeCommand(pc, null); } catch (Exception e) { - throw new ArgeoException( - "Unexepected exception while opening node editor", e); + throw new ArgeoException("Unexpected error while" + + " calling the command " + commandID, e); } } } \ No newline at end of file