private void updateStructure(Structure struct) {
			DataType newDt = dataTypeEditor.getCellEditorValueAsDataType();
			DataTypeComponent dtc = composite.getComponent(ordinal);
			DataType resolvedDt = program.getDataTypeManager().resolve(newDt, null);
			if (resolvedDt == DataType.DEFAULT) {
				struct.clearComponent(ordinal);
				return;
			}

			DataTypeInstance dti =
				DataTypeInstance.getDataTypeInstance(resolvedDt, -1, false);
			DataType dataType = dti.getDataType();
			int length = dti.getLength();
			String fieldName = dtc.getFieldName();
			String comment = dtc.getComment();
			dtc = struct.replace(ordinal, dataType, length, fieldName, comment);
		}
Sets the pending new datatype and updates the datatype text field to the name of that
datatype.
@param dataType the new pending datatype
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/EditDataFieldDialog.java