/** * Check the component this behavior is bound to. * <p> * Logs a warning in development mode when an {@link AjaxFormChoiceComponentUpdatingBehavior} * should be used. * * @param component * bound component */ protected void checkComponent(FormComponent<?> component) { if (Application.get().usesDevelopmentConfig() && AjaxFormChoiceComponentUpdatingBehavior.appliesTo(component)) { log.warn(String .format( "AjaxFormComponentUpdatingBehavior is not supposed to be added in the form component at path: \"%s\". " + "Use the AjaxFormChoiceComponentUpdatingBehavior instead, that is meant for choices/groups that are not one component in the html but many", component.getPageRelativePath())); } }
/** * Check the component this behavior is bound to. * <p> * Logs a warning in development mode when an {@link AjaxFormChoiceComponentUpdatingBehavior} * should be used. * * @param component * bound component */ protected void checkComponent(FormComponent<?> component) { if (Application.get().usesDevelopmentConfig() && AjaxFormChoiceComponentUpdatingBehavior.appliesTo(component)) { log.warn(String .format( "AjaxFormComponentUpdatingBehavior is not supposed to be added in the form component at path: \"%s\". " + "Use the AjaxFormChoiceComponentUpdatingBehavior instead, that is meant for choices/groups that are not one component in the html but many", component.getPageRelativePath())); } }
/** * Return {@link IRequestHandler} for the given exception. * * @param e exception to handle * @return RequestHandler instance * * @see IRequestCycleListener#onException(RequestCycle, Exception) * @see IExceptionMapper#map(Exception) */ protected IRequestHandler handleException(final Exception e) { if (Application.exists() && Application.get().usesDevelopmentConfig()) { /* * Call out the fact that we are processing an exception in a loud way, helps to notice * them when developing even if they get wrapped or processed in a custom handler. */ logExtra.warn("********************************"); logExtra.warn("Handling the following exception", e); logExtra.warn("********************************"); } IRequestHandler handler = listeners.onException(this, e); if (handler != null) { return handler; } return exceptionMapper.map(e); }
/** * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { onPopulate(); if (getApplication().usesDevelopmentConfig()) { Set<String> usedComponentIds = new HashSet<>(); Iterator<? extends Component> i = iterator(); while (i.hasNext()) { Component c = i.next(); String componentId = c.getId(); if (usedComponentIds.add(componentId) == false) { log.warn("Repeater '{}' has multiple children with the same component id: '{}'", getPageRelativePath(), componentId); // do not flood the log break; } } } super.onBeforeRender(); }
/** * Return {@link IRequestHandler} for the given exception. * * @param e exception to handle * @return RequestHandler instance * * @see IRequestCycleListener#onException(RequestCycle, Exception) * @see IExceptionMapper#map(Exception) */ protected IRequestHandler handleException(final Exception e) { if (Application.exists() && Application.get().usesDevelopmentConfig()) { /* * Call out the fact that we are processing an exception in a loud way, helps to notice * them when developing even if they get wrapped or processed in a custom handler. */ logExtra.warn("********************************"); logExtra.warn("Handling the following exception", e); logExtra.warn("********************************"); } IRequestHandler handler = listeners.onException(this, e); if (handler != null) { return handler; } return exceptionMapper.map(e); }
/** * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { onPopulate(); if (getApplication().usesDevelopmentConfig()) { Set<String> usedComponentIds = new HashSet<>(); Iterator<? extends Component> i = iterator(); while (i.hasNext()) { Component c = i.next(); String componentId = c.getId(); if (usedComponentIds.add(componentId) == false) { log.warn("Repeater '{}' has multiple children with the same component id: '{}'", getPageRelativePath(), componentId); // do not flood the log break; } } } super.onBeforeRender(); }
/** * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { onPopulate(); if (getApplication().usesDevelopmentConfig()) { Iterator<? extends Component> i = iterator(); while (i.hasNext()) { Component c = i.next(); Matcher matcher = SAFE_CHILD_ID_PATTERN.matcher(c.getId()); if (!matcher.matches()) { log.warn("Child component of repeater " + getClass().getName() + ":" + getId() + " has a non-safe child id of " + c.getId() + ". Safe child ids must be composed of digits only."); // do not flood the log break; } } } super.onBeforeRender(); }
@Override protected void onBeforeRender() { super.onBeforeRender(); if (getApplication().usesDevelopmentConfig() && !getApplication().getMarkupSettings().getStripWicketTags()) { log.warn("Application is in DEVELOPMENT mode && Wicket tags are not stripped," + "Some Chrome Versions will not render the GMap." + " Change to DEPLOYMENT mode || turn on Wicket tags stripping." + " See:" + " http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html."); } }
if (component.getApplication().usesDevelopmentConfig())
if (component.getApplication().usesDevelopmentConfig())
/** * * @see org.apache.wicket.Component#onAfterRender() */ @Override protected void onAfterRender() { // only in development mode validate the headers if (getApplication().usesDevelopmentConfig()) { // check headers only when page was completely rendered if (wasRendered(this)) { validateHeaders(); } } super.onAfterRender(); }
/** * * @see org.apache.wicket.Component#onAfterRender() */ @Override protected void onAfterRender() { // only in development mode validate the headers if (getApplication().usesDevelopmentConfig()) { // check headers only when page was completely rendered if (wasRendered(this)) { validateHeaders(); } } super.onAfterRender(); }
if (component.getApplication().usesDevelopmentConfig()) {
variables.put("Wicket.DateTimeInit.DatePath", RequestCycle.get().urlFor(WICKET_DATE, null)); if (Application.get().usesDevelopmentConfig())
variables.put("Wicket.DateTimeInit.DatePath", RequestCycle.get().urlFor(WICKET_DATE, null)); if (Application.get().usesDevelopmentConfig())
if (Application.get().usesDevelopmentConfig())
if (application.usesDevelopmentConfig())
if (application.usesDevelopmentConfig())
filters.add(new WicketContainerTagHandler(markupResourceStream, Application.get().usesDevelopmentConfig()));
filters.add(new WicketContainerTagHandler(markupResourceStream, Application.get().usesDevelopmentConfig()));