protected EventService getEventService(ActionEvent event) {
      Component comp = null;
      try {
         if (event.getSource() instanceof Component) {
            comp = (Component) event.getSource();
         }
         if (comp == null) {
            if (getThrowsExceptionOnNullEventService()) {
               throw new RuntimeException("ActionEvent source was null, could not find event bus, must override getContainerEventService in action with id:" + getName());
            }
         } else {
            return ContainerEventServiceFinder.getEventService(comp);
         }
      } catch (ClassCastException ex) {
         if (getThrowsExceptionOnNullEventService()) {
            throw new RuntimeException("ActionEvent source was not a component (" + (comp == null ? "null" : comp.getClass() + "") + "), must override getContainerEventService in action with id:" + getName(), ex);
         }
      }
      return null;
   }