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

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