@UiHandler(value = "newFilterListBox") public void onNewFilterSelected(ChangeEvent changeEvent) { int selectedIdx = newFilterListBox.getSelectedIndex(); if (selectedIdx > 0) { String columnId = metadata.getColumnId(selectedIdx - 1); ColumnType columnType = metadata.getColumnType(selectedIdx - 1); CoreFunctionFilter columnFilter = FilterFactory.createCoreFunctionFilter( columnId, columnType, ColumnType.DATE.equals(columnType) ? CoreFunctionType.TIME_FRAME : CoreFunctionType.NOT_EQUALS_TO); if (filter == null) filter = new DataSetFilter(); filter.addFilterColumn(columnFilter); ColumnFilterEditor columnFilterEditor = new ColumnFilterEditor(); columnFilterEditor.init(metadata, columnFilter, this); columnFilterEditor.expand(); filterListPanel.add(columnFilterEditor); newFilterListBox.setSelectedIndex(0); addFilterPanel.setVisible(false); addFilterButton.setVisible(true); columnFilterChanged(columnFilterEditor); } }
public void init(DataSetMetadata metadata, DataSetFilter filter, Listener listener) { this.metadata = metadata; this.filter = filter; this.listener = listener; addFilterButton.setVisible(true); addFilterPanel.setVisible(false); initNewFilterListBox(); filterListPanel.clear(); }
public void columnFilterDeleted(ColumnFilterEditor editor) { addFilterButton.setVisible(true); addFilterPanel.setVisible(false); filterListPanel.remove(editor); Integer index = filter.getColumnFilterIdx(editor.getFilter()); if (index != null) { filter.getColumnFilterList().remove(index.intValue()); if (listener != null) { listener.filterChanged(filter); } } }
@UiHandler(value = "addFilterButton") public void onAddFilterClicked(ClickEvent event) { addFilterButton.setVisible(false); addFilterPanel.setVisible(true); }
public void onNewFilterClosed(ClickEvent event) { addFilterButton.setVisible(true); addFilterPanel.setVisible(false); }