private static void writeAllModelData(PrintWriter writer, JTable table, TableModel model,
			TaskMonitor monitor) {

		monitor.setMessage("Writing model...");
		monitor.initialize(model.getRowCount());

		int columnCount = table.getColumnCount();
		for (int row = 0; row < model.getRowCount(); ++row) {
			if (monitor.isCancelled()) {
				break;
			}
			monitor.setProgress(row);
			for (int col = 0; col < columnCount; col++) {
				if (monitor.isCancelled()) {
					break;
				}

				String value = getColumnValue(table, model, row, col);
				if (value == null) {
					// not sure how this could happen...has the model changed out from under us?
					value = "";
				}

				writeField(writer, value, monitor);
				if (col < columnCount - 1) {
					writeFieldSeparator(writer);
				}
			}
			writeNewLine(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