private void createActions(String owner) {

		List<DockingAction> list = new ArrayList<>();

		goToViewAction = new ProgramTreeAction("Go To start of folder/fragment in View", owner,
			KeyStroke.getKeyStroke("ENTER")) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (context instanceof ProgramTreeActionContext ptac) {
					return ptac.hasSingleNodeSelection() || ptac.hasFullNodeMultiSelection();
				}
				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				goToView((ProgramTreeActionContext) context);
			}
		};

		goToViewAction.setPopupMenuData(new MenuData(new String[] { "Go To in View" }, "aview"));

		list.add(goToViewAction);

		removeViewAction = new ProgramTreeAction("Remove folder/fragment from View", owner,
			KeyStroke.getKeyStroke("R")) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {

				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (ptac.hasSingleNodeSelection() || ptac.hasFullNodeMultiSelection()) {

					TreePath[] paths = ptac.getSelectionPaths();
					for (TreePath path : paths) {
						ProgramNode node = (ProgramNode) path.getLastPathComponent();
						if (node.isInView()) {
							return true;
						}
					}
				}
				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				removeFromView((ProgramTreeActionContext) context);
			}
		};

		removeViewAction
				.setPopupMenuData(new MenuData(new String[] { "Remove from View" }, "aview"));

		list.add(removeViewAction);

		setViewAction = new ProgramTreeAction("Set View", owner, KeyStroke.getKeyStroke("S")) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (context instanceof ProgramTreeActionContext ptac) {
					return ptac.hasSingleNodeSelection() || ptac.hasFullNodeMultiSelection();
				}
				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				setView((ProgramTreeActionContext) context);
			}
		};

		setViewAction.setPopupMenuData(new MenuData(new String[] { "Set View" }, "aview"));

		list.add(setViewAction);

		addToViewAction = new ProgramTreeAction("Add to View", owner, KeyStroke.getKeyStroke("A")) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (context instanceof ProgramTreeActionContext ptac) {
					return ptac.hasSingleNodeSelection() || ptac.hasFullNodeMultiSelection();
				}
				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				addToView((ProgramTreeActionContext) context);
			}
		};

		addToViewAction.setPopupMenuData(new MenuData(new String[] { "Add to View" }, "aview"));

		list.add(addToViewAction);

		cutAction = new ProgramTreeAction("Cut folder/fragment", owner, null) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (ptac.hasFullNodeMultiSelection()) {
					return true;
				}

				if (ptac.hasSingleNodeSelection()) {
					return !ptac.isOnlyRootNodeSelected();
				}

				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				cut((ProgramTreeActionContext) context);
			}
		};

		cutAction.setPopupMenuData(new MenuData(new String[] { "Cut" }, "edit"));

		list.add(cutAction);

		copyAction = new ProgramTreeAction("Copy folder/fragment", owner, null) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (ptac.hasFullNodeMultiSelection()) {
					return true;
				}

				if (ptac.hasSingleNodeSelection()) {
					return !ptac.isOnlyRootNodeSelected();
				}

				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				copy((ProgramTreeActionContext) context);
			}
		};

		copyAction.setPopupMenuData(new MenuData(new String[] { "Copy" }, "edit"));

		list.add(copyAction);

		pasteAction = new ProgramTreeAction("Paste folder/fragment", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				ProgramNode node = ptac.getSingleSelectedNode();
				return node != null && isPasteOk(node);
			}

			@Override
			public void actionPerformed(ActionContext context) {
				ProgramTreeActionContext ptac = (ProgramTreeActionContext) context;
				ProgramNode node = ptac.getSingleSelectedNode();
				ProgramDnDTree tree = ptac.getTree();
				pasteManager.paste(tree, node);
			}
		};

		pasteAction.setPopupMenuData(new MenuData(new String[] { "Paste" }, "edit"));

		list.add(pasteAction);

		createFolderAction = new ProgramTreeAction("Create Folder", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (!ptac.hasSingleNodeSelection()) {
					return false;
				}

				if (ptac.isOnlyRootNodeSelected()) {
					return true;
				}

				ProgramNode node = ptac.getSingleSelectedNode();
				return !node.isFragment();
			}

			@Override
			public void actionPerformed(ActionContext context) {
				createFolder((ProgramTreeActionContext) context);
			}

		};

		createFolderAction
				.setPopupMenuData(new MenuData(new String[] { "Create Folder" }, "createGroup"));

		list.add(createFolderAction);

		createFragmentAction = new ProgramTreeAction("Create Fragment", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (!ptac.hasSingleNodeSelection()) {
					return false;
				}

				if (ptac.isOnlyRootNodeSelected()) {
					return true;
				}

				ProgramNode node = ptac.getSingleSelectedNode();
				return !node.isFragment();
			}

			@Override
			public void actionPerformed(ActionContext context) {
				createFragment((ProgramTreeActionContext) context);
			}
		};

		createFragmentAction
				.setPopupMenuData(new MenuData(new String[] { "Create Fragment" }, "createGroup"));

		list.add(createFragmentAction);

		mergeAction = new ProgramTreeAction("Merge folder/fragment with Parent", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (ptac.hasSingleNodeSelection()) {
					ProgramNode node = ptac.getSingleSelectedNode();
					if (ptac.isOnlyRootNodeSelected() || node.isFragment()) {
						return false;
					}
				}

				return isMergeEnabled(ptac);
			}

			@Override
			public void actionPerformed(ActionContext context) {
				merge((ProgramTreeActionContext) context);
			}
		};

		mergeAction.setPopupMenuData(new MenuData(new String[] { "Merge with Parent" }, "merge"));

		list.add(mergeAction);

		deleteAction = new ProgramTreeAction("Delete folder/fragment", owner, null) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}
				return isDeleteEnabled(ptac);
			}

			@Override
			public void actionPerformed(ActionContext context) {
				delete((ProgramTreeActionContext) context);
			}
		};

		deleteAction.setPopupMenuData(new MenuData(new String[] { "Delete" }, "delete"));
		deleteAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_DELETE, 0));

		list.add(deleteAction);

		renameAction = new ProgramTreeAction("Rename folder/fragment", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (context instanceof ProgramTreeActionContext ptac) {
					return ptac.hasSingleNodeSelection();
				}
				return false;
			}

			@Override
			public void actionPerformed(ActionContext context) {
				ProgramDnDTree tree = ((ProgramTreeActionContext) context).getTree();
				tree.rename();
			}
		};

		renameAction.setPopupMenuData(new MenuData(new String[] { "Rename" }, "delete"));

		list.add(renameAction);

		expandAction = new ProgramTreeAction("Expand All folders/fragments", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (!ptac.hasSingleNodeSelection()) {
					return false;
				}

				if (ptac.isOnlyRootNodeSelected()) {
					return !allPathsExpanded(ptac);
				}

				ProgramNode node = ptac.getSingleSelectedNode();
				if (node.isFragment()) {
					return false;
				}

				return !allPathsExpanded(ptac);
			}

			@Override
			public void actionPerformed(ActionContext context) {
				expand((ProgramTreeActionContext) context);
			}
		};

		expandAction.setPopupMenuData(new MenuData(new String[] { "Expand All" }, "expand"));

		list.add(expandAction);

		collapseAction = new ProgramTreeAction("Collapse All folders/fragments", owner, null,
			ProgramTreeAction.SINGLE_SELECTION) {

			@Override
			public boolean isEnabledForContext(ActionContext context) {
				if (!(context instanceof ProgramTreeActionContext ptac)) {
					return false;
				}

				if (!ptac.hasSingleNodeSelection()) {
					return false;
				}

				if (ptac.isOnlyRootNodeSelected()) {
					return !allPathsCollapsed(ptac);
				}

				ProgramNode node = ptac.getSingleSelectedNode();
				if (node.isFragment()) {
					return false;
				}

				return !allPathsCollapsed(ptac);
			}

			@Override
			public void actionPerformed(ActionContext context) {
				collapse((ProgramTreeActionContext) context);
			}
		};

		collapseAction.setPopupMenuData(new MenuData(new String[] { "Collapse All" }, "expand"));

		list.add(collapseAction);

		actions = new DockingAction[list.size()];
		actions = list.toArray(actions);
	}
Get the action for the tree.

@return PluginAction[]
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreeActionManager.java