private void createActions() {
		DockingAction action =
			new NavigatableContextAction("Select Forward Scoped Flow", getName()) {
				@Override
				public void actionPerformed(NavigatableActionContext context) {
					FunctionManager functionManager = currentProgram.getFunctionManager();
					Function function =
						functionManager.getFunctionContaining(currentLocation.getAddress());

					if (!isValidFunction(function)) {
						Msg.showWarn(this, null, "Cursor Must Be In a Function",
							"Selecting scoped flow requires the cursor to be " +
								"inside of a function");
						return;
					}

					try {
						ProgramSelection selection = makeForwardScopedSelection(function,
							currentProgram, currentLocation, new TaskMonitorAdapter(true));
						updateStatusText(selection);
						setSelection(selection);
					}
					catch (CancelledException e) {
						Msg.debug(this, "Calculating Forward Scoped Flow cancelled", e);
					}
				}
			};
		action.setMenuBarData(new MenuData(
			new String[] { ToolConstants.MENU_SELECTION, "Scoped Flow", "Forward Scoped Flow" },
			null, "Select"));
		action.addToWindowWhen(NavigatableActionContext.class);
		action.setDescription("Allows user to select scoped flow from current location.");
		action.setHelpLocation(new HelpLocation("FlowSelection", "Scoped_Flow"));
		tool.addAction(action);

		action = new NavigatableContextAction("Select Reverse Scoped Flow", getName()) {
			@Override
			public void actionPerformed(NavigatableActionContext context) {
				FunctionManager functionManager = currentProgram.getFunctionManager();
				Function function =
					functionManager.getFunctionContaining(currentLocation.getAddress());

				if (!isValidFunction(function)) {
					Msg.showWarn(this, null, "Cursor Must Be In a Function",
						"Selecting scoped flow requires the cursor to be " +
							"inside of a function");
					return;
				}

				try {
					ProgramSelection selection = makeReverseScopedSelection(function,
						currentProgram, currentLocation, new TaskMonitorAdapter(true));
					updateStatusText(selection);
					setSelection(selection);
				}
				catch (CancelledException e) {
					Msg.debug(this, "Calculating Reverse Scoped Flow cancelled", e);
				}
			}
		};
		action.setMenuBarData(new MenuData(
			new String[] { ToolConstants.MENU_SELECTION, "Scoped Flow", "Reverse Scoped Flow" },
			null, "Select"));
		action.addToWindowWhen(NavigatableActionContext.class);
		action.setDescription("Allows user to select scoped flow to the current location.");
		action.setHelpLocation(new HelpLocation("FlowSelection", "Scoped_Flow"));
		tool.addAction(action);
	}
This plugin class contains the structure needed for the user to select code
blocks that are only reachable by following the flow from the current program
location (they are unreachable from any other starting point).
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/flow/SelectByScopedFlowPlugin.java