}
});
}
private KongaRowTable createTable() {
KongaTable table = new KongaTable(tableModel) {
@Override
public String getToolTipText(MouseEvent event) {
Point p = event.getPoint();
TableColumnMetaData col = columnDescriptorAtPoint(p);
if (col == DataElementTableModel.NAME) {
int row = rowAtPoint(p);
if (row >= 0) {
row = convertRowIndexToModel(row);
return tableModel.getRowObjectAt(row).getName();
}
}
return super.getToolTipText(event);
}
@Override
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
// F8 is by default bound to a "focusHeader" action. We want to use it for
// Resume Debugging. Just removing that KeyBinding from the InputMap does not seem
// to work (I don't know why).
if (KeyUtils.F8.equals(ks)) {
return false;
}
return super.processKeyBinding(ks, e, condition, pressed);
}
@Override
public boolean isCellEditable(int row, int column) {
TableColumnMetaData md = tableModel.getColumnDescriptor(column);
if (md == DataElementTableModel.NAME) {
return false;
}
DataElement de = tableModel.getRowObjectAt(row);
return de.getScope() == DataElementScope.GLOBAL || sourceDataElementValuesEditable;
}
};
table.setAutoCreateRowSorter(true);
TableStyles.wide().makeOver(table);
table.setShowVerticalLines(true);
installEditors(table);
table.setCellRendererFor(DataElementTableModel.NAME, new NameTableRenderer());
table.setRendererPreparer(new RendererPreparerImpl(table.getFont()));
setNumberOfVisibleRows(table, 10);
return new KongaRowTable(table);
}