/** * Constructor. <strong>Use {@link #init()} for any configuration of your application instead of * overriding the constructor.</strong> */ public Application() { // Install default component instantiation listener that uses // authorization strategy to check component instantiations. getComponentInstantiationListeners().add(new IComponentInstantiationListener() { /** * @see org.apache.wicket.application.IComponentInstantiationListener#onInstantiation(org.apache.wicket.Component) */ @Override public void onInstantiation(final Component component) { final Class<? extends Component> cl = component.getClass(); // If component instantiation is not authorized if (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(cl)) { // then call any unauthorized component instantiation // listener getSecuritySettings().getUnauthorizedComponentInstantiationListener() .onUnauthorizedInstantiation(component); } } }); }
/** * Constructor. <strong>Use {@link #init()} for any configuration of your application instead of * overriding the constructor.</strong> */ public Application() { // Install default component instantiation listener that uses // authorization strategy to check component instantiations. getComponentInstantiationListeners().add(new IComponentInstantiationListener() { /** * @see org.apache.wicket.application.IComponentInstantiationListener#onInstantiation(org.apache.wicket.Component) */ @Override public void onInstantiation(final Component component) { final Class<? extends Component> cl = component.getClass(); // If component instantiation is not authorized if (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(cl)) { // then call any unauthorized component instantiation // listener getSecuritySettings().getUnauthorizedComponentInstantiationListener() .onUnauthorizedInstantiation(component); } } }); }
@Override public void init(Application application) { // create dashboard context DashboardContext dashboardContext = new DashboardContext(); // store dashboard context in application application.setMetaData(DASHBOARD_CONTEXT_KEY, dashboardContext); // add dashboard context injector DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext); application.getComponentInstantiationListeners().add(dashboardContextInjector); }
@Override public void init(Application application) { // create dashboard context DashboardContext dashboardContext = new DashboardContext(); // store dashboard context in application application.setMetaData(DASHBOARD_CONTEXT_KEY, dashboardContext); // add dashboard context injector DashboardContextInjector dashboardContextInjector = new DashboardContextInjector(dashboardContext); application.getComponentInstantiationListeners().add(dashboardContextInjector); }
/** * Preferred entry point for configuring your WicketApplication automatically. * @param application Your wicket application */ public static void configure(Application application) { application.getComponentInstantiationListeners().add(new AttributeModifyingInstantiationListener()); application.getComponentPostOnBeforeRenderListeners().add(new AttributeModifyingComponentVisitor()); }
/** * Preferred entry point for configuring your WicketApplication automatically. * @param application Your wicket application */ public static void configure(Application application) { application.getComponentInstantiationListeners().add(new AttributeModifyingInstantiationListener()); application.getComponentPostOnBeforeRenderListeners().add(new AttributeModifyingComponentVisitor()); }
@Override public void init(final Application application) { AnnotationEventDispatcherConfig config = new AnnotationEventDispatcherConfig(); application.setMetaData(ANNOTATION_EVENT_DISPATCHER_CONFIG_CONTEXT_KEY, config); AnnotationEventDispatcher dispatcher = new AnnotationEventDispatcher(); application.getComponentInstantiationListeners().add(dispatcher); application.getFrameworkSettings().add(dispatcher); }
application.getComponentInstantiationListeners().add(componentInjector);
app.getComponentInstantiationListeners().add(new BootstrapResourceAppender());
/** * Constructor. All components have names. A component's id cannot be null. This constructor * includes a model. * * @param id * The non-null id of this component * @param model * The component's model * * @throws WicketRuntimeException * Thrown if the component has been given a null id. */ public Component(final String id, final IModel<?> model) { checkId(id); this.id = id; init(); Application application = getApplication(); application.getComponentInstantiationListeners().onInstantiation(this); final DebugSettings debugSettings = application.getDebugSettings(); if (debugSettings.isLinePreciseReportingOnNewComponentEnabled() && debugSettings.getComponentUseCheck()) { setMetaData(CONSTRUCTED_AT_KEY, ComponentStrings.toString(this, new MarkupException("constructed"))); } if (model != null) { setModelImpl(wrap(model)); } }
/** * Constructor. All components have names. A component's id cannot be null. This constructor * includes a model. * * @param id * The non-null id of this component * @param model * The component's model * * @throws WicketRuntimeException * Thrown if the component has been given a null id. */ public Component(final String id, final IModel<?> model) { checkId(id); this.id = id; init(); Application application = getApplication(); application.getComponentInstantiationListeners().onInstantiation(this); final DebugSettings debugSettings = application.getDebugSettings(); if (debugSettings.isLinePreciseReportingOnNewComponentEnabled() && debugSettings.getComponentUseCheck()) { setMetaData(CONSTRUCTED_AT_KEY, ComponentStrings.toString(this, new MarkupException("constructed"))); } if (model != null) { setModelImpl(wrap(model)); } }
application.getComponentInstantiationListeners().add(new PluginComponentInjector(application));
application.getComponentInstantiationListeners().add(new PluginComponentInjector(application));
application.getComponentInstantiationListeners().add(new ComponentInjector()); application.getBehaviorInstantiationListeners().add(new BehaviorInjector());
application.getComponentInstantiationListeners().add(new ComponentInjector()); application.getBehaviorInstantiationListeners().add(new BehaviorInjector());
application.getComponentInstantiationListeners().add(new ComponentInjector(container));