]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - eclipse/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/SpringCommandHandler.java
Update license headers
[lgpl/argeo-commons.git] / eclipse / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / spring / SpringCommandHandler.java
index ce0521bda6b0033d7e6fb0e2c8f5b66d8703ae1c..9eb3a0df1e42247dd7ea9cc8c241d0cc13fb7c66 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Mathieu Baudier
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.eclipse.spring;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.argeo.ArgeoException;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandler;
@@ -45,6 +45,9 @@ public class SpringCommandHandler implements IHandler {
                        // TODO: make it more flexible and robust
                        ApplicationContext applicationContext = ApplicationContextTracker
                                        .getApplicationContext(bundleSymbolicName);
+                       if (applicationContext == null)
+                               throw new ArgeoException("No application context found for "
+                                               + bundleSymbolicName);
 
                        // retrieve the command via its id
                        String beanName = event.getCommand().getId();