TableDisplayer extends AbstractGwtDisplayer<TableDisplayer.View> { protected boolean isRemoteProvider(DataSet dataSet) { final DataSetDef def = dataSet.getDefinition(); return def == null || def.getProvider() == null ? false : def.getProvider().getName().equals("REMOTE"); } @Inject  TableDisplayer(View view, FilterLabelSet filterLabelSet); @Override View getView(); FilterLabelSet getFilterLabelSet(); int getTotalRows(); String getLastOrderedColumn(); SortOrder getLastSortOrder(); String getSelectedCellColumn(); Integer getSelectedCellRow(); int getExportRowNumMax(); void setExportRowNumMax(int exportRowNumMax); void addOnCellSelectedCommand(Command onCellSelectedCommand); @Override DisplayerConstraints createDisplayerConstraints(); void sortBy(String column, SortOrder order); void selectCell(String columnId, int rowIndex); @Override void filterReset(String columnId); @Override void filterReset(); void lookupCurrentPage(final Callback<Integer> callback); void export(ExportFormat format); @Override void onFilterEnabled(Displayer displayer, DataSetGroup groupOp); @Override void onFilterEnabled(Displayer displayer, DataSetFilter filter); @Override void onFilterReset(Displayer displayer, List<DataSetGroup> groupOps); @Override void onFilterReset(Displayer displayer, DataSetFilter filter);  }
@Test public void testIsRemoteProvider() { final DataSet dataSet = mock(DataSet.class); final DataSetDef dataSetDefSQL = new DataSetDef(); dataSetDefSQL.setProvider(DataSetProviderType.SQL); final DataSetDef dataSetDefRemote = new DataSetDef(); dataSetDefRemote.setProvider(() -> "REMOTE"); when(dataSet.getDefinition()).thenReturn(new DataSetDef(), dataSetDefSQL, dataSetDefRemote); TableDisplayer table = createTableDisplayer(null); assertFalse(table.isRemoteProvider(dataSet)); assertFalse(table.isRemoteProvider(dataSet)); assertTrue(table.isRemoteProvider(dataSet)); }