diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline.xsp-config b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline.xsp-config index fa6a79e..9f4684f 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline.xsp-config +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline.xsp-config @@ -458,6 +458,13 @@ boolean + + %property.escape.descr% + %property.escape.name% + escape + boolean + + com.ibm.xsp.extlib.tree.ITreeNode diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline_en.properties b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline_en.properties index 62d7e39..9a603fb 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline_en.properties +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/extlib-outline_en.properties @@ -86,6 +86,8 @@ property.enabled.name= Enabled property.enabled.descr= Indicates if the node is enabled. The meaning of disabled depends on whether this node is used, but it may mean that label may be displayed as text instead of a link. Or if the nodes are displayed as buttons, it may mean that the disabled button is gray and does not respond to clicks. Enabled by default. property.selected.name= Selected property.selected.descr= Indicates if the node is selected. Selected nodes appear different to unselected nodes, perhaps with a darker background. +property.escape.name= Escape +property.escape.descr= Flag indicating that characters in the label that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default. complex-type.basicLeafNode.name= Basic Node complex-type.basicLeafNode.descr= Basic node to be included into a container node property.href.name= URL Reference diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-outline.xsp-config b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-outline.xsp-config index 8318e50..d36bc98 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-outline.xsp-config +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/config/raw-extlib-outline.xsp-config @@ -580,6 +580,14 @@ + + Flag indicating that characters in the label that are sensitive in HTML and XML markup must be escaped. This flag is set to "true" by default. + Escape Characters + escape + boolean + + + com.ibm.xsp.extlib.tree.ITreeNode diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/AbstractTreeRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/AbstractTreeRenderer.java index b0976f8..34a3e7c 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/AbstractTreeRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/AbstractTreeRenderer.java @@ -331,6 +331,9 @@ public boolean isNodeRendered(ITreeNode node) { public boolean isNodeSelected(ITreeNode node) { return false; } + public boolean isNodeEscape(ITreeNode node) { + return true; + } // =================================================================== diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoAccordionRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoAccordionRenderer.java index 6108ba0..3c6daa2 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoAccordionRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoAccordionRenderer.java @@ -31,6 +31,7 @@ import com.ibm.xsp.extlib.tree.ITreeNode; import com.ibm.xsp.renderkit.dojo.DojoUtil; import com.ibm.xsp.resource.DojoModuleResource; +import com.ibm.xsp.util.HtmlUtil; public class DojoAccordionRenderer extends AbstractTreeRenderer { @@ -128,6 +129,7 @@ protected void renderNode(FacesContext context, ResponseWriter writer, TreeConte boolean enabled = tree.getNode().isEnabled(); String style = getItemStyle(tree,enabled,false); String styleClass = getItemStyleClass(tree,enabled,false); + boolean escape = tree.getNode().isEscape(); boolean leaf = tree.getNode().getType()==ITreeNode.NODE_LEAF; String href = null; @@ -179,7 +181,11 @@ protected void renderNode(FacesContext context, ResponseWriter writer, TreeConte // } if(StringUtil.isNotEmpty(label)) { //writer.writeAttribute("title", label, null); // $NON-NLS-1$ - attrs.put("title", label); // $NON-NLS-1$ $NON-NLS-2$ + if(escape) { + attrs.put("title", HtmlUtil.toHTMLContentString(label, false)); //$NON-NLS-1$ + } else { + attrs.put("title", label); //$NON-NLS-1$ + } } DojoRendererUtil.writeDojoHtmlAttributes(context, getComponent(), dojoType, attrs); diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoDropDownButtonRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoDropDownButtonRenderer.java index cb04482..bb18e4b 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoDropDownButtonRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoDropDownButtonRenderer.java @@ -97,7 +97,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } writer.writeText(" ",null); // $NON-NLS-1$ diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoMenuRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoMenuRenderer.java index dd07043..281fff6 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoMenuRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DojoMenuRenderer.java @@ -30,6 +30,7 @@ import com.ibm.xsp.extlib.util.ExtLibUtil; import com.ibm.xsp.renderkit.html_basic.HtmlRendererUtil; import com.ibm.xsp.renderkit.html_extended.RenderUtil; +import com.ibm.xsp.util.HtmlUtil; import com.ibm.xsp.util.JavaScriptUtil; public class DojoMenuRenderer extends AbstractTreeRenderer { @@ -247,7 +248,11 @@ protected void renderTreeNode(FacesContext context, ResponseWriter writer, TreeC if(StringUtil.isNotEmpty(label)) { if(hasp) script.append(","); else hasp=true; script.append("label:"); // $NON-NLS-1$ - JavaScriptUtil.addString(script, label); + if(tree.getNode().isEscape()) { + JavaScriptUtil.addString(script, HtmlUtil.toHTMLContentString(label, false)); + } else { + JavaScriptUtil.addString(script, label); + } } boolean enabled = tree.getNode().isEnabled(); diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DropDownButtonRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DropDownButtonRenderer.java index d1f64a0..03111cd 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DropDownButtonRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/DropDownButtonRenderer.java @@ -91,7 +91,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } writePopupImage(context, writer, tree); diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlComboBoxRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlComboBoxRenderer.java index 793dbf1..09806e1 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlComboBoxRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlComboBoxRenderer.java @@ -93,6 +93,7 @@ protected void renderNode(FacesContext context, ResponseWriter writer, TreeConte if(selected) { writer.writeAttribute("selected", "selected", "selected"); // $NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$ } + // Don't obey escape=false here, since HTML inside option tags would be invalid writer.writeText(label,"label"); // $NON-NLS-1$ writer.endElement("option"); // $NON-NLS-1$ JSUtil.writeln(writer); diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlTagsRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlTagsRenderer.java index 43f4ebb..15c3648 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlTagsRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/renderkit/html_extended/outline/tree/HtmlTagsRenderer.java @@ -419,7 +419,11 @@ protected void writePopupImage(FacesContext context, ResponseWriter writer, Tree protected void renderEntryItemLabel(FacesContext context, ResponseWriter writer, TreeContextImpl tree, boolean enabled, boolean selected) throws IOException { String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); //$NON-NLS-1$ + } else { + writer.write(label); + } } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNode.java index 3a4c92f..177cd20 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNode.java @@ -188,6 +188,10 @@ public static interface TreeContext { */ public String getTitle(); + /** + * Check if the entry's label should be HTML-escaped. + */ + public boolean isEscape(); // ===================================================== // Event management diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNodeDefaultValues.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNodeDefaultValues.java index be1474b..4b9b103 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNodeDefaultValues.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/ITreeNodeDefaultValues.java @@ -82,22 +82,22 @@ public interface ITreeNodeDefaultValues { public String getNodeTitle(ITreeNode node); /** - * Check if an node is selected. + * Check if a node is selected. */ public boolean isNodeSelected(ITreeNode node); /** - * Check if an node is enabled. + * Check if a node is enabled. */ public boolean isNodeEnabled(ITreeNode node); /** - * Check if an node is rendered. + * Check if a node is rendered. */ public boolean isNodeRendered(ITreeNode node); /** - * Check if an node is expanded. + * Check if a node is expanded. */ public boolean isNodeExpanded(ITreeNode node); @@ -110,4 +110,9 @@ public interface ITreeNodeDefaultValues { * Value submitted as part of the event. */ public String getNodeSubmitValue(ITreeNode node); + + /** + * Check if the entry's label should be HTML-escaped. + */ + public boolean isNodeEscape(ITreeNode node); } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/AbstractComplexTreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/AbstractComplexTreeNode.java index 4af85c5..8eba9a8 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/AbstractComplexTreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/AbstractComplexTreeNode.java @@ -175,4 +175,12 @@ public boolean isSelected() { } return false; } + + public boolean isEscape() { + ITreeNodeDefaultValues tree = getTreeNodeDefault(); + if(tree!=null) { + return tree.isNodeEscape(this); + } + return true; + } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BasicComplexTreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BasicComplexTreeNode.java index e64e454..0621fe3 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BasicComplexTreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BasicComplexTreeNode.java @@ -47,6 +47,7 @@ public abstract class BasicComplexTreeNode extends AbstractComplexTreeNode { private Boolean expanded; private Boolean selected; private Boolean enabled; + private Boolean escape; public BasicComplexTreeNode() { } @@ -274,6 +275,25 @@ public boolean isExpanded() { public void setExpanded(boolean expanded) { this.expanded = expanded; } + + @Override + public boolean isEscape() { + if(null != this.escape) { + return this.escape; + } + ValueBinding _vb = getValueBinding("escape"); //$NON-NLS-1$ + if(_vb != null) { + Object obj = _vb.getValue(getFacesContext()); + if(obj instanceof Boolean) {// non-null + return (Boolean)obj; + } + } + return super.isEscape(); + } + + public void setEscape(boolean escape) { + this.escape = escape; + } @Override public Object saveState(FacesContext context) { diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BeanTreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BeanTreeNode.java index 6d4bcb3..83193c5 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BeanTreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/complex/BeanTreeNode.java @@ -170,4 +170,8 @@ public boolean isRendered() { public boolean isSelected() { return getBeanInstance().isSelected(); } + + public boolean isEscape() { + return getBeanInstance().isEscape(); + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNode.java index 04158a4..8938cec 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNode.java @@ -178,4 +178,13 @@ public boolean isSelected() { } return false; } + + @Override + public boolean isEscape() { + ITreeNodeDefaultValues tree = getTreeNodeDefault(); + if(tree != null) { + return tree.isNodeEscape(this); + } + return true; + } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNodeDefault.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNodeDefault.java index 00dc71a..2952940 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNodeDefault.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/AbstractTreeNodeDefault.java @@ -76,4 +76,7 @@ public boolean isNodeSelected(ITreeNode node) { return false; } + public boolean isNodeEscape(ITreeNode node) { + return true; + } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/BasicTreeNode.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/BasicTreeNode.java index 565d5e6..434e938 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/BasicTreeNode.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/BasicTreeNode.java @@ -44,6 +44,7 @@ public abstract class BasicTreeNode extends AbstractTreeNode { private Boolean expanded; private Boolean rendered; private Boolean selected; + private Boolean escape; public BasicTreeNode() { this.rendered = true; @@ -248,4 +249,16 @@ public boolean isSelected() { public void setSelected(boolean selected) { this.selected = selected; } + + @Override + public boolean isEscape() { + if(escape != null) { + return escape; + } + return super.isEscape(); + } + + public void setEscape(boolean escape) { + this.escape = escape; + } } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/TreeNodeWrapper.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/TreeNodeWrapper.java index 0283431..2bca25d 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/TreeNodeWrapper.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.controls/src/com/ibm/xsp/extlib/tree/impl/TreeNodeWrapper.java @@ -340,4 +340,17 @@ public boolean isSelected() { } return delegate.isSelected(); } + + public boolean isEscape() { + if(var != null) { + FacesContext context = FacesContext.getCurrentInstance(); + push(context); + try { + return delegate.isEscape(); + } finally { + pop(context); + } + } + return delegate.isEscape(); + } } \ No newline at end of file diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/src/com/ibm/xsp/extlib/renderkit/html_extended/mobile/MobileNavigatorRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/src/com/ibm/xsp/extlib/renderkit/html_extended/mobile/MobileNavigatorRenderer.java index e271d0e..ace63e9 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/src/com/ibm/xsp/extlib/renderkit/html_extended/mobile/MobileNavigatorRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.mobile/src/com/ibm/xsp/extlib/renderkit/html_extended/mobile/MobileNavigatorRenderer.java @@ -132,6 +132,7 @@ protected void renderEntrySeparator(FacesContext context, protected JsonJavaObject renderEntryNode(TreeContextImpl tree) throws IOException { boolean enabled = tree.getNode().isEnabled(); boolean selected = tree.getNode().isSelected(); + boolean escape = tree.getNode().isEscape(); /* * json for a menu item @@ -165,6 +166,7 @@ protected JsonJavaObject renderEntryNode(TreeContextImpl tree) throws IOExceptio jsonTreeItem.putJsonProperty("disabled", Boolean.toString(!enabled)); // $NON-NLS-1$ jsonTreeItem.putJsonProperty("iconClass", ""); // $NON-NLS-1$ $NON-NLS-2$ + jsonTreeItem.putJsonProperty("escape", Boolean.toString(escape)); // $NON-NLS-1$ // Fix for SPR#BGLN9HYDW9 - No icon image appearing for nodes // Pass in the iconImg, iconHeight & iconWidth params diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/AbstractLinkPopupRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/AbstractLinkPopupRenderer.java index ce7254e..654c3a1 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/AbstractLinkPopupRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/AbstractLinkPopupRenderer.java @@ -119,7 +119,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } writer.writeText(" ",null); // $NON-NLS-1$ diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/OneUIPlaceBarActionsRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/OneUIPlaceBarActionsRenderer.java index a291181..59a788d 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/OneUIPlaceBarActionsRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneui/layout/tree/OneUIPlaceBarActionsRenderer.java @@ -76,7 +76,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } writer.writeText(" ",null); // $NON-NLS-1$ diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3FooterLinksRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3FooterLinksRenderer.java index 23ba11d..6fc51ef 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3FooterLinksRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3FooterLinksRenderer.java @@ -52,7 +52,11 @@ public void renderChildren(FacesContext context, ResponseWriter writer, TreeCont if(!it.hasNext()) { writer.writeAttribute("class","lotusLast",null); // $NON-NLS-1$ $NON-NLS-2$ } - writer.writeText(tree.getNode().getLabel(),null); + if(tree.getNode().isEscape()) { + writer.writeText(tree.getNode().getLabel(),null); + } else { + writer.write(tree.getNode().getLabel()); + } writer.endElement("th"); // $NON-NLS-1$ tree.pop(); } diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3PlaceBarActionsRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3PlaceBarActionsRenderer.java index 059fe46..946caed 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3PlaceBarActionsRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv3/layout/tree/OneUIv3PlaceBarActionsRenderer.java @@ -64,7 +64,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } // Render the popup image (down arrow) diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv302/outline/tree/OneUIv302DropDownButtonRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv302/outline/tree/OneUIv302DropDownButtonRenderer.java index d68cac9..41019f9 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv302/outline/tree/OneUIv302DropDownButtonRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.extlib.oneui/src/com/ibm/xsp/extlib/renderkit/html_extended/oneuiv302/outline/tree/OneUIv302DropDownButtonRenderer.java @@ -103,7 +103,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } writer.writeText(" ",null); // $NON-NLS-1$ diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/AccordionRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/AccordionRenderer.java index 04ebd47..a784e41 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/AccordionRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/AccordionRenderer.java @@ -114,6 +114,7 @@ protected void renderNode(FacesContext context, ResponseWriter writer, TreeConte boolean enabled = tree.getNode().isEnabled(); String style = getItemStyle(tree,enabled,false); String styleClass = getItemStyleClass(tree,enabled,false); + boolean escape = tree.getNode().isEscape(); boolean leaf = tree.getNode().getType()==ITreeNode.NODE_LEAF; String href = null; @@ -163,7 +164,11 @@ protected void renderNode(FacesContext context, ResponseWriter writer, TreeConte } if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, null); // $NON-NLS-1$ + if(escape) { + writer.writeText(label, null); // $NON-NLS-1$ + } else { + writer.write(label); + } } writer.endElement("a"); // $NON-NLS-1$ diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/DropDownButtonRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/DropDownButtonRenderer.java index 00b65f1..b182d71 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/DropDownButtonRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/DropDownButtonRenderer.java @@ -169,7 +169,11 @@ protected void renderPopupButton(FacesContext context, ResponseWriter writer, Tr // Render the text String label = tree.getNode().getLabel(); if(StringUtil.isNotEmpty(label)) { - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } } if(popup) { diff --git a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/MenuRenderer.java b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/MenuRenderer.java index 0fbcf9f..a084c35 100644 --- a/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/MenuRenderer.java +++ b/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/src/com/ibm/xsp/theme/bootstrap/renderkit/html/extlib/outline/tree/MenuRenderer.java @@ -293,7 +293,11 @@ protected void renderEntryItemLabel(FacesContext context, ResponseWriter writer, divStyle = "padding:10px;cursor:default;"; // $NON-NLS-1$ writer.writeAttribute("style", divStyle, null); // $NON-NLS-1$ } - writer.writeText(label, "label"); // $NON-NLS-1$ + if(tree.getNode().isEscape()) { + writer.writeText(label, "label"); // $NON-NLS-1$ + } else { + writer.write(label); + } if(addDiv) { writer.endElement("div"); // $NON-NLS-1$ }