class AbstractArchetypeTablePresenter implements ArchetypeTablePresenter,
                                                                 HasBusyIndicator {

    void setupCounters(final int totalArchetypes) {
        this.currentPage = Math.max(1, this.currentPage);
        if (totalArchetypes < (currentPage - 1) * PAGE_SIZE + 1) {
            currentPage = totalArchetypes / PAGE_SIZE;
        }

        final int offset = (currentPage - 1) * PAGE_SIZE;
        final int fromCount = totalArchetypes > 0 ? offset + 1 : offset;
        final int toCount = resolveCounter(totalArchetypes,
                                           offset + PAGE_SIZE);
        final int totalCount = resolveCounter(totalArchetypes,
                                              0);

        final String indicatorText = ts.format(ArchetypeManagementConstants.ArchetypeManagement_ItemCountIndicatorText,
                                               fromCount,
                                               toCount,
                                               totalCount);

        view.setPageIndicator(indicatorText);

        totalPages = (int) Math.ceil(totalArchetypes / (float) PAGE_SIZE);

        final String totalText = ts.format(ArchetypeManagementConstants.ArchetypeManagement_OfN,
                                           Math.max(totalPages, 1));
        view.setTotalPages(totalText);

        view.setCurrentPage(currentPage);

        checkPaginationButtons();
    }

    public  AbstractArchetypeTablePresenter(final View view,
                                           final ArchetypeListPresenter archetypeListPresenter,
                                           final BusyIndicatorView busyIndicatorView,
                                           final TranslationService ts,
                                           final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                           final ArchetypePreferences archetypePreferences,
                                           final Caller<ArchetypeService> archetypeService,
                                           final PreferenceScopeFactory preferenceScopeFactory,
                                           final Promises promises);

}