1 19 20 package org.netbeans.modules.tasklist.core.checklist; 21 22 25 public class DefaultCheckListModel extends AbstractCheckListModel { 26 27 private static final long serialVersionUID = 1; 28 29 private boolean state[] = new boolean[0]; 30 private Object [] values = new Object [0]; 31 32 35 public DefaultCheckListModel() { 36 } 37 38 47 public DefaultCheckListModel(boolean[] state, Object [] values) { 48 if (state.length != values.length) 49 throw new IllegalArgumentException ("state.length != values.length"); 50 this.state = state; 51 this.values = values; 52 } 53 54 public boolean isChecked(int index) { 55 return state[index]; 56 } 57 58 public void setChecked(int index, boolean c) { 59 state[index] = c; 60 fireContentsChanged(this, index, index); 61 } 62 63 public int getSize() { 64 return values.length; 65 } 66 67 public Object getElementAt(int index) { 68 return values[index]; 69 } 70 } 71 | Popular Tags |