if (Utils.isEmpty(column.getConditionalStyles()))
return;
for (Iterator iterator = column.getConditionalStyles().iterator(); iterator.hasNext();) {
ConditionalStyle condition = (ConditionalStyle) iterator.next();
if (getReport().getOptions().isPrintBackgroundOnOddRows()
&& Transparency.TRANSPARENT == condition.getStyle().getTransparency() ){ //condition style + odd row (only if conditional style's background is transparent)
JRDesignExpression expressionForConditionalStyle = getExpressionForConditionalStyle(condition, column);
String expStr = JRExpressionUtil.getExpressionText(expressionForConditionalStyle);
//ODD
JRDesignExpression expressionOdd = new JRDesignExpression();
expressionOdd.setValueClass(Boolean.class);
expressionOdd.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_ODD+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");
Style oddRowBackgroundStyle = getReport().getOptions().getOddRowBackgroundStyle();
JRDesignConditionalStyle condStyleOdd = makeConditionalStyle( condition.getStyle());
// Utils.copyProperties(condStyleOdd, condition.getStyle().transform());
condStyleOdd.setBackcolor(oddRowBackgroundStyle.getBackgroundColor());
condStyleOdd.setMode(JRDesignElement.MODE_OPAQUE);
condStyleOdd.setConditionExpression(expressionOdd);
jrstyle.addConditionalStyle(condStyleOdd);
//EVEN
JRDesignExpression expressionEven = new JRDesignExpression();
expressionEven.setValueClass(Boolean.class);
expressionEven.setText("new java.lang.Boolean(" +EXPRESSION_TRUE_WHEN_EVEN+".booleanValue() && ((java.lang.Boolean)" + expStr + ").booleanValue() )");
JRDesignConditionalStyle condStyleEven = makeConditionalStyle( condition.getStyle());
condStyleEven.setConditionExpression(expressionEven);
jrstyle.addConditionalStyle(condStyleEven);
} else { //No odd row, just the conditional style
JRDesignExpression expression = getExpressionForConditionalStyle(condition, column);
JRDesignConditionalStyle condStyle = makeConditionalStyle( condition.getStyle());
condStyle.setConditionExpression(expression);
jrstyle.addConditionalStyle(condStyle);
}
}