class DataSetSummary implements IsWidget {

    public void show(final DataSetDef def) {
        if (def != null) {
            // Cache status panel.
            final boolean isShowBackendCache = def.getProvider() != null
                    && ( !DataSetProviderType.BEAN.equals(def.getProvider())
                    && !DataSetProviderType.CSV.equals(def.getProvider() ));
            final Boolean isCacheEnabled = isShowBackendCache ? def.isCacheEnabled() : null;
            final boolean isPushEnabled = def.isPushEnabled();
            final boolean isRefreshEnabled = def.getRefreshTime() != null;
            view.showStatusPanel(isCacheEnabled, isPushEnabled, isRefreshEnabled);
            
            
            // Show loading icon on size panel while performing the backend request.
            showLoadingIcon();

            getMetadata(def, new DataSetMetadataCallback() {
                @Override
                public void callback(final DataSetMetadata metadata) {
                    final int estimatedSize = metadata.getEstimatedSize();
                    final int rowCount = metadata.getNumberOfRows();
                    view.showSizePanel(humanReadableRowCount(rowCount) + " " + DataSetExplorerConstants.INSTANCE.rows(), 
                            humanReadableByteCount(estimatedSize));
                }

                @Override
                public void notFound() {
                    showErrorIcon();
                    showError(def.getUUID(), DataSetExplorerConstants.INSTANCE.notFound());
                    
                }

                @Override
                public boolean onError(final ClientRuntimeError error) {
                    showErrorIcon();
                    showError(def.getUUID(), error);
                    return false;
                }
            });
        }
    }

    @Inject public  DataSetSummary(final DataSetClientServices clientServices, 
                          final Event<ErrorEvent> errorEvent, 
                          final View view);

}