public static void addToScriptHash(Map<String, Object> hash, String name, Object value) { addToScriptHash(hash, name, value, null, null); }
public static void addToScriptHash(Map<String, Object> hash, String name, Object value) { addToScriptHash(hash, name, value, null, null); }
public static void addToScriptHash(Map<String, Object> hash, String name, Object value, Object defaultValue) { addToScriptHash(hash, name, value, defaultValue, null); }
public static void addToScriptHash(Map<String, Object> hash, String name, Object value) { addToScriptHash(hash, name, value, null, null); }
public static void addToScriptHash(Map<String, Object> hash, String name, Object value, Object defaultValue) { addToScriptHash(hash, name, value, defaultValue, null); }
public static void addToScriptHash(Map<String, Object> hash, String name, Object value, Object defaultValue) { addToScriptHash(hash, name, value, defaultValue, null); }
protected Map<String, Object> getCollectedLabels(ResourceBundle[] bundles, String[] names) { Map<String, Object> labels = new HashMap<String, Object>(); if (bundles != null && names != null) { for (String name : names) { String label = null; String bundleKey = "RICH_CALENDAR_" + name.toUpperCase() + "_LABEL"; for (ResourceBundle bundle : bundles) { if (bundle != null) { try { label = bundle.getString(bundleKey); } catch (MissingResourceException mre) { // Current key was not found, ignore this exception; } } if (label != null) { break; } } RenderKitUtils.addToScriptHash(labels, name, label); } } return labels; }
protected Map<String, Object> getCollectedLabels(ResourceBundle[] bundles, String[] names) { Map<String, Object> labels = new HashMap<String, Object>(); if (bundles != null && names != null) { for (String name : names) { String label = null; String bundleKey = "RICH_CALENDAR_" + name.toUpperCase() + "_LABEL"; for (ResourceBundle bundle : bundles) { if (bundle != null) { try { label = bundle.getString(bundleKey); } catch (MissingResourceException mre) { // Current key was not found, ignore this exception; } } if (label != null) { break; } } RenderKitUtils.addToScriptHash(labels, name, label); } } return labels; }
private void appendOptions(UIComponent queue, Map<String, Object> optionsHash) { Map<String, Object> attributes = queue.getAttributes(); for (QueueOptions option : QueueOptions.values()) { String optionName = option.name(); Object value = attributes.get(optionName); addToScriptHash(optionsHash, optionName, value); } }
private void appendOptions(UIComponent queue, Map<String, Object> optionsHash) { Map<String, Object> attributes = queue.getAttributes(); for (QueueOptions option : QueueOptions.values()) { String optionName = option.name(); Object value = attributes.get(optionName); addToScriptHash(optionsHash, optionName, value); } }
private void appendOptions(UIComponent queue, Map<String, Object> optionsHash) { Map<String, Object> attributes = queue.getAttributes(); for (QueueOptions option : QueueOptions.values()) { String optionName = option.name(); Object value = attributes.get(optionName); addToScriptHash(optionsHash, optionName, value); } }
addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH31, null); addToScriptHash(options, "selectionType", this.getSelectionType(facesContext,component), SwitchType.client, null); addToScriptHash(options, "ajaxSubmitFunction", this.getAjaxSubmitFunction(facesContext,component), null, null); addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH32, null); addToScriptHash(options, "clientEventHandlers", clientEventHandlers, null, null);
addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH21, null); addToScriptHash(options, "selectionType", this.getSelectionType(facesContext,component), SwitchType.client, null); addToScriptHash(options, "ajaxSubmitFunction", this.getAjaxSubmitFunction(facesContext,component), null, null); addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH22, null); addToScriptHash(options, "clientEventHandlers", clientEventHandlers, null, null);
@Override public void doEncodeEnd(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component) throws IOException { String clientId = component.getClientId(facesContext); Map<String, Object> options = new LinkedHashMap<String, Object>(); addToScriptHash(options, "acceptClass", this.concatClasses("rf-ind-acpt",component.getAttributes().get("acceptClass")), null, null); addToScriptHash(options, "rejectClass", this.concatClasses("rf-ind-rejt",component.getAttributes().get("rejectClass")), null, null); addToScriptHash(options, "draggingClass", this.concatClasses("rf-ind-drag",component.getAttributes().get("draggingClass")), null, null); responseWriter.startElement("script", component); responseWriter.writeAttribute("type","text/javascript",null); { Object text = "new RichFaces.ui.DragIndicator(\"" + convertToString(clientId) + "\", " + convertToString(toScriptArgs(options)) + ");"; if (text != null) { responseWriter.writeText(text, null); } } responseWriter.endElement("script"); responseWriter.endElement("div"); } }
@Override public void doEncodeEnd(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component) throws IOException { String clientId = component.getClientId(facesContext); Map<String, Object> options = new LinkedHashMap<String, Object>(); addToScriptHash(options, "acceptClass", this.concatClasses("rf-ind-acpt",component.getAttributes().get("acceptClass")), null, null); addToScriptHash(options, "rejectClass", this.concatClasses("rf-ind-rejt",component.getAttributes().get("rejectClass")), null, null); addToScriptHash(options, "draggingClass", this.concatClasses("rf-ind-drag",component.getAttributes().get("draggingClass")), null, null); responseWriter.startElement("script", component); responseWriter.writeAttribute("type","text/javascript",null); { Object text = "new RichFaces.rf4.ui.DragIndicator(\"" + convertToString(clientId) + "\", " + convertToString(toScriptArgs(options)) + ");"; if (text != null) { responseWriter.writeText(text, null); } } responseWriter.endElement("script"); responseWriter.endElement("div"); } }
addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH37, null); addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH38, ScriptHashVariableWrapper.eventHandler);
public static void addToScriptHash(Map<String, Object> hash, FacesContext facesContext, UIComponent component, Attributes attributes, ScriptHashVariableWrapper wrapper) { boolean disabled = isDisabled(component); for (ComponentAttribute knownAttribute : attributes) { if (!disabled || knownAttribute.getEventNames().length == 0) { String attributeName = knownAttribute.getComponentAttributeName(); addToScriptHash(hash, attributeName, getAttributeAndBehaviorsValue(facesContext, component, knownAttribute), knownAttribute.getDefaultValue(), wrapper); } } }
addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH4, null); addToScriptHash(options, facesContext, component, ATTRIBUTES_FOR_SCRIPT_HASH5, ScriptHashVariableWrapper.eventHandler);
public static void addToScriptHash(Map<String, Object> hash, FacesContext facesContext, UIComponent component, Attributes attributes, ScriptHashVariableWrapper wrapper) { boolean disabled = isDisabled(component); for (ComponentAttribute knownAttribute : attributes) { if (!disabled || knownAttribute.getEventNames().length == 0) { String attributeName = knownAttribute.getComponentAttributeName(); addToScriptHash(hash, attributeName, getAttributeAndBehaviorsValue(facesContext, component, knownAttribute), knownAttribute.getDefaultValue(), wrapper); } } }
public static void addToScriptHash(Map<String, Object> hash, FacesContext facesContext, UIComponent component, Attributes attributes, ScriptHashVariableWrapper wrapper) { boolean disabled = isDisabled(component); for (ComponentAttribute knownAttribute : attributes) { if (!disabled || knownAttribute.getEventNames().length == 0) { String attributeName = knownAttribute.getHtmlAttributeName(); addToScriptHash(hash, attributeName, getAttributeAndBehaviorsValue(facesContext, component, knownAttribute), knownAttribute.getDefaultValue(), wrapper); } } }