code: @Override
  	protected void afterPaint(final RenderContext renderContext) {
  		super.afterPaint(renderContext);
  
  		if (profileBtn.isPressed()) {
  			// UIC serialization stats
  			UicStats stats = new UicStats(UIContextHolder.getCurrent());
  
  			WComponent currentComp = this.getCurrentComponent();
  
  			if (currentComp != null) {
  				stats.analyseWC(currentComp);
  			}
  
  			if (renderContext instanceof WebXmlRenderContext) {
  				PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();
  
  				writer.println("<hr />");
  				writer.println("<h2>Serialization Profile of UIC</h2>");
  				UicStatsAsHtml.write(writer, stats);
  
  				if (currentComp != null) {
  					writer.println("<hr />");
  					writer.println("<h2>ObjectProfiler - " + currentComp + "</h2>");
  					writer.println("<pre>");
  
  					try {
  						writer.println(ObjectGraphDump.dump(currentComp).toFlatSummary());
  					} catch (Exception e) {
  						LOG.error("Failed to dump component", e);
  					}
  
  					writer.println("</pre>");
  				}
  			}
  		}
  	}
docs: Override afterPaint in order to paint the UIContext serialization statistics if the profile button has been
  pressed.
  
  @param renderContext the renderContext to send output to.