private JPanel buildCreateNewStructPanel() {
		JPanel newStructPanel = new JPanel();
		newStructPanel.setLayout(new PairLayout());
		newStructPanel.setToolTipText("Enter a name and category (optional)");

		JLabel nameLabel = new JLabel("Name: ");

		nameTextField = new JTextField();
		nameTextField.setName("StructureName");
		nameTextField.getAccessibleContext().setAccessibleName("Name");

		// Allow user to click on the text field to re-activate "create new" panel without forcing
		// a click on the radio button
		nameTextField.addFocusListener(new FocusAdapter() {
			@Override
			public void focusGained(FocusEvent e) {
				createNewStructButton.setSelected(true);
				updateEnablement();
			}
		});
		nameTextField.getDocument().addDocumentListener(new DocumentListener() {
			@Override
			public void changedUpdate(DocumentEvent event) {
				checkText(event.getDocument());
			}

			@Override
			public void insertUpdate(DocumentEvent event) {
				checkText(event.getDocument());
			}

			@Override
			public void removeUpdate(DocumentEvent event) {
				checkText(event.getDocument());
			}

			private void checkText(Document document) {
				try {
					String text = document.getText(0, document.getLength());
					if (StringUtils.isBlank(text)) {
						okButton.setEnabled(false);
						updateStatusText(true, null);
					}
					else {
						okButton.setEnabled(true);
						updateStatusText(true, text);
					}
				}
				catch (BadLocationException ble) {
					// nothing we can do here
				}
			}
		});

		JLabel categoryLabel = new JLabel("Category: ");
		buildCategoryPathEditor();

		newStructPanel.add(nameLabel);
		newStructPanel.add(nameTextField);
		newStructPanel.add(categoryLabel);
		newStructPanel.add(categoryPathEditor.getEditorComponent());

		return newStructPanel;
	}
Creates a new dialog with the given parent.

@param tool The current tool that this dialog needs to access services.
@param program the current program
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java