1 24 package org.riotfamily.riot.list.ui; 25 26 import java.util.List ; 27 28 32 public class ListModel { 33 34 private String editorId; 35 36 private String parentId; 37 38 private List columns; 39 40 private List items; 41 42 private List listCommands; 43 44 private int itemCommandCount; 45 46 private int pages; 47 48 private int pageSize; 49 50 private int currentPage; 51 52 private int itemsTotal; 53 54 private String filterFormHtml; 55 56 private String cssClass; 57 58 public ListModel(int itemsTotal, int pageSize, int currentPage) { 59 this.itemsTotal = itemsTotal; 60 this.pageSize = pageSize; 61 this.currentPage = currentPage; 62 if (pageSize > 0) { 63 pages = (int) itemsTotal / pageSize + 1; 64 if (itemsTotal % pageSize == 0) { 65 pages--; 66 } 67 } 68 } 69 70 public String getEditorId() { 71 return this.editorId; 72 } 73 74 public void setEditorId(String editorId) { 75 this.editorId = editorId; 76 } 77 78 public String getParentId() { 79 return this.parentId; 80 } 81 82 public void setParentId(String parentId) { 83 this.parentId = parentId; 84 } 85 86 public List getColumns() { 87 return this.columns; 88 } 89 90 public void setColumns(List columns) { 91 this.columns = columns; 92 } 93 94 public List getItems() { 95 return this.items; 96 } 97 98 public void setItems(List items) { 99 this.items = items; 100 } 101 102 public List getListCommands() { 103 return this.listCommands; 104 } 105 106 public void setListCommands(List listCommands) { 107 this.listCommands = listCommands; 108 } 109 110 public int getItemCommandCount() { 111 return this.itemCommandCount; 112 } 113 114 public void setItemCommandCount(int itemCommandCount) { 115 this.itemCommandCount = itemCommandCount; 116 } 117 118 public int getCurrentPage() { 119 return this.currentPage; 120 } 121 122 public int getItemsTotal() { 123 return this.itemsTotal; 124 } 125 126 public int getPages() { 127 return this.pages; 128 } 129 130 public int getPageSize() { 131 return this.pageSize; 132 } 133 134 public String getFilterFormHtml() { 135 return this.filterFormHtml; 136 } 137 138 public void setFilterFormHtml(String filterFormHtml) { 139 this.filterFormHtml = filterFormHtml; 140 } 141 142 public String getCssClass() { 143 return this.cssClass; 144 } 145 146 public void setCssClass(String cssClass) { 147 this.cssClass = cssClass; 148 } 149 150 } 151 | Popular Tags |