// Create the LayoutComponent
if (id == null) {
id = LayoutElementUtil.getGeneratedId(type, getNextIdNumber());
}
LayoutComponent component =
new LayoutComponent(parent, id, componentType);
// Set Overwrite flag if needed
if (overwrite != null) {
nvps.remove(overwrite);
component.setOverwrite(Boolean.valueOf(overwrite.getValue().toString()).booleanValue());
}
// Set options...
for (NameValuePair np : nvps) {
component.addOption(np.getName(), np.getValue());
}
// Set flag to indicate if this LayoutComponent is nested in another
// LayoutComponent. This is significant b/c during rendering, events
// will need to be fired differently (the TemplateRenderer /
// LayoutElements will not have any control). The strategy used will
// rely on "instance" handlers, this flag indicates that "instance"
// handlers should be used.
// NOTE: While this could be implemented on the LayoutComponent
// itself, I decided not to for performance reasons and to
// allow this value to be overruled if desired.
component.setNested(nested);
// Let calling method see if this is a single tag, or if there should
// be a closing tag as well
parser.unread('>');
if (single) {