BrightSide Workbench Full Report + Source Code
LogControl.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.log;
20 
21 import org.zkoss.zk.ui.Executions;
22 import org.zkoss.zk.ui.IdSpace;
23 import org.zkoss.zk.ui.ext.AfterCompose;
24 import org.zkoss.zk.ui.select.Selectors;
25 import org.zkoss.zk.ui.select.annotation.Listen;
26 import org.zkoss.zk.ui.select.annotation.Wire;
27 import org.zkoss.zul.Intbox;
28 import org.zkoss.zul.Panel;
29 import org.zkoss.zul.Textbox;
30 
35 public class LogControl extends Panel implements IdSpace, AfterCompose {
36 
37  private String generatorPath, entityPath;
38 
39  @Wire("#max")
40  private Intbox max;
41 
42  @Wire("#comment")
43  private Textbox comment;
44 
45  @Wire("#entries")
46  private EntriesGrid entries;
47 
48  @Listen("onClick = #search")
49  public void onSearch() {
50  entries.setMax(max.getValue());
51  entries.setComment(comment.getValue());
52  entries.setGeneratorPath(generatorPath);
53  entries.setEntityPath(entityPath);
54  entries.search();
55  }
56 
57  public LogControl() {
58  Executions.createComponents("/WEB-INF/_zul/bs/comps/log/logControl.zul", this, null);
59  Selectors.wireComponents(this, this, false);
60  Selectors.wireEventListeners(this, this);
61  }
62 
63  @Override
64  public void afterCompose() {
65  initComponents();
66  }
67 
68  public void setGeneratorPath(String generatorPath) {
69  this.generatorPath = generatorPath;
70  }
71 
72  public void setEntityPath(String entityPath) {
73  this.entityPath = entityPath;
74  }
75 
76  private void initComponents() {
77  max.setValue(300);
78  comment.setValue("*");
79  onSearch();
80  updateButtons();
81  }
82 
83  private void updateButtons() {
84  }
85 
86 }
void setEntityPath(String entityPath)
Definition: LogControl.java:72
void setGeneratorPath(String generatorPath)
Definition: LogControl.java:68