mainPanel.setOpaque(false);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex) {
DatasetEditorModel model = (DatasetEditorModel) table.getModel();
sortingLabel.setText(null);
int width = 0;
String columnName = value.toString();
SortingState sortingState = (SortingState) model.getSortingState();
SortingInstruction sortingInstruction = sortingState.getSortingInstruction(columnName);
if (sortingInstruction != null) {
Icon icon = sortingInstruction.getDirection() == SortDirection.ASCENDING ?
Icons.DATA_EDITOR_SORT_ASC :
Icons.DATA_EDITOR_SORT_DESC;
sortingLabel.setIcon(icon);
width += icon.getIconWidth();
if (sortingState.size() > 1) {
sortingLabel.setText(Integer.toString(sortingInstruction.getIndex()));
}
} else {
sortingLabel.setIcon(null);
}
nameLabel.setText(columnName);
DBDataset dataset = model.getDataset();
if (dataset != null) {
DBColumn column = dataset.getColumn(columnName);
if (column != null) {
boolean primaryKey = column.isPrimaryKey();
boolean foreignKey = column.isForeignKey();