Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.Serializable;
- import java.util.LinkedList;
- import java.util.List;
- public class ModelForForm implements Serializable {
- private static final long serialVersionUID = -6051225004495642982L;
- private Boolean checkAll;
- private String txtName;
- private List<Wrapper> list = new LinkedList<>();
- public ModelForForm() {
- }
- public void setListTestBean(List<TestBean> listTestBean) {
- for (TestBean testBean : listTestBean) {
- list.add(new Wrapper(testBean));
- }
- }
- public int size() {
- int n = 0;
- for (Wrapper wrapper : list) {
- n += wrapper.getChecked() ? 1 : 0;
- }
- return n;
- }
- public void serCheckAll(boolean value) {
- for (Wrapper wrapper : list) {
- wrapper.setChecked(value);
- }
- }
- public boolean allItemChecked() {
- return size() == list.size();
- }
- public Boolean getCheckAll() {
- return checkAll;
- }
- public void setCheckAll(Boolean checkAll) {
- this.checkAll = checkAll;
- }
- public List<Wrapper> getList() {
- return list;
- }
- public String getTxtName() {
- return txtName;
- }
- public void setTxtName(String txtName) {
- this.txtName = txtName;
- }
- }
Add Comment
Please, Sign In to add comment