code: private boolean managesCommand(Component component, String commandId) {
  		if (component instanceof AbstractButton) {
  			AbstractButton button = (AbstractButton) component;
  			if (null != button.getActionCommand()) {
  				if (button.getActionCommand().equals(commandId)) {
  					return true;
  				}
  			}
  		}
  		else if (component instanceof Container) {
  			Component[] subComponents = ((Container) component).getComponents();
  			for (int i = 0; i < subComponents.length; ++i) {
  				if (managesCommand(subComponents[i], commandId)) {
  					return true;
  				}
  			}
  		}
  		return false;
  	}
docs: Searches through the component and nested components in order to see if
  the command with supplied id exists in this component.
  
  @param component The component that should be searched.
  @param commandId The id of the command to be checked for.
  @return true if the component, or any of its nested components, is a
  command with the given command id.