@Override
	public DataTypeComponent insert(int rowIndex, DataType dataType, int length, String name,
			String comment) throws InvalidDataTypeException {
		checkIsAllowableDataType(dataType);
		try {
			DataTypeComponent dtc = viewDTM.withTransaction("Add Component",
				() -> viewComposite.insert(rowIndex, dataType, length, name, comment));
			if (rowIndex <= currentEditRow) {
				currentEditRow++;
			}
			adjustSelection(rowIndex, 1);
			notifyCompositeChanged();
			return dtc;
		}
		catch (IllegalArgumentException exc) {
			throw new InvalidDataTypeException(exc.getMessage());
		}
	}
Insert the named data type before the specified index.

@param rowIndex index of the row (component).

@throws InvalidDataTypeException if the union being edited is part
        of the data type being inserted or if inserting isn't allowed.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java