/** * 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); } } }
/** * 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); }
/** * 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); }