@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()); }