當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。