public void setPageViewMode(final int viewMode, boolean refresh) {

        if (!refresh && documentViewController.getViewMode() == viewMode) {
            return;
        }

        documentViewController.setViewType(viewMode);

        // update button state.
        reflectDocumentViewModeInButtons();
        reflectFitInFitButtons();
    }