TableModel (ExperimentalFeature[] experimentalFeatures) { return new AbstractTableModel() { final ExperimentalFeature[] features = experimentalFeatures; @Override public int getRowCount() { return features.length; } @Override public int getColumnCount() { return 2; } @Override public Object getValueAt(int rowIndex, int columnIndex) { String id = features[rowIndex].id; return switch (columnIndex) { case 0 -> id; case 1 -> Experiments.getInstance().isFeatureEnabled(id); default -> throw new IllegalArgumentException("Wrong column number"); }; } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return columnIndex == 1; } @Override public String getColumnName(int column) { return switch (column) { case 0 -> ApplicationBundle.message("column.name"); case 1 -> IdeBundle.message("column.enabled"); default -> throw new IllegalArgumentException("Wrong column number"); }; } @Override public void setValueAt(Object value, int rowIndex, int columnIndex) { if (value instanceof Boolean) { Experiments.getInstance().setFeatureEnabled(features[rowIndex].id, ((Boolean)value).booleanValue()); } } }; }