Exemple #1
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);
  }
  public void init(final ArtifactListPresenter presenter) {
    this.presenter = presenter;

    // Set the message to display when the table is empty.
    final Label emptyTable = new Label(M2RepoEditorConstants.INSTANCE.NoArtifactAvailable());
    emptyTable.setStyleName("");
    cellTable.setEmptyTableWidget(emptyTable);

    // Create a Pager to control the table.
    pager.setDisplay(cellTable);
    pager.setPageSize(PAGE_SIZE);

    initTableColumns();
  }
Exemple #3
0
  private void initializeTable() {
    if (table != null) {
      remove(table);
      table = null;
    }

    table = new Table<ValueMapEntry>(pager.getPageSize());
    // not supposed to be empty except while being populated
    table.setEmptyTableWidget(table.getLoadingIndicator());
    table.addStyleName("small-top-margin");
    table.addStyleName("pull-left");
    table.setPageSize(pageSize);
    table.setWidth("100%");
    add(table);
    pager.setPageSize(pageSize);
    pager.setDisplay(table);

    initializeColumns();
  }
  @Override
  public void init(ProcessDefinitionListPresenter presenter) {
    this.presenter = presenter;

    listContainer.add(processdefListGrid);
    listContainer.add(pager);

    processdefListGrid.setHeight("350px");

    // Set the message to display when the table is empty.
    processdefListGrid.setEmptyTableWidget(new Label(constants.No_Process_Definitions_Available()));

    // Attach a column sort handler to the ListDataProvider to sort the list.
    sortHandler = new ListHandler<ProcessSummary>(presenter.getDataProvider().getList());
    processdefListGrid.addColumnSortHandler(sortHandler);

    // Create a Pager to control the table.

    pager.setDisplay(processdefListGrid);
    pager.setPageSize(10);

    // Add a selection model so we can select cells.
    final MultiSelectionModel<ProcessSummary> selectionModel =
        new MultiSelectionModel<ProcessSummary>();
    selectionModel.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {
          public void onSelectionChange(SelectionChangeEvent event) {
            selectedProcessDef = selectionModel.getSelectedSet();
            for (ProcessSummary pd : selectedProcessDef) {
              processSelection.fire(new ProcessDefSelectionEvent(pd.getId()));
            }
          }
        });

    processdefListGrid.setSelectionModel(
        selectionModel, DefaultSelectionEventManager.<ProcessSummary>createCheckboxManager());

    initTableColumns(selectionModel);

    presenter.addDataDisplay(processdefListGrid);
  }
  @Override
  public void init(TaskCommentsPresenter presenter) {
    this.presenter = presenter;
    listContainer.add(commentsListGrid);
    listContainer.add(pager);
    commentsAccordionLabel.add(new HTMLPanel(constants.Add_Comment()));
    commentsListGrid.setHeight("350px");
    commentsListGrid.setEmptyTableWidget(new HTMLPanel(constants.No_Comments_For_This_Task()));
    // Attach a column sort handler to the ListDataProvider to sort the list.
    sortHandler = new ListHandler<CommentSummary>(presenter.getDataProvider().getList());
    commentsListGrid.addColumnSortHandler(sortHandler);
    initTableColumns();
    presenter.addDataDisplay(commentsListGrid);
    // Create a Pager to control the table.
    pager.setDisplay(commentsListGrid);
    pager.setPageSize(COMMENTS_PER_PAGE);
    adjustDisplayForListOfSize(1);

    newTaskCommentTextArea.setWidth("300px");
    addCommentButton.setText(constants.Add_Comment());
    newTaskCommentLabel.setText(constants.Comment());
  }