示例#1
0
  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();
  }
示例#2
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());
  }
示例#5
0
  private void addTableColumns() {

    table.addColumn(
        new Column<TableDto, TableDto>(
            new PlaceRequestCell<TableDto>(placeManager) {

              @Override
              public PlaceRequest getPlaceRequest(TableDto value) {
                return ProjectPlacesHelper.getTablePlace(
                    value.getDatasourceName(), value.getName());
              }

              @Override
              public String getText(TableDto value) {
                String name = value.getName();
                return value.hasViewLink()
                    ? "<i class=\"icon-cog\"></i>&nbsp;" + name
                    : "<i class=\"icon-table\"></i>&nbsp;" + name;
              }
            }) {
          @Override
          public TableDto getValue(TableDto object) {
            return object;
          }
        },
        translations.nameLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return object.getEntityType();
          }
        },
        translations.entityTypeColumnLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return Integer.toString(object.getVariableCount());
          }
        },
        translations.variablesLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return Integer.toString(object.getValueSetCount());
          }
        },
        translations.entitiesLabel());

    dataProvider.addDataDisplay(table);
    table.setSelectionModel(new SingleSelectionModel<TableDto>());
    table.setPageSize(Table.DEFAULT_PAGESIZE);
    table.setEmptyTableWidget(new InlineLabel(translations.noTablesLabel()));
    pager.setDisplay(table);
  }