private void buildEditor() {
		removeWorkPanel();

		editor = createEditor(serviceProvider, allowedTypes);
		editor.setConsumeEnterKeyPress(false); // we want to handle Enter key presses
		editor.addCellEditorListener(new CellEditorListener() {
			@Override
			public void editingCanceled(ChangeEvent e) {
				if (isVisible()) {
					cancelCallback();
				}
			}

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

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

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

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

		});

		JComponent mainPanel = createEditorPanel(editor);
		mainPanel.getAccessibleContext().setAccessibleName("Data Type Selection");
		addWorkPanel(mainPanel);

		rootPanel.validate();
	}
A dialog that allows the user to choose from available data types or create new ones.
Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/DataTypeSelectionDialog.java