BrightSide Workbench Full Report + Source Code
ControlAdapter.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.command;
20 
21 import org.zkoss.zk.ui.HtmlBasedComponent;
22 import org.zkoss.zul.Label;
23 import org.zkoss.zul.impl.LabelImageElement;
24 
29 public class ControlAdapter {
30 
31  private HtmlBasedComponent component;
32 
33  public ControlAdapter(HtmlBasedComponent component) {
34  this.component = component;
35  }
36 
37  public HtmlBasedComponent getComponent() {
38  return component;
39  }
40 
41  public HtmlBasedComponent setWidth(String width) {
42  component.setWidth(width);
43  return component;
44  }
45 
46  public HtmlBasedComponent setVflex(String flex) {
47  component.setVflex(flex);
48  return component;
49  }
50 
51  public HtmlBasedComponent setTooltiptext(String tooltiptext) {
52  component.setTooltiptext(tooltiptext);
53  return component;
54  }
55 
56  public HtmlBasedComponent setStyle(String style) {
57  component.setStyle(style);
58  return component;
59  }
60 
61  public HtmlBasedComponent setSclass(String sclass) {
62  component.setSclass(sclass);
63  return component;
64  }
65 
66  public HtmlBasedComponent setHflex(String flex) {
67  component.setHflex(flex);
68  return component;
69  }
70 
71  public HtmlBasedComponent setHeight(String height) {
72  component.setHeight(height);
73  return component;
74  }
75 
76  public HtmlBasedComponent setFocus(boolean focus) {
77  component.setFocus(focus);
78  return component;
79  }
80 
81  public HtmlBasedComponent setDroppable(String droppable) {
82  component.setDroppable(droppable);
83  return component;
84  }
85 
86  public HtmlBasedComponent setDraggable(String draggable) {
87  component.setDraggable(draggable);
88  return component;
89  }
90 
91  public HtmlBasedComponent setLabel(String label) {
92  if(component instanceof Label) {
93  ((Label) component).setValue(label);
94  } if(component instanceof LabelImageElement) {
95  ((LabelImageElement) component).setLabel(label);
96  }
97  return component;
98  }
99 
100  public HtmlBasedComponent setImage(String image) {
101  if(component instanceof LabelImageElement) {
102  ((LabelImageElement) component).setImage(image);
103  }
104  return component;
105  }
106 
107 }
HtmlBasedComponent setLabel(String label)
ControlAdapter(HtmlBasedComponent component)
HtmlBasedComponent setVflex(String flex)
HtmlBasedComponent setFocus(boolean focus)
HtmlBasedComponent setWidth(String width)
HtmlBasedComponent setHflex(String flex)
HtmlBasedComponent setDraggable(String draggable)
HtmlBasedComponent getComponent()
HtmlBasedComponent setTooltiptext(String tooltiptext)
HtmlBasedComponent setSclass(String sclass)
HtmlBasedComponent setStyle(String style)
HtmlBasedComponent setImage(String image)
HtmlBasedComponent setDroppable(String droppable)
HtmlBasedComponent setHeight(String height)