private AddressSetView getSelectionInTool(PluginTool tool) {
		CodeViewerService service = tool.getService(CodeViewerService.class);
		if (service == null) {
			return null;
		}
		FieldSelection selection = service.getFieldPanel().getSelection();
		AddressIndexMap addressIndexMap = service.getListingPanel().getAddressIndexMap();
		AddressSet addressSet = addressIndexMap.getAddressSet(selection);
		return addressSet;
	}
Gets the address set for the current selection in the tool.

@param tool
           the tool
@return the current selection or null.
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/plugin/VTSubToolManager.java