private void init() {

		List<ScriptInfo> sortedInfos = new ArrayList<>(scriptMap.values());

		DataToStringConverter<ScriptInfo> stringConverter = info -> info.getName();
		ScriptInfoDescriptionConverter descriptionConverter = new ScriptInfoDescriptionConverter();
		ScriptTextFieldModel model = new ScriptTextFieldModel(sortedInfos, stringConverter,
			descriptionConverter);

		selectionField = new ScriptSelectionTextField(model);

		// propagate Enter and Cancel presses to the client
		selectionField.addCellEditorListener(new CellEditorListener() {

			@Override
			public void editingStopped(ChangeEvent e) {
				fireEditingStopped();
			}

			@Override
			public void editingCanceled(ChangeEvent e) {
				fireEditingCancelled();
			}
		});

		selectionField.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));

		editorPanel = new JPanel();
		editorPanel.setLayout(new BoxLayout(editorPanel, BoxLayout.X_AXIS));
		editorPanel.add(selectionField);
	}
A widget that allows the user to choose an existing script by typing its name or picking it
from a list.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionEditor.java