@Override
        public boolean isEnabledForContext(ActionContext context) {
    		Object activeObj = context.getContextObject();
    		// Only make action available for selections which contain a minimum of one Fragment.
    		if (activeObj != null && activeObj instanceof ProgramNode) {
    			ProgramNode node = (ProgramNode) activeObj;
    			if (node.getProgram() != null) {
    				// Ensure that at least one Fragment is selected within a multi-select
    				TreePath[] selectedPaths = node.getTree().getSelectionPaths();
    				for (int i = 0; i < selectedPaths.length; i++) {
    					ProgramNode n =
    						(ProgramNode) selectedPaths[i].getLastPathComponent();
    					if (n.isFragment())
    						return true;
    				}
    			}
    		}
    		return false;
    	}
Determine if the Fragment Auto-Rename action should be visible within
the popup menu for the selected nodes within the Program Tree View.
@param activeObj the object under the mouse location for the popup.
@return true if action should be made visible in popup menu.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/module/AutoRenamePlugin.java