this.selection = selection;
}
@Override
public void generateJson(String prefix, PrintWriter pw, VWorkspace vWorkspace) {
VWorksheet vWorksheet = vWorkspace.getViewFactory().getVWorksheetByWorksheetId(worksheetId);
try {
JSONObject response = new JSONObject();
response.put(JsonKeys.worksheetId.name(), worksheetId);
response.put(AbstractUpdate.GenericJsonKeys.updateType.name(),
this.getClass().getSimpleName());
Worksheet wk = vWorksheet.getWorksheet();
Table dataTable = wk.getDataTable();
TablePager pager = vWorksheet.getTopTablePager();
JSONArray rows = getRowsUsingPager(
pager, vWorksheet,
vWorksheet.getHeaderViewNodes(), vWorkspace.getPreferences().getIntViewPreferenceValue(
ViewPreference.maxCharactersInCell));
int rowsLeft = dataTable.getNumRows() - rows.length();
rowsLeft = rowsLeft < 0 ? 0 : rowsLeft;
response.put(JsonKeys.additionalRowsCount.name(), rowsLeft);
response.put(JsonKeys.tableId.name(), dataTable.getId());