public FilterSettings createTableSettingsPrototype() { FilterSettingsBuilderHelper builder = FilterSettingsBuilderHelper.init(); builder.initBuilder(); builder.dataset(REQUEST_LIST_DATASET); builder.setColumn(COLUMN_ID, constants.Id()); builder.setColumn(COLUMN_TIMESTAMP, constants.Time(), DateUtils.getDateTimeFormatMask()); builder.setColumn(COLUMN_STATUS, constants.Status()); builder.setColumn( COLUMN_COMMANDNAME, constants.CommandName(), DateUtils.getDateTimeFormatMask()); builder.setColumn(COLUMN_MESSAGE, constants.Message()); builder.setColumn(COLUMN_BUSINESSKEY, constants.Key()); builder.filterOn(true, true, true); builder.tableOrderEnabled(true); builder.tableOrderDefault(COLUMN_TIMESTAMP, DESCENDING); builder.tableWidth(1000); return builder.buildSettings(); }
private void initTabFilter( GridGlobalPreferences preferences, final String key, String tabName, String tabDesc, List<String> statuses) { FilterSettingsBuilderHelper builder = FilterSettingsBuilderHelper.init(); builder.initBuilder(); if (statuses != null && statuses.size() > 0) { builder.dataset(REQUEST_LIST_DATASET); List<Comparable> names = new ArrayList<Comparable>(); for (String s : statuses) { names.add(s); } builder.filter(equalsTo(COLUMN_STATUS, names)); } builder.dataset(REQUEST_LIST_DATASET); builder.setColumn(COLUMN_ID, constants.Id()); builder.setColumn(COLUMN_TIMESTAMP, constants.Time(), DateUtils.getDateTimeFormatMask()); builder.setColumn(COLUMN_STATUS, constants.Status()); builder.setColumn(COLUMN_COMMANDNAME, constants.CommandName()); builder.setColumn(COLUMN_MESSAGE, constants.Message()); builder.setColumn(COLUMN_BUSINESSKEY, constants.Key()); builder.filterOn(true, true, true); builder.tableOrderEnabled(true); builder.tableOrderDefault(COLUMN_TIMESTAMP, DESCENDING); FilterSettings tableSettings = builder.buildSettings(); tableSettings.setKey(key); tableSettings.setTableName(tabName); tableSettings.setTableDescription(tabDesc); HashMap<String, Object> tabSettingsValues = new HashMap<String, Object>(); tabSettingsValues.put( FILTER_TABLE_SETTINGS, dataSetEditorManager.getTableSettingsToStr(tableSettings)); tabSettingsValues.put(NewTabFilterPopup.FILTER_TAB_NAME_PARAM, tableSettings.getTableName()); tabSettingsValues.put( NewTabFilterPopup.FILTER_TAB_DESC_PARAM, tableSettings.getTableDescription()); filterPagedTable.saveNewTabSettings(key, tabSettingsValues); final ExtendedPagedTable<RequestSummary> extendedPagedTable = createGridInstance( new GridGlobalPreferences( key, preferences.getInitialColumns(), preferences.getBannedColumns()), key); currentListGrid = extendedPagedTable; extendedPagedTable.setDataProvider(presenter.getDataProvider()); filterPagedTable.addTab( extendedPagedTable, key, new Command() { @Override public void execute() { currentListGrid = extendedPagedTable; applyFilterOnPresenter(key); } }); }