private void createTypeDef(Program program, PluginTool tool) {
		int transaction = program.startTransaction("Create Relative Pointer");
		try {
			if (relativePointer == null) {
				PointerDataType ptr = new PointerDataType(userDataType, pointerSize);
				TypedefDataType typedef = new TypedefDataType(userPath, userName, ptr);
				relativePointer = (TypeDef) program.getDataTypeManager().resolve(typedef, null);
			}
			ComponentOffsetSettingsDefinition.DEF.setValue(relativePointer.getDefaultSettings(),
				userOffset);
		}
		catch (IllegalArgumentException e) {
			Msg.showError(this, tool.getToolFrame(), "Relative TypeDef Failed",
				"Failed to create relative TypeDef: " + e.getMessage());
		}
		finally {
			program.endTransaction(transaction, true);
		}
	}
Assuming the parameters have been filled in by the dialog, create the matching TypeDef.
If a new TypeDef is created, or if a pointer to the base DataType already exists as a TypeDef,
set the ComponentOffsetSetting to the value selected by the dialog (userOffset).
@param program is the Program owning the TypeDef
@param tool is the tool showing the dialog
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/CreatePointerRelative.java