PageRenderTime 40ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/pyjs/tests/test028.js

http://pyjamas.googlecode.com/
JavaScript | 60 lines | 50 code | 10 blank | 0 comment | 8 complexity | f79ed26c89c977669220a6b9e1577533 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. __RowDataAcceptorImpl.prototype.__class__ = "RowDataAcceptorImpl";
  2. function RowDataAcceptorImpl() {
  3. return new __RowDataAcceptorImpl();
  4. }
  5. function __RowDataAcceptorImpl() {
  6. }
  7. __RowDataAcceptorImpl.prototype.accept = function(startRow, data) {
  8. var destRowCount = getDataRowCount();
  9. var destColCount = grid.getCellCount(0);
  10. var srcRowIndex = 0;
  11. var srcRowCount = 5;
  12. var destRowIndex = 1;
  13. while ((srcRowIndex < srcRowCount)) {
  14. var srcRowData = data.__getitem__(srcRowIndex);
  15. var __srcColIndex = pyjslib_range(destColCount).__iter__();
  16. try {
  17. while (true) {
  18. var srcColIndex = __srcColIndex.next();
  19. var cellHTML = srcRowData.__getitem__(srcColIndex);
  20. grid.setText(destRowIndex, srcColIndex, cellHTML);
  21. }
  22. } catch (e) {
  23. if (e != StopIteration) {
  24. throw e;
  25. }
  26. }
  27. srcRowIndex += 1;
  28. destRowIndex += 1;
  29. }
  30. var isLastPage = false;
  31. while ((destRowIndex < ( destRowCount + 1 ) )) {
  32. var isLastPage = true;
  33. var __destColIndex = pyjslib_range(destColCount).__iter__();
  34. try {
  35. while (true) {
  36. var destColIndex = __destColIndex.next();
  37. grid.clearCell(destRowIndex, destColIndex);
  38. }
  39. } catch (e) {
  40. if (e != StopIteration) {
  41. throw e;
  42. }
  43. }
  44. destRowIndex += 1;
  45. }
  46. navbar.gotoNet.setEnabled(!(isLstPage));
  47. navbar.gotoFirst.setEnabled((startRow > 0));
  48. navbar.gotoPrev.setEnabled((startRow > 0));
  49. setStatusText( ( ( ( startRow + 1 ) + " - " ) + ( startRow + srcRowCount ) ) );
  50. };