@Override
	public void run(TaskMonitor monitor) {
		if (monitor == null) {
			return;
		}

		// Just show percentage complete in the pop-up.
		monitor.setShowProgressValue(false);

		List<InstructionMetadata> results = doSearch(monitor);

		// If the search finished without being cancelled, just show the results. If it was 
		// cancelled, prompt the user for confirmation and to give them the option of seeing any
		// results which have been collected thus far.
		if (!monitor.isCancelled()) {
			searchDialog.displaySearchResults(results);
		}
		else {
			if (results.isEmpty()) {
				return;
			}
			int option = OptionDialog.showYesNoDialog(searchDialog.getFocusComponent(),
				"Results found!", results.size() + " match(es) found. View results?");

			if (option == OptionDialog.YES_OPTION) {
				searchDialog.displaySearchResults(results);
			}
		}
	}
Constructor

@param searchDialog the search dialog
@param searchPlugin the instruction search plugin
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchAllInstructionsTask.java