Add a row to the end of the GUI or before another row.

@param gui
@param [dom] If specified, inserts the dom content in the new row
@param [liBefore] If specified, places the new row before another row
1578
function addRow(gui, dom, liBefore) {
    var li = document.createElement('li');
    if (dom) li.appendChild(dom);
    if (liBefore) {
      gui.__ul.insertBefore(li, params.before);
    } else {
      gui.__ul.appendChild(li);
    }
    gui.onResize();
    return li;
  }
531683
def insert_before(old, new):
    
    parent = old.getparent()
    parent.insert(parent.index(old), new)
599480
def on_add_rows(self, event):
        
        num_rows = self.rows_spin_ctrl.GetValue()
        #last_row = self.grid.GetNumberRows()
        for row in range(num_rows):
            self.grid.add_row()
            #if not self.grid.changes:
            #    self.grid.changes = set([])
            #self.grid.changes.add(last_row)
            #last_row += 1
        self.main_sizer.Fit(self)
409916
def add_ui(self, klass, *args, **kwargs):
        '''

        '''
        ui = klass(self.widget, *args, **kwargs)
        self.widget.uis.append(ui)
        return ui
541434
protected void addClassRow(TypeElement usedClass, PackageElement pkg,
            Content contentTree) {
        DocPath dp = pathString(usedClass,
                DocPaths.CLASS_USE.resolve(DocPath.forName(utils, usedClass)));
        StringContent stringContent = new StringContent(utils.getSimpleName(usedClass));
        Content thType = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst,
                getHyperLink(dp.fragment(getPackageAnchorName(pkg)), stringContent));
        contentTree.addContent(thType);
        HtmlTree tdDesc = new HtmlTree(HtmlTag.TD);
        tdDesc.addStyle(HtmlStyle.colLast);
        addIndexComment(usedClass, tdDesc);
        contentTree.addContent(tdDesc);
    }
30844
public void insertRow(int index, Object element)
    {
        elements.add(index, element);
        fireTableRowsInserted(index, index);
    }
476684
def _add_row(self, index):
        
        self._index.append(index)
        for c, _ in enumerate(self._columns):
            self._data[c].append(None)
126960
def _append(self, row):
		
		self.cursor.execute(self.append_statement, self.append_attrgetter(row))
285737
public void add(AbstractCompactedRow row)
    {
        assert desc.range.contains(row.key.getToken()) : row.key.getToken() + " is not contained in " + desc.range;
        assert lastKey == null || lastKey.compareTo(row.key) < 0
               : "row " + row.key + " received out of order wrt " + lastKey;
        lastKey = row.key;

        if (range == null)
            range = ranges.next();

        // generate new ranges as long as case 1 is true
        while (!range.contains(row.key.getToken()))
        {
            // add the empty hash, and move to the next range
            range.ensureHashInitialised();
            range = ranges.next();
        }

        // case 3 must be true: mix in the hashed row
        RowHash rowHash = rowHash(row);
        if (rowHash != null)
        {
            range.addHash(rowHash);
        }
    }
1228206
def _insert_row(self, i, index):
        
        if i == len(self._index):
            self._add_row(index)
        else:
            self._index.insert(i, index)
            for c in range(len(self._columns)):
                self._data[c].insert(i, None)
610187
public void insert(Widget w, int beforeIndex) throws IndexOutOfBoundsException {

        insert(w, m_main, beforeIndex, true);
    }
468538
public void moveBefore( Row item )
	{
		if( this == item )
			return;

		Element lastTrToMove = getLastLeafTR();
		Element firstChildRow = DOM.getNextSibling( m_tr );

		// remove from its current position
		Row parentItem = m_parent;
		if( parentItem == null )
			parentItem = this.treeTable.m_rootItem;
		parentItem.getChilds().remove( this );

		// insert at the selected position
		if( item == null )
		{
			// insert at the end of the current parent

			// DOM add
			Row lastLeaf = parentItem.getLastLeaf();
			Element trToInsertAfter = lastLeaf.m_tr;
			if( trToInsertAfter != null )
			{
				int after = DOM.getChildIndex( this.treeTable.m_body, trToInsertAfter );
				int before = after + 1;

				DOM.insertChild( this.treeTable.m_body, m_tr, before );
			}
			else
			{
				DOM.appendChild( this.treeTable.m_body, m_tr );
			}

			parentItem.getChilds().add( this );
		}
		else
		{
			Row newParentItem = item.m_parent;
			if( newParentItem == null )
				newParentItem = this.treeTable.m_rootItem;
			int itemPos = item.m_parent.getChilds().indexOf( item );
			newParentItem.getChilds().add( itemPos, this );
			DOM.insertBefore( this.treeTable.m_body, m_tr, item.m_tr );
		}

		// take care of the left padding
		Element firstTd = DOM.getChild( m_tr, 0 );
		firstTd.getStyle().setPaddingLeft( getLevel() * this.treeTable.treePadding, Unit.PX );

		// update child rows
		Element nextTR = DOM.getNextSibling( m_tr );
		if( firstChildRow != null && lastTrToMove != null && hasChilds() )
		{
			while( true )
			{
				Element next = DOM.getNextSibling( firstChildRow );
				DOM.insertBefore( this.treeTable.m_body, firstChildRow, nextTR );
				if( firstChildRow == lastTrToMove )
					break;
				firstChildRow = next;
			}
		}
	}
353446
def add_button(self, grid_lang, ass, row, column):
        
        #print "gui_helper add_button"
        image_name = ass[0].icon_path
        label = "<b>" + ass[0].fullname + "</b>"
        if not image_name:
            btn = self.button_with_label(label)
        else:
            btn = self.button_with_image(label, image=ass[0].icon_path)
        #print "Dependencies button",ass[0]._dependencies
        if ass[0].description:
            btn.set_has_tooltip(True)
            btn.connect("query-tooltip",
                        self.parent.tooltip_queries,
                        self.get_formatted_description(ass[0].description)
            )
        btn.connect("clicked", self.parent.btn_clicked, ass[0].name)
        if row == 0 and column == 0:
            grid_lang.add(btn)
        else:
            grid_lang.attach(btn, column, row, 1, 1)
        return btn
1100680
def _add_row(self, index):
        
        self._index.append(index)
        self._data.append(None)
562838
public void insert(final Widget page, final Widget tab, final int beforeIndex) {
        final String text = (tab instanceof HasText) ? ((HasText) tab).getText() : "Tab #" + beforeIndex;

        if (beforeIndex < PAGE_LIMIT - 1) {
            // visible pages
            Tab t = tabs.add(text, beforeIndex);
            super.insert(page, t, beforeIndex);

        } else if (beforeIndex == PAGE_LIMIT - 1) {
            // last visible page
            Tab t = tabs.add(text, beforeIndex);
            offPageContainer.add(new OffPageText(0, text), page);
            super.insert(offPageContainer.asWidget(), t, beforeIndex);

        } else {
            // off page - don't use beforeIndex as it'll always be PAGE_LIMIT
            int last = offPageContainer.size();
            offPageContainer.add(new OffPageText(last, text), page);
            tabs.showSelector();
        }
    }
1360787
protected void addPrevRenderedRow(final Object rowKey) {
		WTableComponentModel model = getOrCreateComponentModel();
		if (model.prevRenderedRows == null) {
			model.prevRenderedRows = new HashSet<>();
		}
		model.prevRenderedRows.add(rowKey);
	}
580451
def add_tag_before(tag_name, tag_text, parent_tag, before_tag_name):
    
    new_tag = Element(tag_name)
    new_tag.text = tag_text
    if get_first_element_index(parent_tag, before_tag_name):
        parent_tag.insert( get_first_element_index(parent_tag, before_tag_name) - 1, new_tag)
    return parent_tag