{
final Expression primaryDataSource = getPrimaryDataSource();
if (isValidType(primaryDataSource, datasource.getResultType()) == false)
{
populateExpressionSelectorModel(primaryDataSourcesModel, datasource.getResultType());
final ExpressionMetaData data =
ExpressionRegistry.getInstance().getExpressionMetaData
(type.getPreferredPrimaryDataSourceImplementation().getName());
primaryDataSourcesModel.setSelectedItem(data);
}
}
else
{
populateExpressionSelectorModel(primaryDataSourcesModel, null);
setPrimaryDataSource(null);
}
final ChartDataSource secondaryDataSource = type.getSecondaryDataSource();
if (secondaryDataSource != null)
{
final Expression dataSource = getSecondaryDataSource();
if (isValidType(dataSource, secondaryDataSource.getResultType()) == false)
{
populateExpressionSelectorModel(secondaryDataSourcesModel, secondaryDataSource.getResultType());
final ExpressionMetaData data =
ExpressionRegistry.getInstance().getExpressionMetaData
(type.getPreferredSecondaryDataSourceImplementation().getName());
secondaryDataSourcesModel.setSelectedItem(data);
}
}