private void formatFunctionDef(FunctionDefinition fd) {
		formatSourceArchive(fd);
		formatPath(fd);
		ParameterDefinition[] vars = fd.getArguments();

		DataType returnType = fd.getReturnType();
		if (fd.hasNoReturn()) {
			insertString(FunctionSignature.NORETURN_DISPLAY_STRING + "  ", contentAttrs);
		}
		insertString(returnType.getDisplayName(), contentAttrs);
		String callingConventionName = fd.getCallingConventionName();
		if (!Function.UNKNOWN_CALLING_CONVENTION_STRING.equals(callingConventionName)) {
			insertString(callingConventionName + "  ", contentAttrs);
		}
		insertString("  " + fd.getDisplayName(), nameAttrs);
		insertString(" (", contentAttrs);
		boolean hasVarArgs = fd.hasVarArgs();
		if ((vars.length == 0) && !hasVarArgs) {
			insertString(")", contentAttrs);
			return;
		}
		int maxLength = 0;
		for (ParameterDefinition var : vars) {
			String typeName = var.getDataType().getDisplayName();
			if (typeName.length() > maxLength) {
				maxLength = typeName.length();
			}
		}

		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < vars.length; i++) {
			sb.append("\n");
			String name = vars[i].getDataType().getDisplayName();
			name = pad(name, maxLength);

			sb.append("    " + name + " " + vars[i].getName());
			if ((i < vars.length - 1) || (vars.length > 0 && hasVarArgs)) {
				sb.append(",");
			}
		}
		if (hasVarArgs) {
			if (vars.length > 0) {
				sb.append("\n").append("    ");
			}
			sb.append(FunctionSignature.VAR_ARGS_DISPLAY_STRING);
		}
		sb.append(")");
		insertString(sb.toString(), contentAttrs);
	}
Panel to show the contents of a Data Type.
Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypePanel.java