private TableViewRowProxy rowProxyFor(Object row) { TableViewRowProxy rowProxy = null; if (row instanceof KrollDict) { KrollDict d = (KrollDict) row; rowProxy = new TableViewRowProxy(getTiContext()); rowProxy.handleCreationDict(d); rowProxy.setProperty(TiC.PROPERTY_CLASS_NAME, CLASSNAME_NORMAL); rowProxy.setProperty(TiC.PROPERTY_ROW_DATA, row); } else { rowProxy = (TableViewRowProxy) row; } rowProxy.setParent(this); return rowProxy; }
private void handleAppendRow(Object row) { TableViewRowProxy rowProxy = rowProxyFor(row); ArrayList<TableViewSectionProxy> sections = getSections(); if (sections.size() == 0) { Object[] data = {rowProxy}; processData(data); } else { TableViewSectionProxy lastSection = sections.get(sections.size() - 1); TableViewSectionProxy addedToSection = addRowToSection(rowProxy, lastSection); if (lastSection == null || !lastSection.equals(addedToSection)) { sections.add(addedToSection); } rowProxy.setProperty(TiC.PROPERTY_SECTION, addedToSection); rowProxy.setProperty(TiC.PROPERTY_PARENT, addedToSection); } getTableView().setModelDirty(); updateView(); }