RCP 3.x app: Command Parameters not passed to command after app export!! [message #1276590] |
Mon, 24 March 2014 19:34 |
Jim Klo Messages: 49 Registered: September 2012 |
Member |
|
|
I'm in the process of exporting a product for our RCP 3.x app, which I'm building using Tycho.
The built product runs, however we have command in one of our views that executes a command that's in another plug-in. The invocation uses a snippet similar to this:
FactRuleQueryModel m = (FactRuleQueryModel)((StructuredSelection)selection).getFirstElement();
ICommandService svc = (ICommandService)(Activator.getDefault().getWorkbench().getService(ICommandService.class));
Command cmd = svc.getCommand("net.sourceforge.flora.eclipse.texteditor.command.GoToLineNumber");
if (cmd != null) {
Map<String, String> params = new HashMap<String, String>();
params.put("start", String.valueOf(m.getStartLine()));
params.put("end", String.valueOf(m.getEndLine()));
params.put("filepath", m.getAbsoluteFilePath());
if (log.isDebugEnabled()) {
log.debug("GoToLineNumber Params:");
for (Entry<String, String> entry:params.entrySet()) {
log.debug(String.format(" %s: \"%s\"",entry.getKey(), entry.getValue()));
}
}
try {
log.debug("Try to execute GoToLineNumber command");
cmd.executeWithChecks(new ExecutionEvent(cmd, params, null, null));
log.debug("Executed GoToLineNumber command");
} catch (ExecutionException e) {
log.error("Couldn't execute GoToLineNumber command", e);
} catch (NotDefinedException e) {
log.error("GoToLineNumber command is missing", e);
} catch (NotEnabledException e) {
log.error("GoToLineNumber command not enabled", e);
} catch (NotHandledException e) {
log.error("GoToLineNumber command execution was not handled", e);
}
} else {
log.error("Couldn't find command net.sourceforge.flora.eclipse.texteditor.command.GoToLineNumber.");
}
When running the application straight out of Eclipse either using the Run... or Debug... feature this all works fine. However now that I've built the product using Tycho, the parameter is created and passed within this code chunk, but the receiving command invocation has no parameters being passed!
Can anyone advise on how to solve the parameter passing problem? Do I need to change this out to grab the handler instead of the command?
Thanks,
- Jim
[Updated on: Mon, 24 March 2014 20:07] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02363 seconds