Author: asakharov
Date: 2007-10-11 08:43:44 -0400 (Thu, 11 Oct 2007)
New Revision: 4115
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-11
12:15:27 UTC (rev 4114)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-11
12:43:44 UTC (rev 4115)
@@ -31,10 +31,17 @@
private static final String ICON_HSPACE = "0";
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document
visualDocument) {
- return new
VpeCreationData(visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV));
- }
+ private static final String EMPTY_DIV_STYLE = "display: none;";
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ Document visualDocument) {
+ Element div = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, EMPTY_DIV_STYLE);
+
+ return new VpeCreationData(div);
+ }
+
public static VpeCreationData encode(VpePageContext pageContext, VpeCreationData
creationData, Element sourceElement, Document visualDocument, Element parentVisualElement,
boolean expanded) {
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "panelMenuGroup");
@@ -54,7 +61,7 @@
childInfo.addSourceChild(child);
} else {
if(child.getNodeName().endsWith(":panelMenuGroup")) {
- RichFacesPanelMenuGroupTemplate.encode(pageContext, creationData, (Element)child,
visualDocument, div, false);
+ RichFacesPanelMenuGroupTemplate.encode(pageContext, creationData, (Element)child,
visualDocument, div, true);
}
if(child.getNodeName().endsWith(":panelMenuItem")){
RichFacesPanelMenuItemTemplate.encode(pageContext, creationData, (Element)child,
visualDocument, div, false);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-11
12:15:27 UTC (rev 4114)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-11
12:43:44 UTC (rev 4115)
@@ -44,11 +44,15 @@
private static final String IMG_SPACER_SRC = "/panelMenuItem/spacer.gif";
- //private static final String EMPTY_DIV_STYLE = "display: none;";
+ private static final String EMPTY_DIV_STYLE = "display: none;";
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
Document visualDocument) {
- return encode(pageContext, null,(Element)sourceNode, visualDocument, null, false);
+ Element div = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, EMPTY_DIV_STYLE);
+
+ return new VpeCreationData(div);
}
public static VpeCreationData encode(VpePageContext pageContext,VpeCreationData
creationData, Element sourceElement, Document visualDocument, Element parentVisualElement,
boolean active){
@@ -57,7 +61,7 @@
Element div = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- //div.setAttribute("style", EMPTY_DIV_STYLE);
+ parentVisualElement.appendChild(div);
div.setAttribute("vpeSupport", PANEL_MENU_ITEM);
creationData = new VpeCreationData(div);
if (sourceElement.getParentNode().getNodeName().endsWith(
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2007-10-11
12:15:27 UTC (rev 4114)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2007-10-11
12:43:44 UTC (rev 4115)
@@ -83,7 +83,8 @@
div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
}
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
+ //VpeChildrenInfo childrenInfo = new VpeChildrenInfo(div);
+ // vpeCreationData.addChildrenInfo(childrenInfo);
List<Node> children = ComponentUtil.getChildren(sourceElement);
int activeId = getActiveId(sourceElement, children);
int i = 0;
@@ -100,20 +101,15 @@
RichFacesPanelMenuItemTemplate.encode(pageContext,
vpeCreationData, (Element) child, visualDocument, div,
active);
- }
- if (child.getNodeName().endsWith(":panelMenuGroup")) {
- RichFacesPanelMenuGroupTemplate.encode(pageContext,
- vpeCreationData, (Element) child, visualDocument, div,
- active);
- } else if (child.getNodeName().endsWith(":panelMenuItem")) {
- RichFacesPanelMenuItemTemplate.encode(pageContext,
- vpeCreationData, (Element) child, visualDocument, div,
- active);
} else {
+ Element childDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(childDiv);
+ div.appendChild(childDiv);
childrenInfo.addSourceChild(child);
+ vpeCreationData.addChildrenInfo(childrenInfo);
}
i++;
- }
+ }
return vpeCreationData;
}