12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package ui.view;
- import javax.swing.table.DefaultTableModel;
- /**
- * Property Table.
- *
- * @author Gruppe14
- */
- public class PropertyTable extends DefaultTableModel {
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- Class clazz = String.class;
- if(columnIndex == 3) {
- clazz = Boolean.class;
- return clazz;
- }
-
-
- if (getColumnCount() == 8) {
- switch (columnIndex) {
- case 6:
- clazz = Boolean.class;
- case 7:
- clazz = Boolean.class;
- break;
- }
- } else if (getColumnCount() == 7) {
- switch (columnIndex) {
- case 5:
- clazz = Boolean.class;
- case 6:
- clazz = Boolean.class;
- break;
- }
- }
- return clazz;
- }
-
- @Override
- public boolean isCellEditable(int row, int column) {
- return getColumnCount() == 8 && column > 1
- || getColumnCount() == 7 && column > 0;
- }
- }
|