private void createActions() {
		new ActionBuilder("Select All", getName())
				.menuPath(ToolConstants.MENU_SELECTION, "&All in View")
				.menuGroup(SELECT_GROUP, "a")
				.keyBinding("ctrl A")
				.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select All"))
				.withContext(ListingActionContext.class, true)
				.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
				.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectAll())
				.buildAndInstall(tool);

		new ActionBuilder("Clear Selection", getName())
				.menuPath(ToolConstants.MENU_SELECTION, "&Clear Selection")
				.menuGroup(SELECT_GROUP, "b")
				.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Clear Selection"))
				.withContext(ListingActionContext.class, true)
				.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
				.enabledWhen(c -> c.hasSelection())
				.onAction(c -> ((CodeViewerProvider) c.getComponentProvider())
						.setSelection(new ProgramSelection()))
				.buildAndInstall(tool);

		new ActionBuilder("Select Complement", getName())
				.menuPath(ToolConstants.MENU_SELECTION, "&Complement")
				.menuGroup(SELECT_GROUP, "c")
				.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select Complement"))
				.withContext(ListingActionContext.class, true)
				.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
				.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectComplement())
				.buildAndInstall(tool);

		tool.addAction(new MarkAndSelectionAction(getName(), SELECT_GROUP, "d"));

		new ActionBuilder("Create Table From Selection", getName())
				.menuPath(ToolConstants.MENU_SELECTION, "Create Table From Selection")
				.menuGroup("SelectUtils")
				.helpLocation(new HelpLocation(HelpTopics.CODE_BROWSER, "Selection_Tables"))
				.withContext(ListingActionContext.class, true)
				.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
				.onAction(c -> createTable((CodeViewerProvider) c.getComponentProvider()))
				.buildAndInstall(tool);

		new ActionBuilder(CREATE_ADDRESS_RANGE_TABLE_ACTION_NAME, getName())
				.menuPath(ToolConstants.MENU_SELECTION, CREATE_ADDRESS_RANGE_TABLE_ACTION_NAME)
				.menuGroup("SelectUtils")
				.helpLocation(new HelpLocation(HelpTopics.CODE_BROWSER, "Selection_Tables"))
				.withContext(ListingActionContext.class, true)
				.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
				.onAction(
					c -> createAddressRangeTable((CodeViewerProvider) c.getComponentProvider()))
				.buildAndInstall(tool);

	}
Plugin for adding some basic selection actions for Code Browser Listings.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeBrowserSelectionPlugin.java