public static final Map<String, ComponentAttribute> createMap(ComponentAttribute... attributes) { Map<String, ComponentAttribute> result = new TreeMap<String, ComponentAttribute>(); for (ComponentAttribute componentAttribute : attributes) { result.put(componentAttribute.getComponentAttributeName(), componentAttribute); } return result; }
public int compareTo(ComponentAttribute o) { return getHtmlAttributeName().compareTo(o.getHtmlAttributeName()); } }
private ComponentAttribute createAttribute(String name, String componentAttribute) { ComponentAttribute attribute = new ComponentAttribute(name); attribute.setComponentAttributeName(componentAttribute); add(attribute); last = attribute; return attribute; }
public Attributes generic(String name, String componentAttribute, String... events) { ComponentAttribute attribute = createAttribute(name, componentAttribute); attribute.setEventNames(events); attribute.setKind(Kind.GENERIC); return this; }
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); } } }
String componentAttributeName = componentAttribute.getComponentAttributeName(); Object attributeValue = component.getAttributes().get(componentAttributeName); String[] eventNames = componentAttribute.getEventNames(); if (eventNames.length > 0) { Map<String, List<ClientBehavior>> behaviorsMap = getClientBehaviorsMap(component);
handledAttributes.add(knownAttribute.getHtmlAttributeName()); if (disabled && knownAttribute.getEventNames() != null) { continue; if (handledAttributes.contains(knownAttribute.getHtmlAttributeName())) { continue;
Map<String, Object> tbEvents = new HashMap<String, Object>(); for (ComponentAttribute componentAttribute : ITEMS_HANDLER_ATTRIBUTES.values()) { Object attr = component.getAttributes().get(componentAttribute.getComponentAttributeName()); if (attr != null) { RenderKitUtils.addToScriptHash(tbEvents, componentAttribute.getHtmlAttributeName().substring(2), attr, null, ScriptHashVariableWrapper.eventHandler); Object attr = tbg.getAttributes().get(componentAttribute.getComponentAttributeName()); if (attr != null) { RenderKitUtils.addToScriptHash(tbgEvents, componentAttribute.getHtmlAttributeName().substring(2), attr, null, ScriptHashVariableWrapper.eventHandler);
public Attributes uri(String name, String componentAttribute) { ComponentAttribute attribute = createAttribute(name, componentAttribute); attribute.setKind(Kind.URI); return this; }
public Attributes defaultValue(Object value) { last.setDefaultValue(value); return this; } }
public static void renderPassThroughAttributes(FacesContext context, UIComponent component, Collection<ComponentAttribute> attributes) throws IOException { boolean disabled = isDisabled(component); for (ComponentAttribute knownAttribute : attributes) { if (!disabled || knownAttribute.getEventNames().length == 0) { renderAttributeAndBehaviors(context, component, knownAttribute); } } }
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); } } }
String componentAttributeName = componentAttribute.getComponentAttributeName(); Object attributeValue = component.getAttributes().get(componentAttributeName); String[] eventNames = componentAttribute.getEventNames(); if (eventNames.length > 0) { Map<String, List<ClientBehavior>> behaviorsMap = getClientBehaviorsMap(component);
handledAttributes.add(knownAttribute.getHtmlAttributeName()); if (disabled && knownAttribute.getEventNames() != null) { continue; if (handledAttributes.contains(knownAttribute.getHtmlAttributeName())) { continue;
Map<String, Object> tbEvents = new HashMap<String, Object>(); for (ComponentAttribute componentAttribute : ITEMS_HANDLER_ATTRIBUTES.values()) { Object attr = component.getAttributes().get(componentAttribute.getComponentAttributeName()); if (attr != null) { RenderKitUtils.addToScriptHash(tbEvents, componentAttribute.getHtmlAttributeName().substring(2), attr, null, ScriptHashVariableWrapper.eventHandler); Object attr = tbg.getAttributes().get(componentAttribute.getComponentAttributeName()); if (attr != null) { RenderKitUtils.addToScriptHash(tbgEvents, componentAttribute.getHtmlAttributeName().substring(2), attr, null, ScriptHashVariableWrapper.eventHandler);
public Attributes generic(String name, String componentAttribute, String... events) { ComponentAttribute attribute = createAttribute(name, componentAttribute); attribute.setEventNames(events); attribute.setKind(Kind.GENERIC); return this; }
public Attributes bool(String name, String componentAttribute) { ComponentAttribute attribute = createAttribute(name, componentAttribute); attribute.setKind(Kind.BOOL); return this; }
public Attributes defaultValue(Object value) { last.setDefaultValue(value); return this; } }
public static void renderPassThroughAttributes(FacesContext context, UIComponent component, Collection<ComponentAttribute> attributes) throws IOException { boolean disabled = isDisabled(component); for (ComponentAttribute knownAttribute : attributes) { if (!disabled || knownAttribute.getEventNames().length == 0) { renderAttributeAndBehaviors(context, component, knownAttribute); } } }