private static List<JavaScriptResourceReference> getRenderedReferences() { return Application.get().getDebugSettings().isAjaxDebugModeEnabled() ? DEVELOPMENT_REFERENCES : DEPLOYMENT_REFERENCES; } }
getDebugSettings().setComponentUseCheck(true); getMarkupSettings().setStripWicketTags(false); getExceptionSettings().setUnexpectedExceptionDisplay( IExceptionSettings.SHOW_EXCEPTION_PAGE); getDebugSettings().setAjaxDebugModeEnabled(true); getDebugSettings().setDevelopmentUtilitiesEnabled(true); getDebugSettings().setComponentUseCheck(false); getMarkupSettings().setStripWicketTags(true); getExceptionSettings().setUnexpectedExceptionDisplay( IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); getDebugSettings().setAjaxDebugModeEnabled(false); getDebugSettings().setDevelopmentUtilitiesEnabled(false); getResourceSettings().setJavascriptCompressor(new DefaultJavascriptCompressor());
/** * Adds a component to the set of rendered components. * * @param component * The component that was rendered */ public final void componentRendered(final Component component) { // Inform the page that this component rendered if (Application.get().getDebugSettings().getComponentUseCheck()) { if (renderedComponents == null) { renderedComponents = new HashSet<Component>(); } if (renderedComponents.add(component) == false) { throw new MarkupException("The component " + component + " has the same wicket:id as another component already added at the same level"); } if (log.isDebugEnabled()) { log.debug("Rendered " + component); } } }
getDebugSettings().setComponentUseCheck(true); getMarkupSettings().setStripWicketTags(false); getExceptionSettings().setUnexpectedExceptionDisplay( IExceptionSettings.SHOW_EXCEPTION_PAGE); getDebugSettings().setAjaxDebugModeEnabled(true); getResourceSettings().setStripJavascriptCommentsAndWhitespace(false); getDebugSettings().setComponentUseCheck(false); getMarkupSettings().setStripWicketTags(true); getExceptionSettings().setUnexpectedExceptionDisplay( IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); getDebugSettings().setAjaxDebugModeEnabled(false); getResourceSettings().setStripJavascriptCommentsAndWhitespace(true);
getRequestCycleSettings().addResponseFilter(htmlvalidator); getDebugSettings().setAjaxDebugModeEnabled(false);
if (Application.get().getDebugSettings().getComponentUseCheck()) if (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
/** * Constructor. All components have names. A component's id cannot be null. This is the minimal * constructor of component. It does not register a model. * * @param id * The non-null id of this component * @throws WicketRuntimeException * Thrown if the component has been given a null id. */ public Component(final String id) { setId(id); getApplication().notifyComponentInstantiationListeners(this); final IDebugSettings debugSettings = Application.get().getDebugSettings(); if (debugSettings.isLinePreciseReportingOnNewComponentEnabled()) { setMetaData(CONSTRUCTED_AT_KEY, Strings.toString(this, new MarkupException( "constructed"))); } }
if (debugSettings.isLinePreciseReportingOnAddComponentEnabled())
associatedMarkupStream.next(); if (getApplication().getDebugSettings().isOutputMarkupContainerClassName()) if (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
getDebugSettings().setAjaxDebugModeEnabled(determineAjaxDebugModeEnabled(configuration));
/** * 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) { setId(id); getApplication().notifyComponentInstantiationListeners(this); final IDebugSettings debugSettings = Application.get().getDebugSettings(); if (debugSettings.isLinePreciseReportingOnNewComponentEnabled()) { setMetaData(CONSTRUCTED_AT_KEY, Strings.toString(this, new MarkupException("constructed"))); } if (model != null) { setModelImpl(wrap(model)); } }
if (debugSettings.isLinePreciseReportingOnAddComponentEnabled())
if (getApplication().getDebugSettings().isOutputMarkupContainerClassName()) if (getApplication().getDebugSettings().isOutputMarkupContainerClassName())
private Properties getCachedChannelResources(final Channel channel) throws ChannelException { Properties resources = channelResourcesCache.get(channel.getId()); if (resources == null || Application.get().getDebugSettings().isAjaxDebugModeEnabled()) { resources = fetchChannelResources(channel); channelResourcesCache.put(channel.getId(), resources); } else { log.info("Using cached i18n resources for channel '{}'", channel.getId()); } return resources; }
/** * Adds a component to the set of rendered components. * * @param component * The component that was rendered */ public final void componentRendered(final Component component) { // Inform the page that this component rendered if (Application.get().getDebugSettings().getComponentUseCheck()) { if (renderedComponents == null) { renderedComponents = new HashSet(); } if (renderedComponents.add(component) == false) { throw new MarkupException("The component " + component + " has the same wicket:id as another component already added at the same level"); } if (log.isDebugEnabled()) { log.debug("Rendered " + component); } } }
@Override public Iterable<? extends HeaderItem> getDependencies() { final Application application = Application.get(); IJavaScriptLibrarySettings jsLibrarySettings = application.getJavaScriptLibrarySettings(); final IDebugSettings debugSettings = application.getDebugSettings(); if (debugSettings.isAjaxDebugModeEnabled()) { return Arrays.asList(JavaScriptHeaderItem.forReference(jsLibrarySettings.getWicketAjaxDebugReference()), JavaScriptHeaderItem.forScript("Wicket.Ajax.DebugWindow.enabled=true;", "wicket-ajax-debug-enable")); } else { ResourceReference wicketAjaxReference = jsLibrarySettings.getWicketAjaxReference(); return Arrays.asList(JavaScriptHeaderItem.forReference(wicketAjaxReference)); } }
if (debugSettings.getComponentUseCheck() && !getResponse().isRedirect())
@Override public void render(final Response response) { if (Application.get().getDebugSettings().isAjaxDebugModeEnabled()) { for (JavaScriptResourceReference resourceReference : JAVASCRIPT_RESOURCE_REFERENCES) { JavaScriptHeaderItem.forReference(resourceReference).render(response); } } else { JavaScriptHeaderItem.forReference(BUNDLE).render(response); } }
if (debugSettings.getComponentUseCheck() && !getResponse().isRedirect())
/** * @see org.apache.wicket.behavior.AbstractAjaxBehavior#renderHead(org.apache.wicket.markup.html.IHeaderResponse) */ @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); final IDebugSettings debugSettings = Application.get().getDebugSettings(); response.renderJavascriptReference(WicketEventReference.INSTANCE); response.renderJavascriptReference(WicketAjaxReference.INSTANCE); if (debugSettings.isAjaxDebugModeEnabled()) { response.renderJavascriptReference(JAVASCRIPT_DEBUG); response.renderJavascript("wicketAjaxDebugEnable=true;", "wicket-ajax-debug-enable"); } RequestContext context = RequestContext.get(); if (context.isPortletRequest()) { response.renderJavascript("Wicket.portlet=true", "wicket-ajax-portlet-flag"); } }