當前位置: 首頁>>代碼示例>>Java>>正文


Java Element.createCopy方法代碼示例

本文整理匯總了Java中org.dom4j.Element.createCopy方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.createCopy方法的具體用法?Java Element.createCopy怎麽用?Java Element.createCopy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.dom4j.Element的用法示例。


在下文中一共展示了Element.createCopy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMultiBoxLabel

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  Create label for a mulitBoxLabel element that will collapse the mulitBox
 *  input.<P>
 *
 *  Based on getComplexTypeLabel, but will always display collapse widget,
 *  rather than first testing for nodeIsExpandable as getComplexTypeLabel does.
 *  <P>
 *
 *  Depends on the multibox input having an id and display style initialized to
 *  value of collapseBean.displayState.
 *
 * @param  xpath  NOT YET DOCUMENTED
 * @return        The multiBoxLabel value
 */
public Label getMultiBoxLabel(String xpath) {
	ComplexTypeLabel labelObj = getComplexTypeLabel(xpath);
	Element alwaysExpandable = df.createElement("c__if")
		.addAttribute("test", "${true}");
	Element labelLink = alwaysExpandable.addElement("a")
		.addAttribute("href", "javascript__toggleDisplayState(" + RendererHelper.jspQuotedString("${id}") + ");");

	Element notExpandableTest = df.createElement("c__if")
		.addAttribute("test", "${false}");

	labelObj.isExpandableTest = alwaysExpandable.createCopy();
	labelObj.notExpandableTest = notExpandableTest.createCopy();
	labelObj.collapseWidget = getCollapseWidget().createCopy();
	return labelObj;
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:30,代碼來源:EditorRenderer.java

示例2: getCollapseWidget

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  Render open/close widget for this element.
 *
 * @return    The collapseWidget value
 */
protected Element getCollapseWidget() {
	Element img_template = df.createElement("img")
		.addAttribute("id", "${id}_img")
		.addAttribute("border", "0")
		.addAttribute("hspace", "3")
		.addAttribute("height", "12")
		.addAttribute("width", "12");

	Element choose = df.createElement("c__choose");

	Element isOpen = choose.addElement("c__when")
		.addAttribute("test", "${" + formBeanName + ".collapseBean.isOpen}");

	Element openedImg = img_template.createCopy();
	isOpen.add(openedImg);
	openedImg.addAttribute("src", "../images/opened.gif");

	Element otherwise = choose.addElement("c__otherwise");
	Element closedImg = (Element) img_template.createCopy();
	otherwise.add(closedImg);
	closedImg.addAttribute("src", "../images/closed.gif");

	return choose;
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:30,代碼來源:EditorRenderer.java

示例3: XmlText

import org.dom4j.Element; //導入方法依賴的package包/類
private XmlText( Element root ) throws XMLException {
    this.root = DocumentHelper.createElement("root");

    DocumentHelper.createDocument(this.root);

    this.root = root.createCopy();

    DocumentHelper.createDocument(this.root);
}
 
開發者ID:Axway,項目名稱:ats-framework,代碼行數:10,代碼來源:XmlText.java

示例4: getComplexTypeLabel

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  Create a label with collapse widget (if this nodeIsExpandable is true for
 *  this node.
 *
 * @param  xpath        NOT YET DOCUMENTED
 * @param  siblingPath  NOT YET DOCUMENTED
 * @param  indexId      NOT YET DOCUMENTED
 * @return              The complexTypeLabel value
 */
public ComplexTypeLabel getComplexTypeLabel(String xpath, String siblingPath, String indexId) {

	ComplexTypeLabel labelObj = super.getComplexTypeLabel(xpath, siblingPath, indexId);

	String itemPath = (indexId == null ? xpath : siblingPath); 
	
	// make expand widget
	if (getLevel(xpath) > 0) {
		// node is expandable clause
		Element nodeIsExpandable = df.createElement("logic__equal")
			.addAttribute("name", formBeanName)
			.addAttribute("property", "nodeIsExpandable(" + itemPath + ")")
			.addAttribute("value", "true");

		// the clickable version
		Element labelLink = nodeIsExpandable.addElement("a")
			.addAttribute("href", "javascript__toggleDisplayState(" + RendererHelper.jspQuotedString("${id}") + ");");

		Element nodeNotExpandable = df.createElement("logic__notEqual")
			.addAttribute("name", formBeanName)
			.addAttribute("property", "nodeIsExpandable(" + itemPath + ")")
			.addAttribute("value", "true");

		// load labelObj with the components it needs to render collapsible node
		labelObj.isExpandableTest = nodeIsExpandable.createCopy();
		labelObj.notExpandableTest = nodeNotExpandable.createCopy();
		labelObj.collapseWidget = getCollapseWidget().createCopy();
	}

	return labelObj;
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:41,代碼來源:EditorRenderer.java


注:本文中的org.dom4j.Element.createCopy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。