code: @Override
      protected void updateVisibility(boolean visible, boolean activated) {
          tab.setVisible(visible);
          tab.setSelected(visible && activated);
      }
docs: Sets the visibility and selection state of the tab.