use of com.alibaba.druid.support.jconsole.util.TableDataProcessor.ColumnData in project druid by alibaba.
the class DruidDataSourcePanel method tableDataProcess.
@Override
protected void tableDataProcess(ArrayList<LinkedHashMap<String, Object>> data) {
ColumnData columnData = TableDataProcessor.multiRow2Col(data, KEY_WORD_IDENTITY);
contentPanel = new JPanel(new GridLayout(0, 1));
addTable(columnData);
scrollPane.setViewportView(contentPanel);
}
use of com.alibaba.druid.support.jconsole.util.TableDataProcessor.ColumnData in project druid by alibaba.
the class DruidDriverPanel method tableDataProcess.
@Override
protected void tableDataProcess(ArrayList<LinkedHashMap<String, Object>> data) {
ColumnData columnData = TableDataProcessor.row2col(data);
tableModel = new DruidTableModel(columnData.getData());
table.setModel(tableModel);
table.getColumnModel().getColumn(0).setCellRenderer(new DruidTableCellRenderer());
scrollPane.setViewportView(table);
}
use of com.alibaba.druid.support.jconsole.util.TableDataProcessor.ColumnData in project druid by alibaba.
the class DruidSqlDetailFrame method addTable.
/**
* 将表格添加到contentPanel对象内部。
*
* @param contentPanel JPanel对象
* @param 当前表格的标题
* @param data 当前表格的数据
*/
private void addTable(JPanel contentPanel, String title, ArrayList<LinkedHashMap<String, Object>> data) {
final JPanel content1 = new JPanel();
content1.setLayout(new BorderLayout());
content1.setBorder((TitledBorder) BorderFactory.createTitledBorder(title));
contentPanel.add(content1);
ColumnData colData = TableDataProcessor.row2col(data);
JTable table = new JTable();
DruidTableModel tableModel = new DruidTableModel(colData.getData());
table.setModel(tableModel);
TableColumn col = table.getColumnModel().getColumn(0);
col.setCellRenderer(new DruidTableCellRenderer());
final JTableHeader header1 = table.getTableHeader();
content1.add(header1, BorderLayout.NORTH);
content1.add(table);
}
Aggregations