use of org.apache.cayenne.modeler.util.CayenneCellEditor in project cayenne by apache.
the class ProcedureParameterTab method rebuildTable.
protected void rebuildTable(Procedure procedure) {
ProcedureParameterTableModel model = new ProcedureParameterTableModel(procedure, eventController, this);
table.setModel(model);
table.setRowHeight(25);
table.setRowMargin(3);
// number column tweaking
TableColumn numberColumn = table.getColumnModel().getColumn(ProcedureParameterTableModel.PARAMETER_NUMBER);
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setHorizontalAlignment(SwingConstants.CENTER);
numberColumn.setCellRenderer(renderer);
TableColumn typesColumn = table.getColumnModel().getColumn(ProcedureParameterTableModel.PARAMETER_TYPE);
JComboBox typesEditor = Application.getWidgetFactory().createComboBox(TypesMapping.getDatabaseTypes(), true);
AutoCompletion.enable(typesEditor);
typesColumn.setCellEditor(Application.getWidgetFactory().createCellEditor(typesEditor));
// direction column tweaking
TableColumn directionColumn = table.getColumnModel().getColumn(ProcedureParameterTableModel.PARAMETER_DIRECTION);
JComboBox directionEditor = Application.getWidgetFactory().createComboBox(ProcedureParameterTableModel.PARAMETER_DIRECTION_NAMES, false);
directionEditor.setEditable(false);
directionColumn.setCellEditor(new CayenneCellEditor(directionEditor));
moveUp.setEnabled(false);
moveDown.setEnabled(false);
tablePreferences.bind(table, null, null, null);
}
Aggregations