@Override
	public boolean isReplaceAllowed(int currentIndex, DataType dataType) {
		try {
			if (currentIndex < 0 || currentIndex > getNumComponents()) {
				return false;
			}
			checkIsAllowableDataType(dataType);
		}
		catch (InvalidDataTypeException e) {
			return false;
		}
		return true;
	}
Returns whether or not insertion of the specified component is allowed
at the specified index.

@param rowIndex index of the row in the union table.
@param datatype the data type to be inserted.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/UnionEditorModel.java