/** * Remember to call super if you override this template method. */ public void configure(WidgetBuilder builder) { for (Closure<WidgetBuilder> configuration : this.configurations) { configuration.execute(builder); } } }
/** * Executes the given closure on each element in the iterable. * <p/> * If the input iterable or closure is null, there is no change made. * * @param iterable * the iterable to get the input from, may be null * @param closure * the closure to perform, may be null */ public static <E> void forAllDo(Iterable<E> iterable, Closure<? super E> closure) { if (iterable != null && closure != null) { for (Iterator<E> it = iterable.iterator(); it.hasNext();) { closure.execute(it.next()); } } }
public void showOn(TableBuilder<R> table) { ColumnBuilder<R> builder = table.addColumn(this.labelProvider); for (Closure<ColumnBuilder<R>> configuration : this.configurations) { configuration.execute(builder); } } }