Author: ezheleznyakov
Date: 2007-10-12 09:31:08 -0400 (Fri, 12 Oct 2007)
New Revision: 4159
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
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-847
Create templates for <rich:panelMenu/>, <rich:panelMenuGroup/> and
<rich:panelMenuItem> components.
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-12
13:25:12 UTC (rev 4158)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2007-10-12
13:31:08 UTC (rev 4159)
@@ -68,8 +68,12 @@
return true;
}
- public static VpeCreationData encode(VpePageContext pageContext, VpeCreationData
creationData, Element sourceElement, Document visualDocument, Element parentVisualElement,
boolean expanded, int activeChildId) {
+ public static VpeCreationData encode(VpePageContext pageContext, VpeCreationData
creationData, Element sourceParentElement, Element sourceElement, Document
visualDocument, Element parentVisualElement, boolean expanded, int activeChildId) {
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, NAME_COMPONENT);
+
+ if(expanded == true) {
+ activeChildId = -1;
+ }
Element div = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
parentVisualElement.appendChild(div);
@@ -93,9 +97,9 @@
} else {
if (expanded) {
if (child.getNodeName().endsWith(PANEL_MENU_GROUP_END_TAG)) {
- RichFacesPanelMenuGroupTemplate.encode(pageContext, creationData, (Element) child,
visualDocument, div, true, -1);
+ RichFacesPanelMenuGroupTemplate.encode(pageContext, creationData,
sourceParentElement, (Element) child, visualDocument, div, true, -1);
} else {
- RichFacesPanelMenuItemTemplate.encode(pageContext, creationData, (Element) child,
visualDocument, div, false);
+ RichFacesPanelMenuItemTemplate.encode(pageContext, creationData,
sourceParentElement, (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-12
13:25:12 UTC (rev 4158)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2007-10-12
13:31:08 UTC (rev 4159)
@@ -60,7 +60,7 @@
}
public static VpeCreationData encode(VpePageContext pageContext,
- VpeCreationData creationData, Element sourceElement,
+ VpeCreationData creationData, Element sourceParentElement, Element sourceElement,
Document visualDocument, Element parentVisualElement, boolean active) {
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, PANEL_MENU_ITEM);
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-12
13:25:12 UTC (rev 4158)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuTemplate.java 2007-10-12
13:31:08 UTC (rev 4159)
@@ -37,6 +37,7 @@
private static final String WIDTH_ATTR_PANELMENU = "width";
private static final String STYLE_ATTR_PANELMENU = "style";
+
// private static final String DISABLED_ATTR_PANELMENU = "disabled";
// private static final String EXPANDSINGLE_ATTR_PANELMENU = "expandSingle";
private static final String STYLECLASS_ATTR_PANELMENU = "styleClass";
@@ -88,17 +89,17 @@
for (Node child : children) {
- boolean expanded = true; // (i == activeId);
+ boolean expanded = (i == activeId);
if (child.getNodeName().endsWith(PANEL_MENU_GROUP_END)) {
RichFacesPanelMenuGroupTemplate.encode(pageContext,
- vpeCreationData, (Element) child, visualDocument, div,
- expanded, i);
+ vpeCreationData, sourceElement, (Element) child,
+ visualDocument, div, expanded, i);
i++;
} else if (child.getNodeName().endsWith(PANEL_MENU_ITEM_END)) {
RichFacesPanelMenuItemTemplate.encode(pageContext,
- vpeCreationData, (Element) child, visualDocument, div,
- expanded);
+ vpeCreationData, sourceElement, (Element) child,
+ visualDocument, div, expanded);
} else {
Element childDiv = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_DIV);
@@ -126,9 +127,6 @@
activeId = -1;
}
- if (activeId == -1)
- activeId = 0;
-
int count = getChildrenCount(children);
if (count - 1 < activeId) {
activeId = count - 1;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-10-12
13:25:12 UTC (rev 4158)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-10-12
13:31:08 UTC (rev 4159)
@@ -644,20 +644,13 @@
<vpe:tag name="rich:panelMenu" case-sensitive="yes">
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPanelMenuTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="stylwe.height" />
+ </vpe:resize>
<vpe:drag start-enable="yes"/>
<vpe:drop container="yes"/>
</vpe:template>
- <vpe:resize>
- <vpe:width width-attr="width" />
- <vpe:height height-attr="height" />
- </vpe:resize>
- <vpe:dnd>
- <vpe:drag start-enable="yes" />
- <vpe:drop container="yes">
- <vpe:container-child tag-name="panelMenuGroup"/>
- <vpe:container-child tag-name="panelMenuItem"/>
- </vpe:drop>
- </vpe:dnd>
</vpe:tag>
</vpe:templates>
\ No newline at end of file