public void updateSearchRangeBySelection() {

		// if the user has set the toggle to "search selection", then update the search range,
		// otherwise leave alone.
		if (!searchSelectionRB.isSelected()) {
			return;
		}

		// If were here, then the user has selected the "search selection" radio button, so
		// we're about to update our range based on what is currently selected; start by clearing
		// out our current range.
		searchRanges.clear();

		if (plugin.getProgramSelection() == null) {
			return;
		}
		if (plugin.getProgramSelection().getMinAddress() == null ||
			plugin.getProgramSelection().getMaxAddress() == null) {
			return;
		}

		Iterator<AddressRange> iter = plugin.getProgramSelection().getAddressRanges();
		while (iter.hasNext()) {
			searchRanges.add(iter.next());
		}
	}
Retrieves the currently-selected region in the listing and makes that the new search
range.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SelectionScopeWidget.java