本文整理汇总了Java中javax.faces.view.facelets.TagAttributes类的典型用法代码示例。如果您正苦于以下问题:Java TagAttributes类的具体用法?Java TagAttributes怎么用?Java TagAttributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagAttributes类属于javax.faces.view.facelets包,在下文中一共展示了TagAttributes类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertTag
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例2: JKTagWrapper
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
/**
* Instantiates a new JK tag wrapper.
*
* @param tag
* the tag
*/
public JKTagWrapper(final Tag tag) {
this.tag = tag;
this.localName = tag.getLocalName();
this.location = tag.getLocation();
this.namespace = tag.getNamespace();
this.qName = tag.getQName();
final TagAttributes attributes = tag.getAttributes();
final TagAttribute[] all = attributes.getAll();
this.attributesList = new ArrayList<>();
for (final TagAttribute tagAttribute : all) {
this.attributesList.add(new JKTagAttributeWrapper(tagAttribute));
}
}
示例3: buildAttribues
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
protected TagAttributes buildAttribues() {
final TagAttribute[] attributes = new TagAttributeImpl[this.attributesList.size()];
for (int i = 0; i < this.attributesList.size(); i++) {
final JKTagAttributeWrapper attr = this.attributesList.get(i);
attributes[i] = attr.buildAttribute();
}
final TagAttributesImpl attrs = new TagAttributesImpl(attributes);
return attrs;
}
示例4: convertElementToInputTag
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例5: convertElementToSelectOneMenuTag
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例6: addBlockAttributeIfNeeded
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
private TagAttributes addBlockAttributeIfNeeded(Tag tag, boolean isDiv, TagAttribute[] attributes) {
TagAttribute[] moreAttributes = attributes;
if (isDiv) {
moreAttributes = new TagAttribute[attributes.length + 1];
for (int i = 0; i < attributes.length; i++)
moreAttributes[i] = attributes[i];
moreAttributes[attributes.length] = TagAttributeUtilities.createTagAttribute(tag.getLocation(),
HTML_NAMESPACE, "display", "display", "block");
}
TagAttributes more = new AFTagAttributes(moreAttributes);
return more;
}
示例7: convertTofSelectItemText
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
/**
* 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;
}
示例8: convertAttributes
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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()]));
}
示例9: convertToInputTag
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例10: convertToSelectOneMenuTag
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例11: convertDivElementToPanelGroup
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
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;
}
示例12: convertDivTagToPanelGroup
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
private Tag convertDivTagToPanelGroup(Tag tag, TagAttributes attributeList, boolean isDiv) {
TagAttribute[] attributes = attributeList.getAll();
TagAttributes more = addBlockAttributeIfNeeded(tag, isDiv, attributes);
Tag t = new Tag(tag.getLocation(), JSF_NAMESPACE, "panelGroup", "panelGroup", more);
return t;
}
示例13: createTags
import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
private Tag createTags(Tag tag) {
String ns = tag.getNamespace();
// we only handle html tags!
if (HTML_NAMESPACE.equals(ns)) {
active = true;
TagAttributes modifiedAttributes = tag.getAttributes();
// Apache MyFaces converts HTML tag with jsf: namespace, but missing
// an
// attribute, into jsf:element tag. We'll fix this
// for the special case of input fields.
if ("element".equals(tag.getLocalName())) {
TagAttribute tagAttribute = modifiedAttributes.get(PASS_THROUGH_NAMESPACE, "elementName");
if ("input".equals(tagAttribute.getValue())) {
return convertElementToInputTag(tag, modifiedAttributes);
}
if ("select".equals(tagAttribute.getValue())) {
return convertElementToSelectOneMenuTag(tag, modifiedAttributes);
}
if ("div".equals(tagAttribute.getValue())) {
return convertDivElementToPanelGroup(tag, modifiedAttributes, true);
}
}
Tag newTag = relaxedDecorator.decorate(tag);
if (newTag != null && newTag != tag) {
return newTag;
}
if ("input".equals(tag.getLocalName())) {
return convertToInputTag(tag, modifiedAttributes);
}
if ("select".equals(tag.getLocalName())) {
return convertToSelectOneMenuTag(tag, modifiedAttributes);
}
if ("div".equals(tag.getLocalName())) {
return convertDivTagToPanelGroup(tag, modifiedAttributes, true);
}
if ("span".equals(tag.getLocalName())) {
return convertDivTagToPanelGroup(tag, modifiedAttributes, false);
}
if ("option".equals(tag.getLocalName())) {
return convertTofSelectItemText(tag, modifiedAttributes);
}
tag = convertBootsFacesTag(tag);
}
return tag;
}