private void configureTableColumns(TableChooserDialog tableChooserDialog) {
		// First column added is the Constant value that is found.
		// Note the special compare method that must compare the constant
		// values not as a default string rendering, but by actual value.
		StringColumnDisplay constColumn = new StringColumnDisplay() {
			@Override
			public int compare(AddressableRowObject o1, AddressableRowObject o2) {
				ConstUseLocation e1 = (ConstUseLocation) o1;
				ConstUseLocation e2 = (ConstUseLocation) o2;
				Long v1 = e1.getConstValue();
				Long v2 = e2.getConstValue();
				if (SystemUtilities.isEqual(v1, v2)) {
					return 0;
				}
				if (v1 == null) {
					return -1;
				}
				if (v2 == null) {
					return 1;
				}

				return (int) (v1 - v2);
			}

			@Override
			public String getColumnName() {
				return "Constant Value";
			}

			@Override
			public String getColumnValue(AddressableRowObject rowObject) {
				ConstUseLocation entry = (ConstUseLocation) rowObject;
				Long val = entry.getConstValue();
				if (val == null) {
					return "";
				}
				return Long.toHexString(val);
			}
		};

		// Displays a preview of anything defined at an address if the constant
		// discovered in the backtrack search could be treated as an address
		//
		StringColumnDisplay addrPreviewColumn = new StringColumnDisplay() {
			@Override
			public String getColumnName() {
				return "Addr Preview";
			}

			@Override
			public String getColumnValue(AddressableRowObject rowObject) {
				ConstUseLocation entry = (ConstUseLocation) rowObject;
				Long val = entry.getConstValue();
				if (val == null) {
					return "";
				}
				Address addr = entry.getAddress();
				if (addr == null) {
					return "";
				}
				Address potAddr = addr.getNewAddress(val);
				if (addr.getAddressSpace().isOverlaySpace()) {
					potAddr = addr.getAddressSpace().getOverlayAddress(potAddr);
				}
				if (!currentProgram.getMemory().contains(potAddr)) {
					return "";
				}
				Listing listing = currentProgram.getListing();
				Data data = listing.getDefinedDataAt(potAddr);
				if (data != null) {
					return data.toString();
				}
				Function f = currentProgram.getFunctionManager().getFunctionAt(potAddr);
				if (f != null) {
					return f.getPrototypeString(false, false);
				}
				return "";
			}
		};

		// column to display the name of the function containing the address
		// where a
		// constant is found to be used.
		StringColumnDisplay funcColumn = new StringColumnDisplay() {
			@Override
			public String getColumnName() {
				return "Func Name";
			}

			@Override
			public String getColumnValue(AddressableRowObject rowObject) {
				ConstUseLocation entry = (ConstUseLocation) rowObject;
				Function func = entry.getProgram()
						.getFunctionManager()
						.getFunctionContaining(entry.getAddress());
				if (func == null) {
					return "";
				}
				return func.getName();
			}
		};

		// column to display the note at the address where a
		// this is usually an error condition
		StringColumnDisplay noteColumn = new StringColumnDisplay() {
			@Override
			public String getColumnName() {
				return "Note";
			}

			@Override
			public String getColumnValue(AddressableRowObject rowObject) {
				ConstUseLocation entry = (ConstUseLocation) rowObject;
				String note = entry.getNote();
				if (note == null) {
					return "";
				}
				return note;
			}
		};

		tableChooserDialog.addCustomColumn(constColumn);
		tableChooserDialog.addCustomColumn(addrPreviewColumn);
		tableChooserDialog.addCustomColumn(funcColumn);
		tableChooserDialog.addCustomColumn(noteColumn);
	}
Builds the configurable columns for the TableDialog. More columns could be added.

@param tableChooserDialog the dialog
Ghidra/Features/Decompiler/ghidra_scripts/ShowConstantUse.java