Adds the tab.

@param idx the idx
@param tab the tab
486481
public SequentialTransition addTab(int idx, final Dockable tab) {

        final SequentialTransition seq = new SequentialTransition();

        final ToggleButton b = new ToggleButton(tab.name());// , new ImageView(model().getBehavior(DockableBehavior.class).modelIcon()));
        b.setToggleGroup(this.group);
        // b.getStyleClass().clear();
        b.setUserData(tab);

        final ToggleButton oldButton = this.buttonByTab.put(tab.name(), b);
        final int previousIndex = this.box.getChildren().indexOf(oldButton);
        if (previousIndex >= 0 && previousIndex < idx) {
            idx++;
        }

        selectTab(tab);

        controller().initTabEventHandler(b);

        if (idx < 0 || idx > this.box.getChildren().size()) {
            idx = this.box.getChildren().size();
        }

        b.setScaleX(0.0);
        this.box.getChildren().add(idx, b);

        if (this.box instanceof HBox) {
            HBox.setMargin(b, new Insets(0, 1, 0, 0));
        } else if (this.box instanceof VBox) {
            VBox.setMargin(b, new Insets(1, 0, 0, 0));
        }

        final ScaleTransition st = new ScaleTransition(Duration.millis(600));
        st.setNode(b);
        st.setFromX(0.0);
        st.setToX(1.0);

        seq.getChildren().add(st);

        return seq;
    }
742869
def addTab(self, widget, *args):
        
        widget.dirty_changed.connect(self._on_dirty_changed)
        super(CodeEditTabWidget, self).addTab(widget, *args)
484484
public void addWithLeftMargin(E tabContent, String tabName) {

        tabContent.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
        m_tabPanel.add(tabContent, CmsDomUtil.stripHtml(tabName));

        int tabIndex = m_tabPanel.getWidgetIndex(tabContent);
        Element tabElement = getTabElement(tabIndex);
        if (tabElement != null) {
            tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().tabLeftMargin());
            if (!m_panelStyle.equals(CmsTabbedPanelStyle.classicTabs)) {
                tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.generalCss().buttonCornerAll());
                tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().borderAll());
            }
        }
        m_tabPanel.checkTabOverflow();
    }
1255634
public void addInterface(String interfaceName) {
        if (!mInterfaceSet.contains(interfaceName)) {
            mInterfaces.add(ConstantClassInfo.make(mCp, interfaceName));
            mInterfaceSet.add(interfaceName);
        }
    }
148584
def addEmptyTab(self, text=''):
        
        tab = self.defaultTabWidget()
        c = self.count()
        self.addTab(tab, text)
        self.setCurrentIndex(c)
        if not text:
            self.tabBar().editTab(c)
        self.sigTabAdded.emit(tab)
        return tab
968557
def addTab(self, view, title):
        
        if not isinstance(view, XView):
            return False

        tab = self._tabBar.addTab(title)
        self.addWidget(view)
        tab.titleChanged.connect(view.setWindowTitle)
        
        # create connections
        try:
            view.windowTitleChanged.connect(self.refreshTitles,
                                            QtCore.Qt.UniqueConnection)
            view.sizeConstraintChanged.connect(self.adjustSizeConstraint,
                                            QtCore.Qt.UniqueConnection)
            view.poppedOut.connect(self.disconnectView,
                                   QtCore.Qt.UniqueConnection)
        except RuntimeError:
            pass
        
        self.setCurrentIndex(self.count() - 1)
        
        return True
283013
public void add(int idx, int ele) {
        ensureCapacity(size + 1);
        System.arraycopy(data, idx, data, idx + 1, size - idx);
        data[idx] = ele;
        size++;
    }
469498
def insert_tab index, title, config={}, &block
      @tabs.insert(index, Tab.new(title, self, config, &block) )
    end
208573
def insert_tabs(self, tab, no_tabs=1):
        

        # Mark content as changed
        post_command_event(self.main_window, self.ContentChangedMsg)

        self.code_array.insert(tab, no_tabs, axis=2)

        # Update TableChoiceIntCtrl
        shape = self.grid.code_array.shape
        post_command_event(self.main_window, self.ResizeGridMsg, shape=shape)
1105072
public void add(E tabContent, String tabName) {

        tabContent.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
        m_tabPanel.add(tabContent, CmsDomUtil.stripHtml(tabName));

        Element tabRootEl = m_tabPanel.getElement();
        // set an additional css class for the parent element of the .gwt-TabLayoutPanelTabs element
        List<Element> tabDivs = CmsDomUtil.getElementsByClass(
            I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cmsTabLayoutPanelTab(),
            CmsDomUtil.Tag.div,
            tabRootEl);

        Iterator<Element> it = tabDivs.iterator();
        boolean first = true;
        while (it.hasNext()) {

            Element e = it.next();
            e.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerLeft());
            e.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerRight());
            if (first) {
                e.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerLeft());
                first = false;
            }
            if (!it.hasNext()) {
                e.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerRight());
            }
        }
        m_tabPanel.checkTabOverflow();
    }
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();
        }
    }
643297
public void add(long idx, int val) {
    	int curVal = getWithDefault(idx, ZERO);
    	put(idx, curVal + val);
    }
449104
public void addInterface(String interfaceName) {
        if (!mInterfaceSet.contains(interfaceName)) {
            mInterfaces.add(mCp.addConstantClass(interfaceName));
            mInterfaceSet.add(interfaceName);
        }
    }
1165853
public void enableTab(E tabContent) {

        Integer index = new Integer(m_tabPanel.getWidgetIndex(tabContent));
        Element tab = getTabElement(index.intValue());
        if ((tab != null) && m_disabledTabIndexes.containsKey(index)) {
            tab.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().tabDisabled());
            tab.setTitle(m_disabledTabIndexes.get(index));
            m_disabledTabIndexes.remove(index);
        }
    }
373204
public void onNewTab(final AjaxRequestTarget target, final T tab, final int index)
	{
		if ((index < 0) || (index >= getTabs().size()))
		{
			throw new IndexOutOfBoundsException();
		}
		getTabs().add(index, tab);
		setSelectedTab(index);
		target.add(this);
	}
1197946
def add_tab(self, tab, title='', icon=None):
        
        if icon:
            tab._icon = icon
        if not hasattr(tab, 'clones'):
            tab.clones = []
        if not hasattr(tab, 'original'):
            tab.original = None
        if icon:
            self.main_tab_widget.addTab(tab, icon, title)
        else:
            self.main_tab_widget.addTab(tab, title)
        self.main_tab_widget.setCurrentIndex(
            self.main_tab_widget.indexOf(tab))
        self.main_tab_widget.show()
        tab._uuid = self._uuid
        try:
            scroll_bar = tab.horizontalScrollBar()
        except AttributeError:
            # not a QPlainTextEdit class
            pass
        else:
            scroll_bar.setValue(0)
        tab.setFocus()
        tab._original_tab_widget = self
        self._tabs.append(tab)
        self._on_focus_changed(None, tab)
566208
public synchronized void add(int id, SICoreConnection connection) {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "add", "" + id);
        map.put(id, connection);
        if (tc.isEntryEnabled())
            SibTr.exit(tc, "add");
    }