}*/
}
}
});
final ListSelectionModel selectionModel = _detectorsTable.getSelectionModel();
selectionModel.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(final ListSelectionEvent e) {
if (!e.getValueIsAdjusting() && _detectorsTable.getSelectedRow() > -1) {
final int modelIndex = _tableSorter.modelIndex(_detectorsTable.getSelectedRow());
final DetectorFactory detectorFactory = _bugPatternModel.getEntries().get(modelIndex);
final String description = getDetailedText(detectorFactory);
getTextArea().setText(description);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
getTextArea().scrollRectToVisible(new Rectangle(0, 0));
}
});
}
}
});
populateAvailableRulesTable();
_tableSorter.setTableHeader(_detectorsTable.getTableHeader());
_tableSorter.setSortingStatus(1, TableSorter.ASCENDING);
TableSorter.makeSortable(_detectorsTable);
_detectorsTable.setCellSelectionEnabled(false);
_detectorsTable.setRowSelectionAllowed(true);
_detectorsTable.getColumnModel().getColumn(0).setPreferredWidth(30);
_detectorsTable.getColumnModel().getColumn(1).setPreferredWidth(350);
_detectorsTable.getColumnModel().getColumn(2).setPreferredWidth(100);
_detectorsTable.getColumnModel().getColumn(4).setPreferredWidth(400);
_detectorsTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
if (_detectorsTable.getModel().getRowCount() > 0) {
selectionModel.setSelectionInterval(0, 0);
}
}
return _detectorsTable;
}