Puts new widget to the container

@param widget Widget to put
@param name   Name of tab
@param index  id of 'cell' in the container to put widget to(numbered from 0)
@return This instance for chaining
359673
public TabbedPanel put(Widget widget, String name, int index) {
		if (index < 0 || index >= content.length) throw new IndexOutOfBoundsException();
		if (widget == null) return this;
		attach(widget);
		content[index] = new Tab(widget, name);
		this.sendElement();
		return this;
	}
4528
public function registerWidget($name, $location, $id)
    {
        $tab = '    ';
        $indent = str_repeat($tab, 5);

        register_sidebar([
            'name'          => $name,
            'id'            => sprintf('%s-%s', $location, $id),
            'class'         => sprintf('%s-%s', $location, $id),
            'before_widget' => sprintf('<div id="%%1$s" class="%s-widget %%2$s">', $location),
            'after_widget'  => sprintf('</div><!-- .%s-widget -->%s', $location, PHP_EOL),
            'before_title'  => sprintf('<h3 class="%s-widget-title">', $location),
            'after_title'   => '</h3>'
        ]);
    }
1121241
def index_to_widget(self, idx):
        """"""
        nchild = self.mdi_w.get_nth_page(idx)
        return self._native_to_child(nchild)
465740
protected CmsFormRow createRow(String labelText, String description, Widget widget) {

        return createRow(labelText, description, widget, null, false);
    }
169954
public int put(Widget widget) {
		attach(widget);
		for (int i = 0; i < content.length; ++i)
			for (int j = 0; j < content[i].length; ++j)
				if (content[i][j] == null) {
					content[i][j] = widget;
					this.sendElement();
					return i;
				}
		throw new IndexOutOfBoundsException();
		//return -1;
	}
50978
Widget createWidget() {

        if (isTrue(m_jsonConfig, CmsDataViewConstants.CONFIG_PREVIEW)) {
            return new CmsDataViewPreviewWidget(
                m_config,
                m_valueAccessor,
                new CmsDataViewPreviewWidget.ContentImageLoader());
        } else {
            I_ImageProvider provider = null;
            CmsDataViewValue val = m_valueAccessor.getValue();
            JSONValue iconVal = m_jsonConfig.get(CmsDataViewConstants.CONFIG_ICON);
            if ((iconVal != null) && (iconVal.isString() != null)) {
                provider = new CmsDataViewPreviewWidget.SimpleImageLoader(iconVal.isString().stringValue());
            }
            return new CmsDataViewPreviewWidget(m_config, m_valueAccessor, provider);
        }

    }
962541
def addWidget(self, widget, align=Qt.AlignLeft, before=None):
        
        # self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...
        layout = self.findChild(QHBoxLayout, 'uiToolbarLAYOUT')
        
        if before is not None:
            index = None
            for i in range(layout.count()):
                if layout.itemAt(i).widget() == before:
                    index = i
                    break
            
            if index is not None:
                layout.insertWidget(index, widget)
            else:
                layout.addWidget(widget)
            
        if align == Qt.AlignLeft:
            layout.insertWidget(0, widget)
        else:
            layout.addWidget(widget)
723736
public void addAttribute(int index, VertexAttribute attribute) {
        attributes.put(index, attribute);
        nameToIndex.put(attribute.getName(), index);
    }
260276
public Widget findChildByName(final String name) {
        final List<Widget> groups = new ArrayList<>();
        groups.add(this);

        return findChildByNameInAllGroups(name, groups);
    }
21814
private void addInputRow(String label, Widget inputWidget) {

        FlowPanel row = new FlowPanel();
        row.setStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormRow());
        CmsLabel labelWidget = new CmsLabel(label);
        labelWidget.setStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormLabel());
        row.add(labelWidget);
        inputWidget.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().simpleFormInputBox());
        row.add(inputWidget);
        m_dialogContent.getFieldSet().add(row);
    }
5650
private void setCurrentTab(final int index)
	{
		if (this.currentTab == index)
		{
			// already current
			return;
		}
		this.currentTab = index;

		final Component component;

		if ((currentTab == -1) || tabs.isEmpty() || !getVisiblityCache().isVisible(currentTab))
		{
			// no tabs or the current tab is not visible
			component = newPanel();
		}
		else
		{
			// show panel from selected tab
			final T tab = tabs.get(currentTab);
			component = tab.getPanel(TAB_PANEL_ID);
			if (component == null)
			{
				throw new WicketRuntimeException("ITab.getPanel() returned null. TabbedPanel ["
					+ getPath() + "] ITab index [" + currentTab + "]");
			}
		}

		if (!component.getId().equals(TAB_PANEL_ID))
		{
			throw new WicketRuntimeException(
				"ITab.getPanel() returned a panel with invalid id [" + component.getId()
					+ "]. You always have to return a panel with id equal to the provided panelId parameter. TabbedPanel ["
					+ getPath() + "] ITab index [" + currentTab + "]");
		}

		addOrReplace(component);
	}
58683
@Override
    protected void defineWidgets() {

        super.defineWidgets();

        // widgets to display
        // indexsource data (first block)
        addWidget(new CmsWidgetDialogParameter(m_indexsource, "name", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_indexsource, "indexerClassName", PAGES[0], new CmsDisplayWidget()));

        // resources block
        addWidget(
            new CmsWidgetDialogParameter(
                m_indexsource.getResourcesNames(),
                "resourcesNames",
                "/",
                PAGES[0],
                new CmsVfsFileWidget(false, ""),
                1,
                10));
    }
60531
public void addToCell(int index, int element) {
        if (cells.size() < index + 1) {
            addSingletonCell(element);
        } else {
            cells.get(index).add(element);
        }
    }
1206220
def addTab(self, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        index = len(self.items())
        self.layout().insertWidget(index, tab)

        self.setCurrentIndex(index)
        return tab
123428
public Cell<C, T> setWidget (C widget) {
		layout.toolkit.setWidget(layout, this, widget);
		return this;
	}
780481
def _set(self, name, value):
        ""
        return self.widget(self.widget_element._set(name, value))
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();
        }
    }