public static int requestDtSize(CompositeEditorProvider<?, ?> provider, String dtName,
			int defaultSize, int maxBytes) throws CancelledException {
		NumberInputDialog dtSizeDialog =
			new NumberInputDialog(dtName + " bytes", defaultSize, 1, maxBytes);
		String helpAnchor = provider.getHelpName() + "_" + "Bytes_NumberInputDialog";
		HelpLocation helpLoc = new HelpLocation(provider.getHelpTopic(), helpAnchor);
		dtSizeDialog.setHelpLocation(helpLoc);
		if (!dtSizeDialog.show()) {
			throw new CancelledException();
		}
		int resultBytes = dtSizeDialog.getValue();

		CompositeEditorModel<?> model = provider.getModel();
		model.setLastNumBytes(resultBytes);

		return resultBytes;
	}
Parses a data type that was typed in the composite data type editor.
It creates a DataTypeInstance that consists of the data type and its size.
If there are multiple of the named data type, this method will ask the
user to select the desired data type.
If the data type size can't be determined, then the user is prompted for
the appropriate size.
@param index the component index being edited.
@param dtValue the new data type to parse.
@param editModel the model indicating the composite editor's state.
@param dtManager the data type manager of the composite data type being edited.
@param dtmService the data type manager service to use to determine the
data type the user specified.
@return the data type instance or null if the user canceled when prompted 
for more information.
@throws InvalidDataTypeException if the specified data type isn't valid.
@throws UsrException if the specified data type can't be used at the 
specified index in the composite.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DataTypeHelper.java