use of jmri.jmrit.beantable.EnablingCheckboxRenderer in project JMRI by JMRI.
the class TrainsScheduleTableModel method initTable.
void initTable() {
if (_table == null) {
return;
}
// Save table column order
XTableColumnModel tcm = new XTableColumnModel();
_table.setColumnModel(tcm);
_table.createDefaultColumnsFromModel();
// Install the button handlers
_table.setDefaultRenderer(Boolean.class, new EnablingCheckboxRenderer());
// set column preferred widths
for (int i = 0; i < tableScheduleColumnWidths.length; i++) {
tcm.getColumn(i).setPreferredWidth(tableScheduleColumnWidths[i]);
}
_frame.loadTableDetails(_table);
}
use of jmri.jmrit.beantable.EnablingCheckboxRenderer in project JMRI by JMRI.
the class TrainsTableModel method initTable.
void initTable() {
// Use XTableColumnModel so we can control which columns are visible
XTableColumnModel tcm = new XTableColumnModel();
_table.setColumnModel(tcm);
_table.createDefaultColumnsFromModel();
// Install the button handlers
ButtonRenderer buttonRenderer = new ButtonRenderer();
TableCellEditor buttonEditor = new ButtonEditor(new javax.swing.JButton());
tcm.getColumn(EDITCOLUMN).setCellRenderer(buttonRenderer);
tcm.getColumn(EDITCOLUMN).setCellEditor(buttonEditor);
tcm.getColumn(ACTIONCOLUMN).setCellRenderer(buttonRenderer);
tcm.getColumn(ACTIONCOLUMN).setCellEditor(buttonEditor);
tcm.getColumn(BUILDCOLUMN).setCellRenderer(buttonRenderer);
tcm.getColumn(BUILDCOLUMN).setCellEditor(buttonEditor);
_table.setDefaultRenderer(Boolean.class, new EnablingCheckboxRenderer());
// set column preferred widths
for (int i = 0; i < tcm.getColumnCount(); i++) {
tcm.getColumn(i).setPreferredWidth(_tableColumnWidths[i]);
}
_frame.loadTableDetails(_table);
// turn off column
tcm.setColumnVisible(tcm.getColumnByModelIndex(IDCOLUMN), _sort == SORTBYID);
}
Aggregations