public Object coerceToBean(Object val, Component comp) { //save return val != null ? ((Tab) val).getLabel() : null; } }
public Object coerceToUi(Object val, Component comp) { //load if (val != null) { //iterate to find the selected radio via the value for (Iterator it = ((Tabbox) comp).getTabs().getChildren().iterator(); it.hasNext();) { final Component child = (Component) it.next(); if (child instanceof Tab) { if (val.equals(((Tab) child).getLabel())) { return child; } } } } return null; }
public Object coerceToBean(Object val, Component comp, BindContext ctx) { if (val != null) { final Tabbox tbx = (Tabbox) comp; final ListModel<?> model = tbx.getModel(); if (model != null && !(model instanceof Selectable)) { throw new UiException("model doesn't implement Selectable"); } if (model != null) { Set<?> selection = ((Selectable<?>) model).getSelection(); if (selection == null || selection.size() == 0) return null; return selection.iterator().next(); } else { //no model return ((Tab) val).getLabel(); } } return null; } }
final Component child = it.next(); if (child instanceof Tab) { if (val.equals(((Tab) child).getLabel())) { return child;
final String imgTag = self.getImgTag(), label = self.getLabel(); if ("".equals(label) && imgTag == null) { wh.write(" ");
public void render(Component comp, Writer out) throws IOException { final Tab self = (Tab) comp; final SmartWriter wh = new SmartWriter(out); final String zcs = self.getZclass() + '-'; wh.write("<li id=\"" + self.getUuid() + "\""); wh.write(" z.type=\"Tab2\"").write(self.getOuterAttrs()).write(self.getInnerAttrs()).writeln(">"); if (self.isClosable()) { wh.writeln("<a id=\"" + self.getUuid() + "!close\" class=\"" + zcs + "close\" ></a>"); } else { wh.writeln("<a class=\"" + zcs + "noclose\" ></a>"); } wh.write("<div class=\"" + zcs + "hl\" id=\"" + self.getUuid() + "!real\""); wh.writeln(self.getInnerAttrs() + " >"); wh.writeln("<div id=\"" + self.getUuid() + "!hr\" class=\"" + zcs + "hr\">"); if (self.isClosable()) { wh.writeln("<div id=\"" + self.getUuid() + "!hm\" class=\"" + zcs + "hm " + zcs + "hm-close\" >"); } else { wh.writeln("<div id=\"" + self.getUuid() + "!hm\" class=\"" + zcs + "hm \">"); } wh.writeln("<span class=\"" + zcs + "text\">"); wh.write(self.getImgTag()); new Out(self.getLabel()).render(out); wh.writeln("</span></div></div></div></li>"); } }
new Out(tab.getLabel()).render(out); wh.write("</span></div></div></div></div></div>"); wh.write("<div id=\""+uuid+"!real\"") wh.writeln("<span class=\"").write(tabzcs).write("text\">"); wh.write(tab.getImgTag()); new Out(tab.getLabel()).render(out); wh.writeln("</span></span></div></div></div></div>"); wh.write("<div id=\""+uuid+"!real\"")