ColumnListEditor implements IsWidget, org.dashbuilder.dataset.client.editor.ColumnListEditor { void onColumnSelect(final int index, final boolean selected) { final DataColumnDef columnDef = acceptableColumns.get(index); if (selected) { listEditor.getList().add(columnDef.clone()); } else { listEditor.getList().remove(columnDef); } columnsChangedEvent.fire(new ColumnsChangedEvent(this, listEditor.getList())); } @Inject  ColumnListEditor(final SyncBeanManager beanManager,
                            final DataColumnDefDriver dataColumnDefDriver,
                            final Event<ColumnsChangedEvent> columnsChangedEvent,
                            final View view); @PostConstruct void init(); @Override Widget asWidget(); @Override void setAcceptableValues(final List<DataColumnDef> acceptableValues); @Override void onValueRestricted(final String value); @Override void onValueUnRestricted(final String value); @Override void setProviderType(final DataSetProviderType type); void clear(); @Override DataColumnDefEditor createEditorForTraversal(); @Override String getPathElement(final DataColumnDefEditor subEditor); @Override void setEditorChain(final EditorChain<DataColumnDef, DataColumnDefEditor> chain); @Override void setDelegate(final EditorDelegate<List<DataColumnDef>> delegate); @Override void showErrors(final List<EditorError> errors); @Override void flush(); @Override void onPropertyChange(final String... paths); @Override void setValue(final List<DataColumnDef> value); public View view; }
@Test public void testOnColumnUnSelected() { when(col1.clone()).thenReturn(col1); presenter.onColumnSelect(0, false); assertTrue(listEditor.getList().isEmpty()); verify(columnsChangedEvent, times(1)).fire(any(ColumnsChangedEvent.class)); }