@Override
	public boolean isEnabledForContext(ListingActionContext context) {
		if (context.hasSelection()) {
			return false;
		}
		ProgramLocation loc = context.getLocation();
		if (!(loc instanceof VariableLocation) && !(loc instanceof FunctionSignatureFieldLocation)) {
			return false;
		}

		if (loc instanceof FunctionSignatureFieldLocation) {
			updatePopupMenu(true);
		}
		else {
			updatePopupMenu(false);
		}

		Function function = functionPlugin.getFunction(context);
		return ((function != null) && (!function.hasVarArgs()));
	}
Action that changes a Function so that it has VarArgs (a variable argument list).
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/AddVarArgsAction.java