public void actionPerformed(final ActionEvent evt)
{
try
{
final DataPreviewDialog previewDialog = new DataPreviewDialog(PmdDataSourceEditor.this);
final String query = queryNameTextField.getText();
Integer theMaxRows = 0;
if (maxPreviewRowsSpinner.isEnabled())
{
theMaxRows = (Integer) maxPreviewRowsSpinner.getValue();
}
final PmdDataFactory dataFactory = createDataFactory();
DataFactoryEditorSupport.configureDataFactoryForPreview(dataFactory, context);
final PmdPreviewWorker worker = new PmdPreviewWorker(dataFactory, query, 0, theMaxRows);
previewDialog.showData(worker);
final ReportDataFactoryException factoryException = worker.getException();
if (factoryException != null)
{
ExceptionDialog.showExceptionDialog(PmdDataSourceEditor.this,