function lf_warning(ID, varargin)
%LF_WARNING Generate a warning message based on the ID passed by argument.

%   Copyright 2007-2010 The MathWorks, Inc.

tempStack = dbstack('-completenames');
if iscell(ID), ID = ID{:}; end
if length(tempStack) > 1
    col = strfind(ID, ':');
    if length(col)==1
        % Get the productKey using utility function
        productKey = linkfoundation.util.getProductKey(tempStack(2).file);
    else
        % productKey was passed as part of error ID
        productKey = ID(1:col(1)-1);
        ID = ID(col(1)+1:end);
    end
    fHandle = str2func([productKey '.MessageHandler.throwWarning']);
    fHandle(ID, varargin{:});
else
    lf_error('utils:unknownProductKey');
end

end