private void displayDialog(NavigatableActionContext context) {
		if (searchDialog == null) {
			searchDialog = new SearchTextDialog(this);
			searchDialog.setHasSelection(context.hasSelection());
		}

		String textSelection = navigatable.getTextSelection();
		ProgramLocation location = navigatable.getLocation();
		Address address = location.getAddress();
		Listing listing = context.getProgram().getListing();
		CodeUnit codeUnit = listing.getCodeUnitAt(address);
		boolean isInstruction = false;
		if (textSelection != null) {
			if (codeUnit != null) {
				if (codeUnit instanceof Instruction) {
					isInstruction = true;
				}
				else {
					isInstruction = false;
				}
				searchDialog.setCurrentField(location, isInstruction);
			}
			searchDialog.setValueFieldText(textSelection);
		}
		searchDialog.show(context.getComponentProvider());
	}
Create the action for to pop up the search dialog.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin.java