// Get the enclosing canvas's type, region context if any.
String enclosingCanvasType = null;
RegionInstance regionInstance = null;
if (pageContext.peekCanvasType() != null) {
enclosingCanvasType = pageContext.peekCanvasType();
regionInstance = pageContext.getEnclosingRegionInstance();
}
// Check to see whether we should treat the canvas as an overlay.
boolean overlay = "true".equalsIgnoreCase(attributes.getOverlay());