Author: dsakovich
Date: 2007-10-16 06:08:58 -0400 (Tue, 16 Oct 2007)
New Revision: 4213
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 add RichFaces
treeNodesAdaptor,recursiveTreeNodesAdaptor
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16
10:07:54 UTC (rev 4212)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16
10:08:58 UTC (rev 4213)
@@ -10,10 +10,8 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -143,19 +141,20 @@
*/
private void setAttributeToTree(nsIDOMNode node, String attrName,
String attrValue) {
- if (!(node instanceof Element)) {
+ try {
+ nsIDOMElement element = (nsIDOMElement) node
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (node.getNodeName().equalsIgnoreCase(
+ HtmlComponentUtil.HTML_TAG_TABLE)) {
+ element.setAttribute(attrName, attrValue);
+ }
+ nsIDOMNodeList list2 = node.getChildNodes();
+ for (int i = 0; i < list2.getLength(); i++) {
+ setAttributeToTree(list2.item(i), attrName, attrValue);
+ }
+ } catch (XPCOMException exception) {
return;
}
- if (node.getNodeName().equalsIgnoreCase(
- HtmlComponentUtil.HTML_TAG_TABLE)) {
- ((nsIDOMElement) node
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
- .setAttribute(attrName, attrValue);
- }
- nsIDOMNodeList list2 = node.getChildNodes();
- for (int i = 0; i < list2.getLength(); i++) {
- setAttributeToTree(list2.item(i), attrName, attrValue);
- }
}
/**