[153687] TreeContentHelper out of synch in head
diff --git a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
index 8a0d26b..68657fe 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-multipage/org/eclipse/wst/xml/ui/internal/tabletree/TreeContentHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004-2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -178,6 +178,34 @@
return list;
}
+ public String getElementTextValue(Element element)
+ {
+ List list = _getElementTextContent(element);
+ return list != null ? getValueForTextContent(list) : null;
+ }
+
+ public void setElementTextValue(Element element, String value)
+ {
+ setElementNodeValue(element, value);
+ }
+
+ private List _getElementTextContent(Element element) {
+ List result = null;
+
+ for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) {
+ if (node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
+ if (result == null) {
+ result = new Vector();
+ }
+ result.add(node);
+ } else {
+ result = null;
+ break;
+ }
+ }
+ return result;
+ }
+
/**
* If the element is has 'text only' content this method will return the
* list of elements that compose the text only content
@@ -185,21 +213,12 @@
public List getElementTextContent(Element element) {
List result = null;
if (!element.hasAttributes()) {
- for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling()) {
- if (node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.ENTITY_REFERENCE_NODE) {
- if (result == null) {
- result = new Vector();
- }
- result.add(node);
- } else {
- result = null;
- break;
- }
- }
+ result = _getElementTextContent(element);
}
return result;
}
+
/**
*
*/