BrightSide Workbench Full Report + Source Code
BrightSide/elephant-dossier/src/main/java/org/turro/dossier/grant/ProjectGrantVM.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2021 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.dossier.grant;
20 
21 import java.util.List;
22 import org.turro.dossier.db.DossierPU;
23 import org.turro.dossier.zul.menu.DossierMenu;
24 import org.turro.jpa.Dao;
25 import org.zkoss.bind.annotation.BindingParam;
26 import org.zkoss.bind.annotation.Command;
27 import org.zkoss.bind.annotation.NotifyChange;
28 
33 public class ProjectGrantVM {
34 
35  private final ProjectGrantCriteria criteria = new ProjectGrantCriteria();
36 
37  public String getSearchValue() {
38  return criteria.getSearchValue();
39  }
40 
41  @NotifyChange("model")
42  @Command
43  public void setSearchValue(@BindingParam("searchValue") String searchValue) {
44  criteria.setSearchValue(searchValue);
45  }
46 
47  public boolean isMinimis() {
48  return criteria.isMinimis();
49  }
50 
51  @NotifyChange("model")
52  @Command
53  public void setMinimis(@BindingParam("minimis") boolean minimis) {
54  criteria.setMinimis(minimis);
55  }
56 
57  public boolean isNominimis() {
58  return criteria.isNominimis();
59  }
60 
61  @NotifyChange("model")
62  @Command
63  public void setNominimis(@BindingParam("nominimis") boolean nominimis) {
64  criteria.setNominimis(nominimis);
65  }
66 
67  public boolean isSubvention() {
68  return criteria.isSubvention();
69  }
70 
71  @NotifyChange("model")
72  @Command
73  public void setSubvention(@BindingParam("subvention") boolean subvention) {
74  criteria.setSubvention(subvention);
75  }
76 
77  public boolean isLoan() {
78  return criteria.isLoan();
79  }
80 
81  @NotifyChange("model")
82  @Command
83  public void setLoan(@BindingParam("loan") boolean loan) {
84  criteria.setLoan(loan);
85  }
86 
87  public boolean isCombination() {
88  return criteria.isCombination();
89  }
90 
91  @NotifyChange("model")
92  @Command
93  public void setCombination(@BindingParam("combination") boolean combination) {
94  criteria.setCombination(combination);
95  }
96 
97  public boolean isCollaboration() {
98  return criteria.isCollaboration();
99  }
100 
101  @NotifyChange("model")
102  @Command
103  public void setCollaboration(@BindingParam("collaboration") boolean collaboration) {
104  criteria.setCollaboration(collaboration);
105  }
106 
107  public boolean isIndividual() {
108  return criteria.isIndividual();
109  }
110 
111  @NotifyChange("model")
112  @Command
113  public void setIndividual(@BindingParam("individual") boolean individual) {
114  criteria.setIndividual(individual);
115  }
116 
117  public boolean isHiring() {
118  return criteria.isHiring();
119  }
120 
121  @NotifyChange("model")
122  @Command
123  public void setHiring(@BindingParam("hiring") boolean hiring) {
124  criteria.setHiring(hiring);
125  }
126 
127  public boolean isIdi() {
128  return criteria.isIdi();
129  }
130 
131  @NotifyChange("model")
132  @Command
133  public void setIdi(@BindingParam("idi") boolean idi) {
134  criteria.setIdi(idi);
135  }
136 
137  public boolean isInvestment() {
138  return criteria.isInvestment();
139  }
140 
141  @NotifyChange("model")
142  @Command
143  public void setInvestment(@BindingParam("investment") boolean investment) {
144  criteria.setInvestment(investment);
145  }
146 
147  public boolean isStartUp() {
148  return criteria.isStartUp();
149  }
150 
151  @NotifyChange("model")
152  @Command
153  public void setStartUp(@BindingParam("startUp") boolean startUp) {
154  criteria.setStartUp(startUp);
155  }
156 
157  public boolean isMicro() {
158  return criteria.isMicro();
159  }
160 
161  @NotifyChange("model")
162  @Command
163  public void setMicro(@BindingParam("micro") boolean micro) {
164  criteria.setMicro(micro);
165  }
166 
167  public boolean isSmall() {
168  return criteria.isSmall();
169  }
170 
171  @NotifyChange("model")
172  @Command
173  public void setSmall(@BindingParam("small") boolean small) {
174  criteria.setSmall(small);
175  }
176 
177  public boolean isMedium() {
178  return criteria.isMedium();
179  }
180 
181  @NotifyChange("model")
182  @Command
183  public void setMedium(@BindingParam("medium") boolean medium) {
184  criteria.setMedium(medium);
185  }
186 
187  public boolean isBig() {
188  return criteria.isBig();
189  }
190 
191  @NotifyChange("model")
192  @Command
193  public void setBig(@BindingParam("big") boolean big) {
194  criteria.setBig(big);
195  }
196 
197  @NotifyChange("model")
198  @Command("update")
199  public void update() {}
200 
201  @Command
202  public void newGrant() {
204  }
205 
206  public List getModel() {
207  return getDao().getResultList(criteria.create());
208  }
209 
210  /* Dao Util */
211 
212  private Dao _dao;
213 
214  private Dao getDao() {
215  if(_dao == null) {
216  _dao = new DossierPU();
217  }
218  return _dao;
219  }
220 
221 }