code: public void insert(final Widget page, final Widget tab, final int beforeIndex) {
          final String text = (tab instanceof HasText) ? ((HasText) tab).getText() : "Tab #" + beforeIndex;
  
          if (beforeIndex < PAGE_LIMIT - 1) {
              // visible pages
              Tab t = tabs.add(text, beforeIndex);
              super.insert(page, t, beforeIndex);
  
          } else if (beforeIndex == PAGE_LIMIT - 1) {
              // last visible page
              Tab t = tabs.add(text, beforeIndex);
              offPageContainer.add(new OffPageText(0, text), page);
              super.insert(offPageContainer.asWidget(), t, beforeIndex);
  
          } else {
              // off page - don't use beforeIndex as it'll always be PAGE_LIMIT
              int last = offPageContainer.size();
              offPageContainer.add(new OffPageText(last, text), page);
              tabs.showSelector();
          }
      }
docs: ------------------------------------------------------ insert & remove