Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
License Agreement. Rich Faces - Natural Ajax for Java Server Faces (JSF) Copyright (C) 2007 Exadel, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 package org.richfaces.renderkit;
 
 import java.util.Map;
 
 import  org.ajax4jsf.javascript.ScriptStringBase;
 import  org.ajax4jsf.javascript.ScriptUtils;

Author(s):
Nick Belaevski
Since:
4.0
 
 public class AjaxOptions extends ScriptStringBase {
     public static final String PARAMETERS = "parameters";
     public static final String CLIENT_PARAMETERS = "clientParameters";
     private Map<StringObjectoptions = new HashMap<StringObject>();
     private Object beforesubmitHandler;
 
     public void appendScript(Appendable targetthrows IOException {
         ScriptUtils.appendScript(target);
     }
 
     public boolean isEmpty() {
         return .isEmpty();
     }
 
     public Object get(String optionName) {
         return .get(optionName);
     }
 
     public void set(String optionNameObject optionValue) {
         .put(optionNameoptionValue);
     }
 
     public void remove(String optionName) {
         .remove(optionName);
     }
 
     public boolean hasParameters() {
         @SuppressWarnings("unchecked")
         Map<StringObjectparameters = (Map<StringObject>) .get();
 
         return (parameters != null) && !parameters.isEmpty();
     }
 
     // TODO: optimize rendered data
     public Map<StringObjectgetParameters() {
         @SuppressWarnings("unchecked")
         Map<StringObjectparameters = (Map<StringObject>) .get();
 
         if (parameters == null) {
             parameters = new LinkedHashMap<StringObject>();
             .put(parameters);
         }
 
         return parameters;
     }
 
     public Object getParameter(String parameterName) {
         Object result = null;
         @SuppressWarnings("unchecked")
         Map<StringObjectparameters = (Map<StringObject>) .get();
 
         if (parameters != null) {
             result = parameters.get(parameterName);
         }
 
         return result;
     }
 
     public void setParameter(String parameterNameObject parameterValue) {
         getParameters().put(parameterNameparameterValue);
     }
 
     public void addParameters(Map<StringObjectparams) {
         if (params == null || params.isEmpty()) {
             return;
        }
        getParameters().putAll(params);
    }
    public void removeParameter(String parameterName) {
        @SuppressWarnings("unchecked")
        Map<StringObjectparameters = (Map<StringObject>) .get();
        if (parameters != null) {
            parameters.remove(parameterName);
        }
    }
    public Object getClientParameters() {
        return .get();
    }
    public void setClientParameters(Object value) {
        .put(value);
    }
    public Object getAjaxComponent() {
        return getParameter(AjaxConstants.AJAX_COMPONENT_ID_PARAMETER);
    }
    public void setAjaxComponent(Object ajaxComponent) {
        getParameters().put(AjaxConstants.AJAX_COMPONENT_ID_PARAMETER, ajaxComponent);
    }
    public Object getBeforesubmitHandler() {
        return ;
    }
    public void setBeforesubmitHandler(Object beforesubmitHandler) {
        this. = beforesubmitHandler;
    }
New to GrepCode? Check out our FAQ X