private Component buildSelectionPanel() {

		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		panel.setBorder(new TitledBorder("Search Scope"));
		panel.getAccessibleContext().setAccessibleName("Search Choice");
		searchSelectionRadioButton = new GRadioButton("Search Selection");
		searchSelectionRadioButton.getAccessibleContext().setAccessibleName("Search Selection");
		searchAllRadioButton = new GRadioButton("Search All");
		searchAllRadioButton.getAccessibleContext().setAccessibleName("Search All");
		searchSelectionRadioButton.setToolTipText("Search only the current selection");
		searchAllRadioButton.setToolTipText("Search the entire program");

		ButtonGroup buttonGroup = new ButtonGroup();
		buttonGroup.add(searchSelectionRadioButton);
		buttonGroup.add(searchAllRadioButton);

		ProgramSelection selection = plugin.getProgramSelection();
		if (selection == null) {
			searchAllRadioButton.setSelected(true);
			searchSelectionRadioButton.setEnabled(false);
		}
		else {
			searchSelectionRadioButton.setSelected(true);
		}

		panel.add(searchAllRadioButton);
		panel.add(searchSelectionRadioButton);

		JPanel selectionPanel = new JPanel();
		selectionPanel.setLayout(new BorderLayout());
		selectionPanel.add(panel, BorderLayout.NORTH);

		HelpService helpService = DockingWindowManager.getHelpService();
		helpService.registerHelp(selectionPanel,
			new HelpLocation(plugin.getName(), "Scalar_Selection_Scope"));
		selectionPanel.getAccessibleContext().setAccessibleName("Selection");
		return selectionPanel;
	}
Dialog allowing the user to set parameters when initiating a scalar search on a program.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/scalartable/ScalarSearchDialog.java