private TagAttributes removeType(TagAttributes attrs) { TagAttribute[] o = attrs.getAll(); TagAttribute[] a = new TagAttribute[o.length - 1]; int p = 0; for (int i = 0; i < o.length; i++) { if (!"type".equals(o[i].getLocalName())) { a[p++] = o[i]; } } return new TagAttributesImpl(a); }
private TagAttributes removeType(TagAttributes attrs) { TagAttribute[] o = attrs.getAll(); TagAttribute[] a = new TagAttribute[o.length - 1]; int p = 0; for (int i = 0; i < o.length; i++) { if (!"type".equals(o[i].getLocalName())) { a[p++] = o[i]; } } return new TagAttributesImpl(a); }
protected TagAttributes convertAttributes(TagAttributes original, Tag element) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(element); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new AFTagAttributes(attributes.values().toArray(new TagAttribute[attributes.size()])); }
protected TagAttributes convertAttributes(TagAttributes original, Tag element) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(element); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new AFTagAttributes(attributes.values().toArray(new TagAttribute[attributes.size()])); }
protected TagAttributes convertAttributes(TagAttributes original, Tag element) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(element); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new AFTagAttributes(attributes.values().toArray(new TagAttribute[attributes.size()])); }
protected TagAttributes convertAttributes(TagAttributes original) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(original.getTag()); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new TagAttributesImpl(attributes.values().toArray(new TagAttribute[attributes.size()])); }
protected TagAttributes convertAttributes(TagAttributes original) { Map<String, TagAttribute> attributes = new HashMap<>(); TagAttribute elementName = createElementName(original.getTag()); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new TagAttributesImpl(attributes.values().toArray(new TagAttribute[attributes.size()])); }
private Tag convertElementToInputTag(Tag tag, TagAttributes modifiedAttributes) { TagAttribute[] attributes = modifiedAttributes.getAll(); TagAttribute[] lessAttributes = Arrays.copyOf(attributes, attributes.length - 1); TagAttributes less = new AFTagAttributes(lessAttributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "inputText", "b:inputText", less); return t; }
private Tag convertElementToSelectOneMenuTag(Tag tag, TagAttributes modifiedAttributes) { TagAttribute[] attributes = modifiedAttributes.getAll(); TagAttribute[] lessAttributes = Arrays.copyOf(attributes, attributes.length - 1); TagAttributes less = new AFTagAttributes(lessAttributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", less); return t; }
private Tag convertElementToSelectOneMenuTag(Tag tag, TagAttributes modifiedAttributes) { TagAttribute[] attributes = modifiedAttributes.getAll(); TagAttribute[] lessAttributes = Arrays.copyOf(attributes, attributes.length - 1); TagAttributes less = new AFTagAttributes(lessAttributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", less); return t; }
private Tag convertToInputTag(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); TagAttributes more = new AFTagAttributes(attributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "inputText", "b:inputText", more); return t; }
private Tag convertToInputText(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); TagAttributes more = new AFTagAttributes(attributes); Tag t = new Tag(tag.getLocation(), JSF_NAMESPACE, "inputText", "inputText", more); return t; }
private Tag convertToSelectOneMenuTag(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); TagAttributes more = new AFTagAttributes(attributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", more); return t; }
private Tag convertDivElementToPanelGroup(Tag tag, TagAttributes modifiedAttributes, boolean isDiv) { TagAttribute[] attributes = modifiedAttributes.getAll(); TagAttributes more = addBlockAttributeIfNeeded(tag, isDiv, attributes); Tag t = new Tag(tag.getLocation(), JSF_NAMESPACE, "panelGroup", "h:panelGroup", more); return t; }
private Tag convertToSelectOneMenuTag(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); TagAttributes more = new AFTagAttributes(attributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", more); return t; }
/** * Converts <option>firstComboboxItem</option> to <f:selectItem itemValue="firstComboxItem">. */ private Tag convertTofSelectItemText(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); AFTagAttributes more = new AFTagAttributes(attributes); more.replaceAttribute("value", "itemValue"); more.replaceAttribute("label", "itemLabel"); Tag t = new Tag(tag.getLocation(), JSF_CORE_NAMESPACE, "selectItem", "selectItem", more); return t; }
private Tag convertToPuiMessagesTag(Tag tag, TagAttributes attributeList) { if (tag.getNamespace().equals(PRIMEFACES_NAMESPACE)) { AFTagAttributes modifiedAttributes = new AFTagAttributes(attributeList.getAll()); modifiedAttributes.addAttribute(tag.getLocation(), PASS_THROUGH_NAMESPACE, "primefaces", "primefaces", "true"); Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", modifiedAttributes); return t; } else { Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", attributeList); return t; } }
protected Tag convertTag(Tag tag, Namespace namespace, String localName) { Location location = tag.getLocation(); String ns = namespace.uri; String qName = namespace.name() + ":" + localName; TagAttributes attributes = convertAttributes(tag.getAttributes()); Tag converted = new Tag(location, ns, localName, qName, attributes); for (TagAttribute tagAttribute : attributes.getAll()) { // set the correct tag tagAttribute.setTag(converted); } return converted; }
private Tag convertToTranslateTag(Tag tag, TagAttributes modifiedAttributes) { TagAttribute[] attributes = modifiedAttributes.getAll(); AFTagAttributes more = new AFTagAttributes(attributes); if (null == more.get(JSF_NAMESPACE, "value")) { more.addAttribute(tag.getLocation(), "http://beyondjava.net/angularFacesCore", "puitranslate", "ac:puitranslate", "true"); } Tag t = new Tag(tag.getLocation(), JSF_NAMESPACE, "outputText", "h:outputText", more); return t; }
protected Tag convertTag(Tag tag, Namespace namespace, String localName) { Location location = tag.getLocation(); String ns = namespace.uri; String qName = namespace.name() + ":" + localName; TagAttributes attributes = convertAttributes(tag.getAttributes(), tag); Tag converted = new Tag(location, ns, localName, qName, attributes); for (TagAttribute tagAttribute : attributes.getAll()) { // set the correct tag tagAttribute.setTag(converted); } return converted; }