model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { model.addElement(cap);
/** * Copies the components of this list into the specified array. * * @param anArray the array into which the components get copied * @throws IndexOutOfBoundsException if the array is not big enough */ @Override public void copyInto(Object[] anArray) { if (anArray.length < getSize()) { throw new IndexOutOfBoundsException("Array not big enough!"); } for (int i = 0; i < getSize(); i++) { anArray[i] = ((CheckBoxListItem) getElementAt(i)).getContent(); } }
model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { model.addElement(cap);
model = this.new CheckBoxListModel();
model = this.new CheckBoxListModel();
/** * transfers the selected Capabilities from the JList to the Capabilities * object. * * @see #m_Capabilities * @see #m_List */ protected void updateCapabilities() { CheckBoxListModel model; model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { if (model.getChecked(model.indexOf(cap))) { m_Capabilities.enable(cap); } else { m_Capabilities.disable(cap); } } }
/** * transfers the selected Capabilities from the JList to the Capabilities * object. * * @see #m_Capabilities * @see #m_List */ protected void updateCapabilities() { CheckBoxListModel model; model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { if (model.getChecked(model.indexOf(cap))) { m_Capabilities.enable(cap); } else { m_Capabilities.disable(cap); } } }
/** * Copies the components of this list into the specified array. * * @param anArray the array into which the components get copied * @throws IndexOutOfBoundsException if the array is not big enough */ @Override public void copyInto(Object[] anArray) { if (anArray.length < getSize()) { throw new IndexOutOfBoundsException("Array not big enough!"); } for (int i = 0; i < getSize(); i++) { anArray[i] = ((CheckBoxListItem) getElementAt(i)).getContent(); } }
/** * transfers the Capabilities object to the JList. * * @see #m_Capabilities * @see #m_List */ protected void updateList() { CheckBoxListModel model; model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { model.setChecked(model.indexOf(cap), m_Capabilities.handles(cap)); } }
/** * Constructs a CheckBoxListModel from an array of objects and then applies * setModel to it. * * @param listData the data to use */ @Override public void setListData(Object[] listData) { setModel(new CheckBoxListModel(listData)); }
/** * returns the checked state of the element at the given index * * @param index the index of the element to return the checked state for * @return the checked state of the specifed element */ public boolean getChecked(int index) { return ((CheckBoxListModel) getModel()).getChecked(index); }
/** * transfers the Capabilities object to the JList. * * @see #m_Capabilities * @see #m_List */ protected void updateList() { CheckBoxListModel model; model = (CheckBoxListModel) m_List.getModel(); for (Capability cap : Capability.values()) { model.setChecked(model.indexOf(cap), m_Capabilities.handles(cap)); } }
/** * Constructs a CheckBoxListModel from a Vector and then applies setModel to * it. */ public CheckBoxListModel(Vector listData) { for (int i = 0; i < listData.size(); i++) { addElement(listData.get(i)); } }
/** * sets the checked state of the element at the given index * * @param index the index of the element to set the checked state for * @param checked the new checked state */ public void setChecked(int index, boolean checked) { ((CheckBoxListModel) getModel()).setChecked(index, checked); }
/** * Constructs a CheckBoxListModel from a Vector and then applies setModel to * it. */ @Override public void setListData(@SuppressWarnings("rawtypes") Vector listData) { setModel(new CheckBoxListModel(listData)); }
/** * Constructs a CheckBoxListModel from a Vector and then applies setModel to * it. */ @Override public void setListData(@SuppressWarnings("rawtypes") Vector listData) { setModel(new CheckBoxListModel(listData)); }
/** * Constructs a CheckBoxListModel from an array of objects and then applies * setModel to it. * * @param listData the data to use */ @Override public void setListData(Object[] listData) { setModel(new CheckBoxListModel(listData)); }
/** * Constructs a CheckBoxListModel from a Vector and then applies setModel to * it. */ public CheckBoxListModel(Vector listData) { for (int i = 0; i < listData.size(); i++) { addElement(listData.get(i)); } }
/** * Constructs a CheckBoxListModel from an array of objects and then applies * setModel to it. * * @param listData the data to use */ public CheckBoxListModel(Object[] listData) { for (Object element : listData) { addElement(element); } }
/** * returns the checked state of the element at the given index * * @param index the index of the element to return the checked state for * @return the checked state of the specifed element */ public boolean getChecked(int index) { return ((CheckBoxListModel) getModel()).getChecked(index); }