package de.alpharogroup.wicket.behaviors;

import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;

/**
 * The abstract class {@link ComponentDecoratorBehavior} provides callback
 * methods for decorate(wrap) a component with html tags. There for you can get
 * the {@link Response} of the component and write to it.
 */
public abstract class ComponentDecoratorBehavior extends Behavior {

	/** The constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void bind(Component component) {
		component.setOutputMarkupId(true);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void beforeRender(Component component) {
		onBeforeRender(component);
		super.beforeRender(component);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void afterRender(Component component) {
		super.afterRender(component);
		onAfterRender(component);
	}

	/**
	 * Abstract factory callback method to hook after render.
	 *
	 * @param component
	 *            the component
	 */
	protected abstract void onAfterRender(Component component);

	/**
	 * Abstract factory callback method to hook before render.
	 *
	 * @param component
	 *            the component
	 */
	protected abstract void onBeforeRender(Component component);
	
}

@@ -928,34 +928,25 @@
 %7D%0A%0A%09/**%0A%09 * 
-Abstract f
+F
 actory callb
@@ -1044,33 +1044,24 @@
 %0A%09protected 
-abstract 
 void onAfter
@@ -1091,30 +1091,112 @@
 ent)
-;%0A%0A%09/**%0A%09 * Abstract f
+ %7B%0A%09%09Response response = component.getResponse();%0A%09%09response.write(onWriteAfterRender());%0A%09%7D%0A%0A%09/**%0A%09 * F
 acto
@@ -1311,59 +1311,836 @@
 ted 
-abstract void onBeforeRender(Component component);%0A%09
+void onBeforeRender(Component component) %7B%0A%09%09Response response = component.getResponse();%0A%09%09response.write(onWriteBeforeRender());%0A%09%7D%0A%0A%09/**%0A%09 * Abstract factory callback method that have to be overwritten. The%0A%09 * returned result will be written in the response before the rendering%0A%09 * process starts.%0A%09 *%0A%09 * @return the %7B@link String%7D that will be written in the response before%0A%09 *         the rendering process starts.%0A%09 */%0A%09protected abstract String onWriteBeforeRender();%0A%0A%09/**%0A%09 * Abstract factory callback method that have to be overwritten. The%0A%09 * returned result will be written in the response after the rendering%0A%09 * process finishes.%0A%09 *%0A%09 * @return the %7B@link String%7D that will be written in the response after the%0A%09 *         rendering process finishes.%0A%09 */%0A%09protected abstract String onWriteAfterRender();%0A    
 %0A%7D%0A

Update ComponentDecoratorBehavior.java