Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.ftlines.wicketsource;
Notes the creation location of components and saves that metadata in the component metadata area. This is the precursor step to using a AttributeModifyingComponentVisitor for writing out an HTML wicketsource="" style of attribute. This uses a similar approach to line-precise-reporting-on-new-component and is likely to be equally slow, so turn it on only in debug/development mode, not production.

Jenny Brown
This is an alternative to Component.CONSTRUCTED_AT_KEY which is package-private and thus internal to wicket. If wicket eventually exposes the markup exception from creation time, we can use that directly instead.
		private static final long serialVersionUID = 1L;

Indicates that the component's source location could not be determined, probably because this is an internal wicket enclosure or similar automatically generated component.

Jenny Brown
	static class UnsupportedComponentException extends Exception {

When a component is instantiated, record the source location as part of its metadata.
	public void onInstantiation(Component component)
		if (component instanceof org.apache.wicket.markup.html.internal.Enclosure) {
			return// nothing to see here; bail out early to save time.
		try {
			// nothing to see here; skip this component.
New to GrepCode? Check out our FAQ X