19 package org.turro.zkoss.label;
21 import java.util.function.Consumer;
22 import org.turro.string.Strings;
23 import org.zkoss.zk.ui.event.EventListener;
24 import org.zkoss.zk.ui.event.Events;
25 import org.zkoss.zul.A;
34 anchor.setWidth(
width);
44 anchor.setHflex(flex);
49 anchor.setVflex(flex);
54 anchor.setStyle(
style);
59 anchor.setTooltiptext(text);
74 .
value(Strings.truncateAndWarn(anchor.getLabel(), maxChars));
78 anchor.setLabel(text);
83 anchor.setIconSclass(
"z-icon-" +
icon);
88 anchor.setFocus(
true);
93 anchor.addEventListener(Events.ON_CLICK, listener);
101 public A
get(Consumer<A> onGet) {
102 onGet.accept(anchor);
109 return new As(text,
null);
124 private final A anchor;
126 private As(String text, String
image) {
127 this.anchor = Strings.isBlank(
image) ?
128 new A(text) : new A(text,
image);
static As content(String text, String image)
As tooltiptext(String text)
As onClick(EventListener listener)
static As image(String image)
As cssClass(String cssClass)
static As icon(String icon, String tip)
static As content(String text)