BrightSide Workbench Full Report + Source Code
ElephantStatusBar.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2020 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.menu;
20 
21 import org.turro.zkoss.layout.VSeparator;
22 import org.zkoss.zk.ui.HtmlBasedComponent;
23 import org.zkoss.zul.Cell;
24 import org.zkoss.zul.Hbox;
25 import org.zkoss.zul.Label;
26 
31 public class ElephantStatusBar extends Hbox {
32 
33  private Cell message, user, company, status;
34  private Label lmsg;
35 
36  public ElephantStatusBar() {
37  initiate();
38  }
39 
40  public void setMessage(String message) {
41  lmsg.setValue(message);
42  }
43 
44  public void setUser(HtmlBasedComponent comp) {
45  user.getChildren().clear();
46  if(comp != null) {
47  comp.setStyle(getStyle() + ";white-space:nowrap;");
48  user.appendChild(comp);
49  }
50  }
51 
52  public void setCompany(HtmlBasedComponent comp) {
53  company.getChildren().clear();
54  if(comp != null) {
55  comp.setStyle(getStyle() + ";white-space:nowrap;");
56  company.appendChild(comp);
57  }
58  }
59 
60  public void setStatus(HtmlBasedComponent comp) {
61  status.getChildren().clear();
62  if(comp != null) {
63  comp.setStyle(getStyle() + ";white-space:nowrap;");
64  status.appendChild(comp);
65  }
66  }
67 
68  private void initiate() {
69  setSclass("mainStatusbar");
70  setSclass("z-valign-middle");
71  setAlign("center");
72  setHflex("true");
73  message = new Cell();
74  message.setHflex("1");
75  appendChild(message);
76  appendChild(new VSeparator(true));
77  lmsg = new Label();
78  message.appendChild(lmsg);
79  user = new Cell();
80  user.setHflex("min");
81  appendChild(user);
82  appendChild(new VSeparator(true));
83  company = new Cell();
84  company.setHflex("min");
85  appendChild(company);
86  appendChild(new VSeparator(true));
87  status = new Cell();
88  status.setHflex("min");
89  appendChild(status);
90  }
91 
92 }
void setStatus(HtmlBasedComponent comp)
void setCompany(HtmlBasedComponent comp)
void setUser(HtmlBasedComponent comp)