private void formatEnumText(Enum enuum) {
		formatSourceArchive(enuum);
		formatPath(enuum);
		insertString(enuum.getDisplayName(), nameAttrs);
		insertString(" { \n", contentAttrs);

		StringBuffer sb = new StringBuffer();

		int maxNameLength = 0;
		int maxValueLength = 0;

		String[] names = enuum.getNames();
		EnumEntry[] entries = new EnumEntry[names.length];
		for (int i = 0; i < names.length; i++) {
			String name = names[i];
			EnumEntry entry = new EnumEntry(name, enuum.getValue(name), enuum.getComment(name));
			entries[i] = entry;
			maxNameLength = Math.max(maxNameLength, name.length());
			String valStr = Long.toHexString(entry.value);
			maxValueLength = Math.max(maxValueLength, valStr.length());
		}
		Arrays.sort(entries);

		for (EnumEntry entry : entries) {
			renderEnumEntry(entry, maxNameLength, maxValueLength);
		}
		sb.append("}\n");
		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