com.vaadin.ui.Table.setCurrentPageFirstItemIndex()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(284)

本文整理了Java中com.vaadin.ui.Table.setCurrentPageFirstItemIndex()方法的一些代码示例,展示了Table.setCurrentPageFirstItemIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setCurrentPageFirstItemIndex()方法的具体详情如下:
包路径:com.vaadin.ui.Table
类名称:Table
方法名:setCurrentPageFirstItemIndex

Table.setCurrentPageFirstItemIndex介绍

暂无

代码示例

代码示例来源:origin: org.opencms/opencms-core

  1. /**
  2. * Sets the first visible item index.<p>
  3. *
  4. * @param i the item index
  5. */
  6. public void setFirstVisibleItemIndex(int i) {
  7. m_fileTable.setCurrentPageFirstItemIndex(i);
  8. }

代码示例来源:origin: com.holon-platform.vaadin7/holon-vaadin

  1. @Override
  2. public void scrollToTop() {
  3. switch (getRenderingMode()) {
  4. case GRID:
  5. getGrid().scrollToStart();
  6. break;
  7. case TABLE:
  8. getTable().setCurrentPageFirstItemIndex(0);
  9. break;
  10. default:
  11. break;
  12. }
  13. }

代码示例来源:origin: org.activiti/activiti-explorer

  1. /**
  2. * Refresh the list on the left side and selects the next element in the table.
  3. * (useful when element of the list is deleted)
  4. */
  5. public void refreshSelectNext() {
  6. Integer pageIndex = (Integer) table.getCurrentPageFirstItemId();
  7. Integer selectedIndex = (Integer) table.getValue();
  8. table.removeAllItems();
  9. // Remove all items
  10. table.getContainerDataSource().removeAllItems();
  11. // Try to select the next one in the list
  12. Integer max = table.getContainerDataSource().size();
  13. if (max != 0) {
  14. if(pageIndex > max) {
  15. pageIndex = max -1;
  16. }
  17. if(selectedIndex > max) {
  18. selectedIndex = max -1;
  19. }
  20. table.setCurrentPageFirstItemIndex(pageIndex);
  21. selectElement(selectedIndex);
  22. } else {
  23. table.setCurrentPageFirstItemIndex(0);
  24. }
  25. }

相关文章