* @return Created div attributes.
*/
protected DivAttributes createDivAttributes(VolantisProtocol protocol,
MCSAttributes sourceAttributes, boolean generateDefaultId) {
// Create new instance of DivAttributes
DivAttributes divAttributes = new DivAttributes();
// If source attributes are specified, copy all attribute values.
if (sourceAttributes != null) {
divAttributes.copy(sourceAttributes);
}
// If styles are not specified, create new inherited styles.
if (divAttributes.getStyles() == null) {
Styles styles = StylingFactory.getDefaultInstance()
.createInheritedStyles(
protocol.getMarinerPageContext().getStylingEngine()
.getStyles(), DisplayKeywords.BLOCK);
divAttributes.setStyles(styles);
}
// If there's no ID attribute, and generateDefaultId flag is set,
// generate unique value for it.
if (generateDefaultId && divAttributes.getId() == null) {
divAttributes.setId(protocol.getMarinerPageContext()
.generateUniqueFCID());
}
// Return created DivAttributes
return divAttributes;