@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);
			}
Get the action for the tree.

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