if (event.getElement() == model.getRoot())
{
final Object eventParameter = event.getParameter();
if (eventParameter instanceof AttributeChange)
{
final AttributeChange attributeChange = (AttributeChange) eventParameter;
if (AttributeNames.Internal.NAMESPACE.equals(attributeChange.getNamespace()) ||
AttributeNames.Internal.QUERY.equals(attributeChange.getNamespace()))
{
realModel.fireTreeNodeChanged(realModel.getDataFactoryElement());
}
// else do nothing, as style-changes and other attribute-changes have no effect on the datamodel.
}
else if (eventParameter instanceof AttributeExpressionChange ||
eventParameter instanceof StyleChange ||
eventParameter instanceof StyleExpressionChange)
{
// these things have no effect on the data ..
}
else if (eventParameter instanceof Expression ||
eventParameter instanceof ReportParameterDefinition)
{
realModel.fireTreeNodeChanged(eventParameter);
}
else
{
realModel.fireTreeDataChanged();
}
}
else
{
realModel.fireTreeNodeChanged(event.getElement());
}
}
else if (model instanceof ReportStructureTreeModel)
{
final ReportStructureTreeModel realModel = (ReportStructureTreeModel) model;
final Object eventParameter = event.getParameter();
if (eventParameter instanceof AttributeChange)
{
final AttributeChange attributeChange = (AttributeChange) eventParameter;
if (AttributeNames.Core.NAMESPACE.equals(attributeChange.getNamespace()))
{
if (AttributeNames.Core.NAME.equals(attributeChange.getName()) ||
AttributeNames.Core.FIELD.equals(attributeChange.getName()) ||
AttributeNames.Core.VALUE.equals(attributeChange.getName())||
AttributeNames.Core.RESOURCE_IDENTIFIER.equals(attributeChange.getName()))
{
invalidateLayoutCache();
}
}
}