code: public void addMainToolBarComponent(Component component) {
          if (mainToolBarComponents == null) {
              mainToolBarComponents = createList();
          }
          mainToolBarComponents.add(component);
      }
docs: Adds the given {@link Component} (usually {@link javax.swing.JButton JButton}, {@link javax.swing.JToggleButton
  JToggleButton}, {@link javax.swing.JToolBar.Separator JToolBar.Separator}) to the view hook, to be later added to the
  main tool bar panel.
  
  @param component the {@code component} that will be added to the main tool bar panel
  @since 2.6.0
  @see org.zaproxy.zap.view.MainToolbarPanel#addToolBarComponent(Component)
  @see org.zaproxy.zap.view.MainToolbarPanel#removeToolBarComponent(Component)