}
private static UndoEntry deleteExpression(final ReportDocumentContext context, final Object data)
{
final AbstractReportDefinition report = context.getReportDefinition();
final ExpressionCollection expressionCollection = report.getExpressions();
final int count = expressionCollection.size();
for (int i = 0; i < count; i++)
{
final Expression definitionEntry = expressionCollection.getExpression(i);
if (definitionEntry == data)
{
expressionCollection.removeExpression(i);
report.notifyNodeChildRemoved(definitionEntry);
return new ExpressionRemoveUndoEntry(i, definitionEntry);
}
}
return null;