@Override
	protected void insert(int rowIndex, DataType dataType, int length, int numCopies,
			TaskMonitor monitor) throws InvalidDataTypeException, CancelledException {

		checkIsAllowableDataType(dataType);
		int componentOrdinal = convertRowToOrdinal(rowIndex);
		monitor.initialize(numCopies);
		try {
			viewDTM.withTransaction("Insert Multiple", () -> {
				for (int i = 0; i < numCopies; i++) {
					monitor.checkCancelled();
					monitor.setMessage("Inserting " + (i + 1) + " of " + numCopies);
					viewComposite.insert(componentOrdinal, dataType, length);
					monitor.incrementProgress(1);
				}

				if (rowIndex <= currentEditRow) {
					currentEditRow += numCopies;
				}
				adjustSelection(componentOrdinal, numCopies);
				// Consume undefined bytes that may have been added, if needed.
				consumeByComponent(componentOrdinal - numCopies);
			});
		}
		catch (IllegalArgumentException exc) {
			throw new InvalidDataTypeException(exc.getMessage());
		}
	}
Returns the number of bytes that are included in the current selection
range.

@param range the range of indices for the component's whose sizes should
be added together.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/StructureEditorModel.java