textField.setEvaluationGroup(jgroup);
//Assign the style to the element.
//First we look for the specific element style, then the default style for the group variables
//and finally the column style.
Style defStyle = DJConstants.HEADER.equals(type)
? columnsGroup.getDefaulHeaderVariableStyle()
: columnsGroup.getDefaulFooterVariableStyle();
if (var.getStyle() != null)
applyStyleToElement(var.getStyle(), textField);
else if (col.getStyle() != null) {
//Last resource is to use the column style, but a copy of it because
//the one in the internal cache can get modified by the layout manager (like in the odd row case)
Style style = col.getStyle();
try {
style = (Style) BeanUtils.cloneBean(style);
style.setName(null); //set to null to make applyStyleToElement(...) assign a name
} catch (Exception e) { }
applyStyleToElement(style, textField);
}
else if (defStyle != null)
applyStyleToElement(defStyle, textField);