class MultiPageEditorViewImpl extends ResizeTabPanel implements MultiPageEditorView {

    @Override
    public int getPageIndex(final String title) {
        final int tabsCount = getTabBar().getWidgetCount();
        for (int tabIndex = 0; tabIndex < tabsCount; tabIndex++) {
            if (getTabBar().getWidget(tabIndex) instanceof TabListItem) {
                final TabListItem tab = (TabListItem) getTabBar().getWidget(tabIndex);
                if (Objects.equals(tab.getText(), title)) {
                    return tabIndex;
                }
            }
        }
        throw new IllegalArgumentException("Page with title: '" + title + "' doesn't exist.");
    }

}