Revision 12107 trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/table/models/CheckBoxModel.java

View differences:

CheckBoxModel.java
19 19
package org.gvsig.gui.beans.table.models;
20 20

  
21 21
import javax.swing.table.DefaultTableModel;
22

  
23 22
/**
24 23
 * Componente tabla
25 24
 * 
26 25
 * @author Nacho Brodin (brodin_ign@gva.es)
27
 *
28 26
 */
29 27
public class CheckBoxModel extends DefaultTableModel implements IModel{
30
    final private static long 	serialVersionUID = -3370601314380922368L;
28
	final private static long serialVersionUID = -3370601314380922368L;
31 29

  
32
    public CheckBoxModel(String[] columnNames) {
33
        super(new Object[0][2], columnNames);
34
    }
30
	public CheckBoxModel(String[] columnNames) {
31
		super(new Object[0][2], columnNames);
32
	}
35 33

  
36
    public Class getColumnClass(int c) {
37
        if (c < 1) {
38
            return Boolean.class;
39
        }
34
	@SuppressWarnings("unchecked")
35
	public Class getColumnClass(int c) {
36
		if (c < 1) {
37
			return Boolean.class;
38
		}
40 39

  
41
        return String.class;
42
    }
40
		return String.class;
41
	}
43 42

  
44
    public void setValueAt(Object value, int row, int col) {
45
        super.setValueAt(value, row, col);
46
    }
43
	public void setValueAt(Object value, int row, int col) {
44
		super.setValueAt(value, row, col);
45
	}
47 46

  
48
    public void addNew() {
49
        super.addRow(new Object[] {
50
                         new Boolean(false), ""
51
                     });
52
    }
53
    
54
    public Object[] getNewLine(){
55
    	return new Object[] {	new Boolean(false), ""
56
            				};
57
    }
58
            
59
}
47
	public void addNew() {
48
		super.addRow(new Object[] { new Boolean(false), "" });
49
	}
50

  
51
	public Object[] getNewLine() {
52
		return new Object[] { new Boolean(false), "" };
53
	}
54
}

Also available in: Unified diff