prepareTableData(usageMappings, dataRows, names);
if (names.size() > 0)
{
AbstractTableModel tableModel = new MappingsTableModel(names);
final JBTable table = new JBTable(tableModel);
table.setCellSelectionEnabled(true);
table.setAutoCreateRowSorter(true);
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout());
JButton button = new JButton(REFRESH_ALL, IconLoader.getIcon("/vcs/refresh.png"));
button.addMouseListener(new MouseAdapter()
{
@Override public void mouseClicked(MouseEvent e)
{
refreshValues();
}
});
jPanel.add(button, BorderLayout.NORTH);
JBScrollPane jbScrollPane = new JBScrollPane(table);
jbScrollPane.getVerticalScrollBar().setUnitIncrement(16);
jPanel.add(jbScrollPane, BorderLayout.CENTER);
Content content = ContentFactory.SERVICE.getInstance().createContent(jPanel, tableName, false);
contentManager.addContent(content);
table.addMouseListener(new MyMouseAdapter(table, dataRows, project));
table.setEnableAntialiasing(true);
return content;
}
return null;