public Component getComponentCollectionOwner(Component comp) { if (comp instanceof Row) { final Row row = (Row) comp; return row.getGrid(); } else { throw new UiException("Unsupported type for RowCollectionItem: " + comp); } }
/** Returns the style class. * By default, it is the same as grid's stye class, unless * {@link #setSclass} is called with non-empty value. */ public String getSclass() { final String sclass = super.getSclass(); if (sclass != null) return sclass; final Grid grid = getGrid(); return grid != null ? grid.getSclass() : sclass; }
/** Internal Use only. Sets whether the content of this row is loaded; used if * the grid owning this row is using a list model. */ /*package*/ void setLoaded(boolean loaded) { if (loaded != _loaded) { _loaded = loaded; final Grid grid = getGrid(); if (grid != null && grid.getModel() != null) smartUpdate("_loaded", _loaded); } }
public void setupBindingRenderer(Component comp, DataBinder binder) { if (comp instanceof Row) { final Row row = (Row) comp; final Grid grid = row.getGrid(); if (grid.getRowRenderer() == null) { grid.setRowRenderer(new BindingRowRenderer(row, binder)); } } }
/** * Check if comp can be waived from linking templates * @param comp */ private static boolean isSkippable(Component comp) { // Bug: B50-3183438: skip only when it has model if (comp instanceof Comboitem) { Combobox b = (Combobox) ((Comboitem) comp).getParent(); if (b != null && b.getModel() != null) return true; } else if (comp instanceof Row) { Grid g = ((Row) comp).getGrid(); if (g != null && g.getModel() != null) return true; } else if (comp instanceof Listitem) { Listbox b = ((Listitem) comp).getListbox(); if (b != null && b.getModel() != null) return true; } return false; }
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>"); }