private void buildEditor() {
		removeWorkPanel();

		editor = new ScriptSelectionEditor(scriptInfos);

		editor.setConsumeEnterKeyPress(false); // we want to handle Enter key presses

		editor.addEditorListener(new ScriptEditorListener() {
			@Override
			public void editingCancelled() {
				if (isVisible()) {
					cancelCallback();
				}
			}

			@Override
			public void editingStopped() {
				if (isVisible()) {
					okCallback();
				}
			}
		});
		editor.addDocumentListener(new DocumentListener() {

			@Override
			public void changedUpdate(DocumentEvent e) {
				textUpdated();
			}

			@Override
			public void insertUpdate(DocumentEvent e) {
				textUpdated();
			}

			@Override
			public void removeUpdate(DocumentEvent e) {
				textUpdated();
			}

			private void textUpdated() {
				clearStatusText();
			}

		});

		JComponent mainPanel = createEditorPanel();
		addWorkPanel(mainPanel);

		rootPanel.validate();
	}
A dialog that prompts the user to select a script.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionDialog.java