// ignored
}
public void contentsChanged(final ListDataEvent e)
{
final ExpressionMetaData o = (ExpressionMetaData) getChartExpressionsModel().getSelectedItem();
if (o == null)
{
setChartExpression(null);
return;
}
final Expression chartExpression = getChartExpression();
if (chartExpression != null && chartExpression.getClass().equals(o.getExpressionType()))
{
// no need to change anything ..
return;
}
try
{
final Expression primaryDSExpression = getPrimaryDataSource();
final Expression secondaryDSExpression = getSecondaryDataSource();
final Expression newChartExpression = (Expression) o.getExpressionType().newInstance();
propagateExpressionSettings(chartExpression, newChartExpression);
setChartExpression(newChartExpression);
final ExpressionMetaData thePrimaryModel = (ExpressionMetaData) getPrimaryDataSourcesModel().getSelectedItem();
if (thePrimaryModel != null && primaryDSExpression != null)
{
if (thePrimaryModel.getExpressionType().equals(primaryDSExpression.getClass()))
{
setPrimaryDataSource(primaryDSExpression);
}
else
{
final Expression newPrimaryDataSource = (Expression) thePrimaryModel.getExpressionType().newInstance();
propagateExpressionSettings(primaryDSExpression, newPrimaryDataSource);
setPrimaryDataSource(newPrimaryDataSource);
}
}
final ExpressionMetaData theSecondaryModel = (ExpressionMetaData) getSecondaryDataSourcesModel().getSelectedItem();
if (theSecondaryModel != null && secondaryDSExpression != null)
{
if (theSecondaryModel.getExpressionType().equals(secondaryDSExpression.getClass()))
{
setSecondaryDataSource(secondaryDSExpression);
}
else
{
final Expression newSecondaryDataSource = (Expression) theSecondaryModel.getExpressionType().newInstance();
propagateExpressionSettings(secondaryDSExpression, newSecondaryDataSource);
setSecondaryDataSource(newSecondaryDataSource);
}
}
}