private static void writeColumnNames(PrintWriter writer, List<TableColumn> columns,
			TableModel model, TaskMonitor monitor) {

		monitor.setMessage("Writing columns...");
		monitor.initialize(columns.size());

		for (int i = 0; i < columns.size(); ++i) {
			if (monitor.isCancelled()) {
				break;
			}
			monitor.setProgress(i);

			TableColumn column = columns.get(i);
			int modelIndex = column.getModelIndex();
			writeField(writer, model.getColumnName(modelIndex), monitor);
			if (i < columns.size() - 1) {
				writeFieldSeparator(writer);
			}
		}
	}
Attempts to get the text value for the cell so that the data will match what the user sees.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/GTableToCSV.java