ActionRetractFactCol52DefinitionBuilder extends BaseActionColumnDefinitionBuilder { @Override public void generateDefinition( final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback ) { if ( !( column instanceof ActionRetractFactCol52 ) ) { return; } generateActionColumn( dtPresenter, column, afterGenerationCallback ); } @Inject  ActionRetractFactCol52DefinitionBuilder( final Caller<GuidedDecisionTableEditorService> service ); @Override Class getSupportedColumnType(); @Override void generateDefinition( final GuidedDecisionTableView.Presenter dtPresenter,
                                    final BaseColumn column,
                                    final Callback<String> afterGenerationCallback );  }
@Test public void unknownColumnTypeDoesNotTriggerBuilder() { final BaseColumn column = new RowNumberCol52(); builder.generateDefinition( dtPresenter, column, ( String definition ) -> { fail( "RowNumberCol52 should not be handled by ActionRetractFactCol52DefinitionBuilder" ); } ); }
@Test public void simpleAction() { final AtomicBoolean calledBack = new AtomicBoolean( false ); final ActionRetractFactCol52 arf = new ActionRetractFactCol52(); model.getActionCols().add( arf ); builder.generateDefinition( dtPresenter, arf, ( String definition ) -> { calledBack.set( true ); assertEquals( "retract( x );", definition ); } ); assertTrue( calledBack.get() ); }