private JPanel buildWorkPanel(String prompt) {
		DefaultListModel<Object> listModel = new DefaultListModel<>() {
			@Override
			public String getElementAt(int index) {
				@SuppressWarnings("unchecked")
				T t = (T) super.getElementAt(index);
				return toStringFunc.apply(t);
			}

		};

		for (T obj : list) {
			listModel.addElement(obj);
		}

		listPanel = new ListPanel();
		listPanel.setListModel(listModel);
		listPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		listPanel.setSelectedIndex(0);
		listPanel.setDoubleClickActionListener(e -> okCallback());
		listPanel.getAccessibleContext().setAccessibleName("List");

		JPanel workPanel = new JPanel(new BorderLayout());
		MultiLineLabel mll = new MultiLineLabel("\n" + prompt + ":");
		workPanel.add(mll, BorderLayout.NORTH);
		workPanel.add(listPanel, BorderLayout.CENTER);
		workPanel.getAccessibleContext().setAccessibleName("Select From List");
		return workPanel;
	}
Modally shows the user a dialog with a list of strings, and returns the picked object.
<p>
(automatically switches to Swing thread)

@param list list of object of type T
@param title title of dialog
@param prompt prompt shown above list
@param toStringFunction function that converts a T into a String.
@return the chosen T object, or null if dialog canceled.
Ghidra/Framework/Docking/src/main/java/docking/widgets/SelectFromListDialog.java