@Override
	protected boolean isEnabledForContext(ProgramActionContext context) {

		Program program = context.getProgram();
		if (program == null) {
			return false;
		}

		FunctionManager functionMgr = program.getFunctionManager();
		Function func;
		if (context instanceof ListingActionContext) {
			ListingActionContext listingContext = (ListingActionContext) context;
			func = functionMgr.getFunctionAt(listingContext.getAddress());
		}
		else if (context instanceof ProgramSymbolActionContext) {
			ProgramSymbolActionContext symbolContext = (ProgramSymbolActionContext) context;
			if (symbolContext.getSymbolCount() != 1) {
				return false;
			}
			Symbol s = symbolContext.getFirstSymbol();
			if (s == null || s.isExternal() || s.getSymbolType() != SymbolType.FUNCTION) {
				return false;
			}
			func = (Function) s.getObject();
		}
		else {
			return false;
		}
		return func != null;
	}
Create a new action, to edit a thunk function at the current location
@param plugin  does checking for this action
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/EditThunkFunctionAction.java