@Override
 public void adjustDisplayForListOfSize(int size) {
   if (size > COMMENTS_PER_PAGE) {
     pager.setVisible(true);
   } else {
     pager.setVisible(false);
   }
 }
Пример #2
0
 @Override
 public void afterRenderRows() {
   dataProvider.refresh();
   boolean enableItem = table.getRowCount() > 0;
   pager.setVisible(table.getRowCount() > Table.DEFAULT_PAGESIZE);
   downloadDictionary.setEnabled(enableItem);
   exportData.setDisabled(!enableItem);
   copyData.setDisabled(!enableItem);
   table.hideLoadingIndicator();
 }
Пример #3
0
  public ValueMapGrid() {
    loading = new Image("image/loading.gif");
    add(loading);

    pager = new SimplePager(SimplePager.TextLocation.RIGHT);
    pager.setPageSize(DEFAULT_PAGE_SIZE);
    pager.addStyleName("pull-right");
    pager.setVisible(false);
    add(pager);
  }
Пример #4
0
  @SuppressWarnings("ParameterHidesMemberVariable")
  public void populate(List<ValueMapEntry> valueMapEntries, @Nullable List<String> valueChoices) {
    this.valueMapEntries = valueMapEntries;
    this.valueChoices = valueChoices;
    //noinspection ConstantConditions
    if (hasValueChoices() && !valueChoices.contains("")) {
      valueChoices.add(0, "");
    }

    if (dataProvider == null) {
      initializeTable();
      dataProvider = new ListDataProvider<ValueMapEntry>(valueMapEntries);
      dataProvider.addDataDisplay(table);
    } else {
      dataProvider.setList(valueMapEntries);
    }
    pager.setVisible(valueMapEntries.size() > pager.getPageSize());
    dataProvider.refresh();

    // remove loading
    remove(loading);
    // addStyleName("value-map");
  }
Пример #5
0
 @Override
 public void beforeRenderRows() {
   pager.setVisible(false);
   table.showLoadingIndicator(dataProvider);
 }