code: public static DockViewTitleBar findDockViewTitleBar(Component component) {
  
          Assert.notNull(component, "component");
  
          final SingleDockableContainer sdc = DockingUtilities.findSingleDockableContainerAncestor(component);
          final DockViewTitleBar dockViewTitleBar;
  
          if (sdc == null) {
              dockViewTitleBar = null;
          } else if (sdc instanceof DockView) {
              dockViewTitleBar = ((DockView) sdc).getTitleBar();
          } else if (sdc instanceof AutoHideExpandPanel) {
              dockViewTitleBar = ((AutoHideExpandPanel) sdc).getTitleBar();
          } else {
              dockViewTitleBar = null;
          }
  
          return dockViewTitleBar;
      }
docs: Find the dock view title bar associated to the dockable container of a given component (if any).
  
  @param component
  the component.
  @return the dock view title bar.