X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Fruntime%2Forg.argeo.eclipse.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Feclipse%2Fspring%2FSpringCommandHandler.java;h=ce0521bda6b0033d7e6fb0e2c8f5b66d8703ae1c;hb=019e0f2af17286be08ab17c1c9e1d8ba871ec9b2;hp=0356f57d2e850acd5cbb9930dca51974cd43bd4c;hpb=92daeb190be66653f39544ae9b5a2f2c31a60797;p=lgpl%2Fargeo-commons.git diff --git a/eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringCommandHandler.java b/eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringCommandHandler.java index 0356f57d2..ce0521bda 100644 --- a/eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringCommandHandler.java +++ b/eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringCommandHandler.java @@ -48,6 +48,13 @@ public class SpringCommandHandler implements IHandler { // retrieve the command via its id String beanName = event.getCommand().getId(); + + if (!applicationContext.containsBean(beanName)) { + if (beanName.startsWith(bundleSymbolicName)) + beanName = beanName + .substring(bundleSymbolicName.length() + 1); + } + if (!applicationContext.containsBean(beanName)) throw new ExecutionException("No bean found with name " + beanName + " in bundle " + bundleSymbolicName); @@ -62,7 +69,7 @@ public class SpringCommandHandler implements IHandler { return handler.execute(event); } catch (Exception e) { // TODO: use eclipse error management -// log.error(e); + // log.error(e); throw new ExecutionException("Cannot execute Spring command " + commandId + " in bundle " + bundleSymbolicName, e); }