@Override @SuppressWarnings("unchecked") public void onBeforeBuild(WicketBuildContext ctx, IWicketComponentMapper mapper) { if (mapperType.isAssignableFrom(mapper.getClass())) handler.accept(ctx, mapper, (T) mapper); } @Override
@Override public IAjaxUpdateConfiguration<Component> setOnError(ITriConsumer<AjaxRequestTarget, Component, RuntimeException> onError) { this.onError = ITriConsumer.noopIfNull(onError); return this; }
static <T, U, V> ITriConsumer<T, U, V> noopIfNull(ITriConsumer<T, U, V> consumer) { return (consumer != null) ? consumer : noop(); }
@Override @SuppressWarnings("unchecked") public void onAfterBuild(WicketBuildContext ctx, IWicketComponentMapper mapper) { if (type.isAssignableFrom(mapper.getClass())) handler.accept(ctx, mapper, (T) mapper); } };
@Override public IAjaxUpdateConfiguration<Component> setOnError(ITriConsumer<AjaxRequestTarget, Component, RuntimeException> onError) { this.onError = ITriConsumer.noopIfNull(onError); return this; } @Override
protected void onError(AjaxRequestTarget target, RuntimeException e) { this.onError.accept(target, getComponent(), e); if (refreshTargetComponent) target.add(getComponent()); }
@Override public IAjaxUpdateConfiguration<Component> setOnError(ITriConsumer<AjaxRequestTarget, Component, RuntimeException> onError) { this.onError = ITriConsumer.noopIfNull(onError); return this; }
protected void onError(AjaxRequestTarget target, RuntimeException e) { this.onError.accept(target, getComponent(), e); if (refreshTargetComponent) target.add(getComponent()); }
@Override public IAjaxUpdateConfiguration<Component> setOnError(ITriConsumer<AjaxRequestTarget, Component, RuntimeException> onError) { this.onError = ITriConsumer.noopIfNull(onError); return this; } @Override
protected void onError(AjaxRequestTarget target, RuntimeException e) { this.onError.accept(target, getComponent(), e); if (refreshTargetComponent) target.add(getComponent()); }
@Override public IAjaxUpdateConfiguration<Component> setOnError(ITriConsumer<AjaxRequestTarget, Component, RuntimeException> onError) { this.onError = ITriConsumer.noopIfNull(onError); return this; } @Override
protected void onError(AjaxRequestTarget target, RuntimeException e) { this.onError.accept(target, getComponent(), e); if (refreshTargetComponent) target.add(getComponent()); }
protected <C extends Component & IOnAfterPopulateItemConfigurable> void onConfigureInternal(Component component, C rootContainer) { IVisitor<Component, Void> visitor = (Component child, IVisit<Void> visit) -> { if (child instanceof AbstractRepeater) { visit.dontGoDeeper(); } else { IAjaxUpdateConfiguration<Component> updateConfiguration = child.getMetaData(CONFIGURATION_KEY); if (updateConfiguration == null) { updateConfiguration = $b.addAjaxUpdate(child, (t, c) -> { onUpdate.accept(t, rootContainer); if (refreshTargetComponent) t.add(c); }); } if (updateConfiguration != null) { child.setMetaData(CONFIGURATION_KEY, updateConfiguration); updateConfiguration.setUpdateAjaxAttributes(updateAjaxAttributes); updateConfiguration.setOnError((t, c, e) -> { onError.accept(t, rootContainer, e); if (refreshTargetComponent) t.add(c); }); } } }; if (component instanceof MarkupContainer) { ((MarkupContainer) component).visitChildren(Component.class, visitor); } else { visitor.component(component, null); } }