private void setupActions() {

		int subMenuGroupPosition = 1;

		selectProgramChangesAction =
			new NavigatableContextAction("Select Program Changes", getName()) {
				@Override
				public void actionPerformed(NavigatableActionContext context) {
					selectChangeSet(context);
				}

				@Override
				protected boolean isEnabledForContext(NavigatableActionContext context) {
					Program program = context.getProgram();
					ProgramChangeSet cs = program.getChanges();
					return cs != null && cs.hasChanges();
				}
			};
		selectProgramChangesAction.setMenuBarData(new MenuData(new String[] { "Select",
			"Program Changes" }, null, SelectByFlowAction.GROUP));

		selectProgramChangesAction.setHelpLocation(new HelpLocation(HelpTopics.SELECTION,
			selectProgramChangesAction.getName()));
		selectProgramChangesAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectProgramChangesAction.addToWindowWhen(NavigatableActionContext.class);
		tool.addAction(selectProgramChangesAction);

		/**
		 * Select by Following All Flows From setup
		 */
		selectAllFlowsFromAction =
			new SelectByFlowAction("Select All Flows From", this, SELECT_ALL_FLOWS_FROM);
		selectAllFlowsFromAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectAllFlowsFromAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectAllFlowsFromAction);

		/**
		 * Select by Following All Flows To setup
		 */
		selectAllFlowsToAction =
			new SelectByFlowAction("Select All Flows To", this, SELECT_ALL_FLOWS_TO);
		selectAllFlowsToAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectAllFlowsToAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectAllFlowsToAction);

		/**
		 * Select by Following Limited Flows From setup
		 */
		selectLimitedFlowsFromAction =
			new SelectByFlowAction("Select Limited Flows From", this, SELECT_LIMITED_FLOWS_FROM);
		selectLimitedFlowsFromAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectLimitedFlowsFromAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectLimitedFlowsFromAction);

		/**
		 * Select by Following Limited Flows To setup
		 */
		selectLimitedFlowsToAction =
			new SelectByFlowAction("Select Limited Flows To", this, SELECT_LIMITED_FLOWS_TO);
		selectLimitedFlowsToAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectLimitedFlowsToAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectLimitedFlowsToAction);

		/**
		 * Select Subroutine setup
		 */
		selectSubroutineAction =
			new SelectByFlowAction("Select Subroutine", this, SELECT_SUBROUTINES);
		selectSubroutineAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectSubroutineAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectSubroutineAction);

		/**
		 * Select Subroutine setup
		 */
		selectDeadSubroutineAction =
			new SelectByFlowAction("Select Dead Subroutine", this, SELECT_DEAD_SUBROUTINES);
		selectDeadSubroutineAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectDeadSubroutineAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectDeadSubroutineAction);

		/**
		 * Select Function setup
		 */
		selectFunctionAction = new SelectByFlowAction("Select Function", this, SELECT_FUNCTIONS);
		selectFunctionAction.getMenuBarData().setMenuSubGroup(
			Integer.toString(subMenuGroupPosition++));
		selectFunctionAction.addToWindowWhen(ListingActionContext.class);
		tool.addAction(selectFunctionAction);

	}
selectFunctions selects all the functions that contain code units from
the initial address set passed in as a parameter.
@param monitor a cancellable task monitor
@param startAddresses the initial addresses that should be used to select
functions.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/select/flow/SelectByFlowPlugin.java