@Override
public TableCellEditor getCellEditor(int row, int column) {
if (column == 0)
return super.getCellEditor(row, column);
PropertyTableModel model = (PropertyTableModel) getModel();
Property property = model.getProperty(row);
if (property.getKlass().equals(Color.class))
return new ColorEditor();
if (property.getKlass().equals(Font.class)) {
JComboBox box = new JComboBox(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
return new DefaultCellEditor(box);
}
if (property.getKlass().equals(Boolean.class)) {
JComboBox box = new JComboBox(new String[] { "true", "false" });
return new DefaultCellEditor(box);
}
if (property.getKlass().equals(String[].class)) {
JComboBox box = new JComboBox(property.getItems());
return new DefaultCellEditor(box);
}
if (property.getKlass().equals(Integer.class))
return new IntegerEditor(0, Integer.MAX_VALUE);
return super.getCellEditor(row, column);
}