BrightSide Workbench Full Report + Source Code
CustomerOrderFilterGrid.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2012 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.erp.sales;
20 
21 import org.turro.elephant.db.WhereClause;
22 import org.turro.zkoss.filter.FilterField;
23 import org.turro.zkoss.filter.FilterFieldOperator;
24 import org.turro.zkoss.filter.FilterGrid;
25 
30 public class CustomerOrderFilterGrid extends FilterGrid {
31 
33  super();
35  @Override
36  public void addConstraint(WhereClause wc) {
37  doAddConstraint(wc, "cu.orderId");
38  }
39  });
40  addField(new FilterField("lInternalId", 0L, FilterFieldOperator.FILTER_EQUAL) {
41  @Override
42  public void addConstraint(WhereClause wc) {
43  doAddConstraint(wc, "cu.id");
44  }
45  });
46  addField(new FilterField("lDate", new java.util.Date(new java.util.Date().getTime() - (1L * 30L * 24L * 60L * 60L * 1000L))) {
47  @Override
48  public void addConstraint(WhereClause wc) {
49  doAddConstraint(wc, "cu.orderDate");
50  }
51  });
52  addField(new FilterField("lDescription", "", FilterFieldOperator.FILTER_CONTAINS) {
53  @Override
54  public void addConstraint(WhereClause wc) {
55  doAddConstraint(wc, "cu.description");
56  }
57  });
58  if(!loadPreferences(this.getClass().getName()+"_filter")) {
59  addCurrentField("lNumber");
60  }
61  }
62 
63 }
FilterField addField(FilterField filterField)
Definition: FilterGrid.java:62