private void refreshView() {

		// Grab an iterator so we can process each preview string.
		Iterator<Map.Entry<Integer, String>> it = previewStringMap.entrySet().iterator();

		while (it.hasNext()) {
			Map.Entry<Integer, String> pair = it.next();
			Integer index = pair.getKey();
			String instr = pair.getValue();

			// Create a new string to hold the string we'll set in the table.
			String previewString = "";

			switch (currentView) {
				case BINARY:
					// If it's binary, just grab the value of the preview string
					// in the map; they're stored there as binary so nothing to 
					// do but format it with the correct mask settings.
					previewString =
						InstructionSearchUtils.addSpaceOnByteBoundary(instr, InputMode.BINARY);
					break;
				case HEX:
					// For hex, we have to convert the binary string to hex, so use
					// our utility...
					previewString = InstructionSearchUtils.toHex(instr, true).toString();
					break;
			}

			setPreviewText(index, previewString);
		}

		repaint();
	}
Updates the table to display preview data as either hex or binary
(depends on the setting of 'currentView').
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/PreviewTable.java