@Override public void init(final ProcessInstanceListPresenter presenter) { final List<String> bannedColumns = new ArrayList<String>(); bannedColumns.add(constants.Select()); bannedColumns.add(constants.Id()); bannedColumns.add(constants.Name()); bannedColumns.add(constants.Process_Instance_Description()); bannedColumns.add(constants.Actions()); final List<String> initColumns = new ArrayList<String>(); initColumns.add(constants.Select()); initColumns.add(constants.Id()); initColumns.add(constants.Name()); initColumns.add(constants.Process_Instance_Description()); initColumns.add(constants.Version()); initColumns.add(constants.Actions()); initColumns.add(constants.Version()); final Button button = new Button(); button.setText("+"); button.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Command addNewGrid = new Command() { @Override public void execute() { HashMap<String, Object> newTabFormValues = newTabFilterPopup.getFormValues(); final String key = getValidKeyForAdditionalListGrid("ProcessInstancesGrid_"); filterPagedTable.saveNewTabSettings(key, newTabFormValues); final ExtendedPagedTable<ProcessInstanceSummary> extendedPagedTable = createGridInstance( new GridGlobalPreferences(key, initColumns, bannedColumns), key); extendedPagedTable.setDataProvider(presenter.getDataProvider()); filterPagedTable.createNewTab( extendedPagedTable, key, button, new Command() { @Override public void execute() { currentListGrid = extendedPagedTable; applyFilterOnPresenter(key); } }); applyFilterOnPresenter(newTabFormValues); } }; createFilterForm(); newTabFilterPopup.show(addNewGrid, getMultiGridPreferencesStore()); } }); super.init( presenter, new GridGlobalPreferences("ProcessInstancesGrid", initColumns, bannedColumns), button); }
@Override public void initColumns(ExtendedPagedTable<ProcessInstanceSummary> extendedPagedTable) { Column checkColumn = initChecksColumn(); Column processInstanceIdColumn = initProcessInstanceIdColumn(); Column processNameColumn = initProcessNameColumn(); Column processInitiatorColumn = initInitiatorColumn(); Column processVersionColumn = initProcessVersionColumn(); Column processStateColumn = initProcessStateColumn(); Column startTimeColumn = initStartDateColumn(); Column descriptionColumn = initDescriptionColumn(); actionsColumn = initActionsColumn(); List<ColumnMeta<ProcessInstanceSummary>> columnMetas = new ArrayList<ColumnMeta<ProcessInstanceSummary>>(); columnMetas.add(new ColumnMeta<ProcessInstanceSummary>(checkColumn, constants.Select())); columnMetas.add( new ColumnMeta<ProcessInstanceSummary>(processInstanceIdColumn, constants.Id())); columnMetas.add(new ColumnMeta<ProcessInstanceSummary>(processNameColumn, constants.Name())); columnMetas.add( new ColumnMeta<ProcessInstanceSummary>( descriptionColumn, constants.Process_Instance_Description())); columnMetas.add( new ColumnMeta<ProcessInstanceSummary>(processInitiatorColumn, constants.Initiator())); columnMetas.add( new ColumnMeta<ProcessInstanceSummary>(processVersionColumn, constants.Version())); columnMetas.add(new ColumnMeta<ProcessInstanceSummary>(processStateColumn, constants.State())); columnMetas.add( new ColumnMeta<ProcessInstanceSummary>(startTimeColumn, constants.Start_Date())); columnMetas.add(new ColumnMeta<ProcessInstanceSummary>(actionsColumn, constants.Actions())); extendedPagedTable.addColumns(columnMetas); }