code: public static ActionListener addAction(BaseComponent component, IAction action, String eventName) {
          ActionListener listener;
          
          if (action == null) {
              listener = removeAction(component, eventName);
          } else {
              listener = getListener(component, eventName);
              
              if (listener == null) {
                  listener = new ActionListener(component, action, eventName);
              } else {
                  listener.setAction(action);
              }
          }
          
          return listener;
      }
docs: Adds/removes an action to/from a component.
  
  @param component Component to be associated with the action.
  @param action Action to invoke when listener event is triggered. If null, dissociates the
  event listener from the component.
  @param eventName The name of the event that will trigger the action.
  @return The newly created or just removed action listener.