public static void createSharedActions(Tool tool, ToolActions toolActions, String owner) {

		String actionMenuGroup = "zzzTreeGroup";
		tool.setMenuGroup(new String[] { "Collapse" }, actionMenuGroup, "1");
		tool.setMenuGroup(new String[] { "Expand" }, actionMenuGroup, "2");

		int subGroupIndex = 1; // order by insertion
		GTreeAction collapseAction = new GTreeAction("Tree Collapse Node", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				List<GTreeNode> nodes = gTree.getSelectedNodes();
				for (GTreeNode node : nodes) {
					gTree.collapseAll(node);
				}
			}

			@Override
			public boolean isEnabledForContext(ActionContext context) {

				if (!super.isEnabledForContext(context)) {
					return false;
				}

				GTree gTree = getTree(context);
				List<GTreeNode> nodes = gTree.getSelectedNodes();
				return !nodes.isEmpty();
			}
		};
		//@formatter:off
		collapseAction.setPopupMenuData(new MenuData(
				new String[] { "Collapse" },
				Icons.COLLAPSE_ALL_ICON,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		collapseAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_UP, InputEvent.ALT_DOWN_MASK));
		//@formatter:on

		GTreeAction expandAction = new GTreeAction("Tree Expand Node", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				List<GTreeNode> nodes = gTree.getSelectedNodes();
				for (GTreeNode node : nodes) {
					gTree.expandTree(node);
				}
			}

			@Override
			public boolean isEnabledForContext(ActionContext context) {

				if (!super.isEnabledForContext(context)) {
					return false;
				}

				GTree gTree = getTree(context);
				List<GTreeNode> nodes = gTree.getSelectedNodes();
				return !nodes.isEmpty();
			}
		};
		//@formatter:off
		expandAction.setPopupMenuData(new MenuData(
				new String[] { "Expand" },
				Icons.EXPAND_ALL_ICON,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		expandAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_DOWN, InputEvent.ALT_DOWN_MASK));
		//@formatter:on

		GTreeAction collapseTreeAction = new GTreeAction("Tree Collapse All", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				GTreeNode root = gTree.getViewRoot();
				gTree.collapseAll(root);
			}
		};
		//@formatter:off
		collapseTreeAction.setPopupMenuData(new MenuData(
				new String[] { "Collapse Tree" },
				null,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		//@formatter:on

		GTreeAction expandTreeAction = new GTreeAction("Tree Expand All", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				gTree.expandAll();
			}
		};
		//@formatter:off
		expandTreeAction.setPopupMenuData(new MenuData(
				new String[] { "Expand Tree" },
				null,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		//@formatter:on

		GTreeAction copyFormattedAction = new GTreeAction("Tree Copy Formatted", owner) {
			@Override
			public void actionPerformed(ActionContext context) {

				GTree gTree = getTree(context);
				gTree.tree.isCopyFormatted = true;
				try {
					Action builtinCopyAction = TransferHandler.getCopyAction();
					builtinCopyAction.actionPerformed(new ActionEvent(gTree.tree, 0, "copy"));
				}
				finally {
					gTree.tree.isCopyFormatted = false;
				}
			}
		};
		//@formatter:off
		copyFormattedAction.setPopupMenuData(new MenuData(
				new String[] { "Copy Formatted" },
				null,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		copyFormattedAction.setHelpLocation(new HelpLocation("Trees", "Copy_Formatted"));
		//@formatter:on

		GTreeAction activateFilterAction = new GTreeAction("Table/Tree Activate Filter", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				gTree.filterProvider.activate();
			}
		};
		//@formatter:off
		activateFilterAction.setPopupMenuData(new MenuData(
				new String[] { "Activate Filter" },
				null,
				actionMenuGroup, NO_MNEMONIC,
				Integer.toString(subGroupIndex++)
			)
		);
		activateFilterAction.setKeyBindingData(new KeyBindingData("Control F"));
		activateFilterAction.setHelpLocation(new HelpLocation("Trees", "Toggle_Filter"));
		
		GTreeAction toggleFilterAction = new GTreeAction("Table/Tree Toggle Filter", owner) {
			@Override
			public void actionPerformed(ActionContext context) {
				GTree gTree = getTree(context);
				gTree.filterProvider.toggleVisibility();				
			}
		};
		//@formatter:on
		toggleFilterAction.setPopupMenuData(new MenuData(
			new String[] { "Toggle Filter" },
			null,
			actionMenuGroup, NO_MNEMONIC,
			Integer.toString(subGroupIndex++)));
		toggleFilterAction.setHelpLocation(new HelpLocation("Trees", "Toggle_Filter"));

		// these actions are self-explanatory and do need help
		collapseAction.markHelpUnnecessary();
		expandAction.markHelpUnnecessary();
		collapseTreeAction.markHelpUnnecessary();
		expandTreeAction.markHelpUnnecessary();

		toolActions.addGlobalAction(collapseAction);
		toolActions.addGlobalAction(expandAction);
		toolActions.addGlobalAction(collapseTreeAction);
		toolActions.addGlobalAction(expandTreeAction);
		toolActions.addGlobalAction(copyFormattedAction);
		toolActions.addGlobalAction(activateFilterAction);
		toolActions.addGlobalAction(toggleFilterAction);
	}
Calling setSelectedPaths on GTree queues the selection for after any currently scheduled
tasks. This method sets the selected path immediately and does not wait for any scheduled
tasks.

@param path the path to select.
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/GTree.java