@SuppressWarnings("unchecked") public void render(int x, int y) { Grid grid = target.as(Grid.class); Rows rows = grid.getRows(); if(rows==null) return; List<Component> children = rows.getChildren(); if(x==-1) x = 0; if(y==-1) y = rows.getChildren().size()-1; ArrayList<String> ids = new ArrayList<String>(); while(true){ if(x > y) break; Row r = (Row)children.get(x++); if(r!=null && !isLoaded(r)){//damn, isLoaded is not open in row ids.add(r.getUuid()); } } if(ids.size()==0) return; String desktopId = target.getDesktop().getId(); String cmd = Events.ON_RENDER; Map<String, Object> data = EventDataManager.getInstance().build( new RenderEvent(cmd, new HashSet<String>(ids))); ((ClientCtrl) target.getClient()).postUpdate(desktopId, target.getUuid(), cmd, data, false); ((ClientCtrl) getClient()).flush(desktopId); }; }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Row self = (Row) comp; final String uuid = self.getUuid(); wh.write("<tr z.type=\"Grw\" id=\"").write(uuid).write('"') .write(self.getOuterAttrs()).write(self.getInnerAttrs()).write('>'); int i = 0; for (Iterator it = self.getChildren().iterator(); it.hasNext();i++) { final Component child = (Component) it.next(); wh.write("<td z.type=\"Gcl\" id=\"").write(child.getUuid()).write("!chdextr\"") .write(self.getChildAttrs(i)).write("><div id=\"").write(child.getUuid()) .write("!cell\" class=\"").write(self.getZclass()).write("-cnt"); if (self.getGrid().isFixedLayout()) wh.write(" z-overflow-hidden"); wh.write("\">"); child.redraw(out); wh.writeln("</div></td>"); } wh.writeln("</tr>"); }