当前位置: 首页>>代码示例>>Java>>正文


Java TagAttributes类代码示例

本文整理汇总了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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:17,代码来源:RelaxedTagDecorator.java

示例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));
	}
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:21,代码来源:JKTagWrapper.java

示例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;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:10,代码来源:JKTagWrapper.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:8,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:8,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:13,代码来源:BootsFacesTagDecorator.java

示例7: convertTofSelectItemText

import javax.faces.view.facelets.TagAttributes; //导入依赖的package包/类
/**
 * Converts &lt;option&gt;firstComboboxItem&lt;/option&gt; to &lt;f:selectItem itemValue="firstComboxItem"&gt;.
 */
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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:12,代码来源:BootsFacesTagDecorator.java

示例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()]));
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:14,代码来源:RelaxedTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:7,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:7,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:7,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:7,代码来源:BootsFacesTagDecorator.java

示例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;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:54,代码来源:BootsFacesTagDecorator.java


注:本文中的javax.faces.view.facelets.TagAttributes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。