Adds a new fragment to a builder, which allows to create wizard dialogs.

@param builder
The builder, the fragment should be added to, as an instance of the class {@link
WizardDialog.Builder}
@param index
The index of the fragment, which should be added
179252
private void addFragment(@NonNull final WizardDialog.Builder builder, final int index) {
        Bundle arguments = new Bundle();
        arguments.putInt(DialogFragment.INDEX_EXTRA, index);
        CharSequence title = shouldHeaderBeShown() ? null :
                String.format(getString(R.string.dialog_tab_text), index);
        builder.addFragment(title, DialogFragment.class, arguments);
    }
828567
protected XContentBuilder newBuilder() throws IndexException {
    try {
      XContentBuilder builder = XContentFactory.jsonBuilder();

      if (debug()) {
        builder = builder.prettyPrint();
      }

      return builder;
    } catch (final Throwable t) {
      throw new IndexException(t);
    }
  }
82937
@Override
    public void add(int index, E element) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            if (index > len || index < 0)
                throw new IndexOutOfBoundsException("Index: " + index +
                                                    ", Size: " + len);
            Object[] newElements;
            int numMoved = len - index;
            if (numMoved == 0)
                newElements = Arrays.copyOf(elements, len + 1);
            else {
                newElements = new Object[len + 1];
                System.arraycopy(elements, 0, newElements, 0, index);
                System.arraycopy(elements, index, newElements, index + 1,
                                 numMoved);
            }
            newElements[index] = element;
            setArray(newElements);
        } finally {
            lock.unlock();
        }
    }
1310851
private void ensureBuilders() {
    if (this.builders == null) {
      this.builders = new ArrayList<SingleFieldBuilder<MType, BType, IType>>(messages.size());
      for (int i = 0; i < messages.size(); i++) {
        builders.add(null);
      }
    }
  }
685681
public static void doParse(Element element, BeanDefinitionBuilder builder) {
        Element messageSelectorElement = DomUtils.getChildElementByTagName(element, "selector");
        if (messageSelectorElement != null) {
            Element selectorStringElement = DomUtils.getChildElementByTagName(messageSelectorElement, "value");
            if (selectorStringElement != null) {
                builder.addPropertyValue("messageSelector", DomUtils.getTextValue(selectorStringElement));
            }

            Map<String, String> messageSelectorMap = new HashMap<>();
            List<?> messageSelectorElements = DomUtils.getChildElementsByTagName(messageSelectorElement, "element");
            for (Iterator<?> iter = messageSelectorElements.iterator(); iter.hasNext();) {
                Element selectorElement = (Element) iter.next();
                messageSelectorMap.put(selectorElement.getAttribute("name"), selectorElement.getAttribute("value"));
            }
            builder.addPropertyValue("messageSelectorMap", messageSelectorMap);
        }
    }
1150106
public Builder newBuilder() {
        return new Builder()
                .name(name)
                .addColumn(columns)
                .addFk(fks)
                .pkFields(pkFields)
                .addIndexes(indexes);
    }
1130446
public void insert(final Widget child, final int beforeIndex) {
        insert(child, (Element) getElement(), beforeIndex, true);
    }
64814
void setBlock(final int index, final Block b) {
    blockList[index2BlockId(index)] = b.getBlockId();
    blockList[index2BlockLen(index)] = b.getNumBytes();
    blockList[index2BlockGenStamp(index)] = b.getGenerationStamp();
  }
163802
public static GsonBuilder registerInstant(GsonBuilder builder)
  {
    if (builder == null) { throw new NullPointerException("builder cannot be null"); }

    builder.registerTypeAdapter(INSTANT_TYPE, new InstantConverter());

    return builder;
  }
200922
public void addEmptyRow(final int index) {
		if (layer == null) {
			return;
		}
		searchButton.setDisabled(false);
		if (index > 0) {
			resetButton.setDisabled(false);
		}

		// Empty row:
		AttributeCriterionPane newRow = new AttributeCriterionPane(layer);
		newRow.setHeight(32);

		HLayout btnLayout = new HLayout();
		btnLayout.setHeight(32);
		btnLayout.setMembersMargin(WidgetLayout.marginSmall);
		btnLayout.setAlign(Alignment.CENTER);
		btnLayout.setPadding(4);

		IButton btnAddRow = new IButton();
		btnAddRow.setWidth(26);
		btnAddRow.setIcon(WidgetLayout.iconAdd);
		HandlerRegistration addReg = btnAddRow.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				IButton btnAddRow2 = (IButton) event.getSource();
				for (int i = 0; i < buttonPanes.size(); i++) {
					IButton button = (IButton) buttonPanes.get(i).getMember(0);
					if (btnAddRow2.equals(button)) {
						addEmptyRow(i + 1);
						break;
					}
				}
				buttonPanes.get(0).getMember(1).setDisabled(false);
			}
		});

		IButton btnRemoveRow = new IButton();
		btnRemoveRow.setWidth(26);
		btnRemoveRow.setIcon(WidgetLayout.iconRemove);
		HandlerRegistration removeReg = btnRemoveRow.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				IButton sourceBtn = (IButton) event.getSource();
				for (int i = 0; i < buttonPanes.size(); i++) {
					IButton button = (IButton) buttonPanes.get(i).getMember(1);
					if (sourceBtn.equals(button)) {
						criterionStack.removeMember(criterionPanes.remove(i));

						// Remove row 0 from add button/registration:
						buttonStack.removeMember(buttonPanes.remove(i));
						addHandlers.remove(i).removeHandler();
						removeHandlers.remove(i).removeHandler();
						break;
					}
				}
				if (buttonPanes.size() == 1) {
					buttonPanes.get(0).getMember(1).setDisabled(true);
					resetButton.setDisabled(true);
				}
			}
		});
		if (index == 0) {
			btnRemoveRow.setDisabled(true);
		}

		btnLayout.addMember(btnAddRow);
		btnLayout.addMember(btnRemoveRow);

		// Add to the stacks:
		criterionStack.addMember(newRow, index + 1);
		buttonStack.addMember(btnLayout, index + 1);

		// Add to the lists:
		criterionPanes.add(index, newRow);
		buttonPanes.add(index, btnLayout);
		addHandlers.add(index, addReg);
		removeHandlers.add(index, removeReg);
	}
60531
public void addToCell(int index, int element) {
        if (cells.size() < index + 1) {
            addSingletonCell(element);
        } else {
            cells.get(index).add(element);
        }
    }
589593
public IndexQueryBuilder setIndex(String indexName) {
        Preconditions.checkArgument(StringUtils.isNotBlank(indexName));
        this.indexName=indexName;
        return this;
    }
652408
public ListBuilder<T> addAll(int index, Collection<? extends T> items) {
        list.addAll(index, items);
        return this;
    }
1245286
private void configureHeaderDialogBuilder(@NonNull final AbstractHeaderDialogBuilder builder) {
        builder.setFullscreen(shouldUseFullscreen());

        if (shouldTitleBeShown()) {
            builder.setTitle(getDialogTitle());
        }

        if (shouldMessageBeShown()) {
            builder.setMessage(getDialogMessage());
        }

        if (shouldIconBeShown()) {
            builder.setIcon(R.drawable.ic_info_72dp);
            builder.setIconTint(ContextCompat.getColor(getActivity(), R.color.color_accent));
        }

        if (shouldHeaderBeShown()) {
            builder.showHeader(true);
            builder.setHeaderBackground(R.drawable.dialog_header_background);
            builder.setHeaderIcon(R.drawable.ic_message_alert_72dp);
            builder.setHeaderIconTint(Color.WHITE);
        }
    }
316109
public function addBuilder(BuilderInterface $builder)
    {
        parent::addBuilder($builder);

        $builder->setVariables(
            $this->mergeParameters(
                $this->getFromYaml('params', array()),
                $this->getFromYaml(sprintf('builders.%s.params', $builder->getYamlKey()), array())
            )
        );
        $builder->setColumnClass($this->getColumnClass());
    }
758443
public void set(int index, byte value) {
        Preconditions.checkState(!this.readOnly, "Cannot modify a read-only ByteArraySegment.");
        Preconditions.checkElementIndex(index, this.length, "index");
        this.array[index + this.startOffset] = value;
    }
592700
public static void addCell(StringBuilder builder, String cell)
	{
		if(builder.length() != 0)
			builder.append(SEPARATOR);
		
		builder.append(toCell(cell));
	}