/[xulu]/trunk.bakup/src/appl/util/NonEditableTableModel.java
ViewVC logotype

Contents of /trunk.bakup/src/appl/util/NonEditableTableModel.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (show annotations)
Wed Feb 10 16:14:27 2010 UTC (14 years, 10 months ago) by alfonx
File size: 947 byte(s)
backup of trunk
1 package appl.util;
2
3 import javax.swing.table.DefaultTableModel;
4 import javax.swing.table.TableModel;
5
6 /**
7 * Simple {@link TableModel} that allows to specify columns which are not editable
8 *
9 * @author Dominik Appl
10 */
11 public class NonEditableTableModel extends DefaultTableModel {
12 private final boolean[] isEditable;
13
14 /**
15 * @param columnNames
16 * <code>array</code> containing the names of the new columns;
17 * if this is <code>null</code> then the model has no columns
18 *
19 * @param isEditable Specifies for each column if editable or not
20 *
21 * @param rowCount
22 * the number of rows the table holds
23 */
24 public NonEditableTableModel(Object[] columnNames, boolean[] isEditable,
25 int rowCount) {
26 super(columnNames, rowCount);
27 this.isEditable = isEditable;
28 }
29
30 @Override
31 public boolean isCellEditable(int row, int column) {
32 return isEditable[column];
33 }
34
35 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26