class MultiPageEditorViewImpl extends ResizeTabPanel implements MultiPageEditorView {

    TabShownHandler getTabShownHandler() {
        return event -> {
            onResize();

            final TabListItem tab = event.getTab();
            final TabPanelEntry tabPanelEntry = findEntryForTabWidget(tab);
            final PageViewImpl page = (PageViewImpl) tabPanelEntry.getContentPane().getWidget(0);

            getSelectedPageEvent().ifPresent(selectedPageEvent -> {
                selectedPageEvent.fire(new MultiPageEditorSelectedPageEvent(tab.getTabIndex()));
            });

            page.onLostFocus();
        };
    }

}