org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable.getItemCount()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(130)

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

DataTable.getItemCount介绍

暂无

代码示例

代码示例来源:origin: org.opensingular/singular-wicket-utils

/**
 * The last element of the page.
 * Example: 15 Itens per page. The total of itens is 21
 * In page 1 will have 15 itens - 21 <=0 = TRUE return 15.
 * In page 2 will have 30 itens - 21 <=0 = FALSE return 21.
 *
 * @return The last element of the page.
 */
private long getNumberOfLastElement() {
  return getMaxNumberElementsPerPage() - getTable().getItemCount() <= 0 ? getMaxNumberElementsPerPage() : getTable().getItemCount();
}

代码示例来源:origin: theonedev/onedev

@Override
protected void onConfigure() {
  super.onConfigure();
  setVisible(SecurityUtils.canWriteCode(getProject().getFacade()) && issuesTable.getItemCount() != 0);
}

代码示例来源:origin: org.opensingular/singular-wicket-utils

@Override
protected void onConfigure() {
  super.onConfigure();
  itensPerPageSelector.setVisible(getTable().getItemCount() > getInitialRowsPerPage());
  paginator.setVisible(getTable().getPageCount() > 1);
  /* if at least one control is visible, the toolbar must be visible. if none is visible there is no need for the toolbar.*/
  boolean toolbarVisible = getTable().getPageCount() > 1;
  toolbarVisible |= itensPerPageSelector.isVisible();
  toolbarVisible |= paginator.isVisible();
  countContainer.setVisible(toolbarVisible);
  if (countContainer.isVisible()) {
    String messageCount = String.format("Exibindo %d a %d de %d registros", getNumberOfFirstElement(), getNumberOfLastElement(), getTable().getItemCount());
    counterLabelModel.setObject(messageCount);
  }
  this.setVisible(toolbarVisible);
}

代码示例来源:origin: theonedev/onedev

@Override
public void populateItem(Item<ICellPopulator<Issue>> cellItem, String componentId,
    IModel<Issue> rowModel) {
  Issue issue = rowModel.getObject();
  Fragment fragment = new Fragment(componentId, "summaryFrag", IssueListPanel.this);
  fragment.add(new Label("number", "#" + issue.getNumber()));
  OddEvenItem<?> row = cellItem.findParent(OddEvenItem.class);
  QueryPosition position = new QueryPosition(parsedQueryModel.getObject().toString(), (int)issuesTable.getItemCount(), 
      (int)issuesTable.getCurrentPage() * WebConstants.PAGE_SIZE + row.getIndex());
  Link<Void> link = new BookmarkablePageLink<Void>("title", IssueActivitiesPage.class, 
      IssueActivitiesPage.paramsOf(issue, position));
  link.add(new Label("label", issue.getTitle()));
  fragment.add(link);
  fragment.add(new WebMarkupContainer("copy").add(new CopyClipboardBehavior(Model.of("#" + issue.getNumber() + ": " + issue.getTitle()))));
  
  fragment.add(new IssueStateLabel("state", rowModel));
  
  UserIdent submitterIdent = UserIdent.of(UserFacade.of(issue.getSubmitter()), issue.getSubmitterName());
  fragment.add(new UserIdentPanel("submitter", submitterIdent, Mode.NAME));
  fragment.add(new Label("submitDate", DateUtils.formatAge(issue.getSubmitDate())));
  
  fragment.add(new Label("votes", issue.getVoteCount()));
  fragment.add(new Label("comments", issue.getCommentCount()));
  
  cellItem.add(fragment);
}

代码示例来源:origin: org.opensingular/wicket-utils

@Override
  protected void onConfigure() {
    super.onConfigure();
    itensPerPageSelector.setVisible(getTable().getItemCount() > getInitialRowsPerPage());
    paginator.setVisible(getTable().getPageCount() > 1);

    /* if at least one control is visible, the toolbar must be visible. if none is visible there is no need for the toolbar.*/
    boolean toolbarVisible = getTable().getPageCount() > 1;
    toolbarVisible |= itensPerPageSelector.isVisible();
    toolbarVisible |= paginator.isVisible();

    this.setVisible(toolbarVisible);
  }
}

相关文章