Author: konstantin.mishin
Date: 2009-06-03 06:43:41 -0400 (Wed, 03 Jun 2009)
New Revision: 14450
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/config/component/panelMenu.xml
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenu.java
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
branches/community/3.3.X/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
Log:
RF-7301
Modified: branches/community/3.3.X/ui/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/config/component/panelMenu.xml 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/config/component/panelMenu.xml 2009-06-03
10:43:41 UTC (rev 14450)
@@ -246,7 +246,7 @@
<description>
Space-separated list of CSS style class(es) that are be applied to disabled item of
this component
</description>
- <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["rich-pmenu-disabled-element"]]></defaultvalue>
</property>
<property>
<name>disabledItemStyle</name>
@@ -260,7 +260,7 @@
<name>disabledGroupClass</name>
<classname>java.lang.String</classname>
<description>Space-separated list of CSS style class(es) that are be applied to
disabled group of this component</description>
- <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["rich-pmenu-disabled-element"]]></defaultvalue>
</property>
<property>
<name>disabledGroupStyle</name>
@@ -272,7 +272,7 @@
<name>hoveredItemClass</name>
<classname>java.lang.String</classname>
<description> Space-separated list of CSS style class(es) that are be applied to
hovered item of this component</description>
- <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["rich-pmenu-hovered-element"]]></defaultvalue>
</property>
<property>
<name>hoveredItemStyle</name>
@@ -290,7 +290,7 @@
<name>hoveredGroupClass</name>
<classname>java.lang.String</classname>
<description> Space-separated list of CSS style class(es) that are be applied to
hovered group of this component</description>
- <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["rich-pmenu-hovered-element"]]></defaultvalue>
</property>
<property>
<name>selectedChild</name>
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenu.java
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenu.java 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenu.java 2009-06-03
10:43:41 UTC (rev 14450)
@@ -26,8 +26,7 @@
public static final String COMPONENT_TYPE = "org.richfaces.panelMenu";
- public static final String DEFAULT_SELECTED_CLASS = "dr-pmenu-selected-item";
- public static final String USER_DEFINED_SELECTED_CLASS =
"rich-pmenu-selected-element";
+ public static final String SELECTED_CLASS = "rich-pmenu-selected-element";
public abstract String getEvent();
public abstract void setEvent(String event);
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2009-06-03
10:43:41 UTC (rev 14450)
@@ -250,12 +250,7 @@
public String getSelectedClass(FacesContext context, UIComponent component) {
if (isSelected(context, component)) {
- StringBuffer selectedClass = null;
- selectedClass= new StringBuffer();
- selectedClass.append(UIPanelMenu.DEFAULT_SELECTED_CLASS).
- append(" ").
- append(UIPanelMenu.USER_DEFINED_SELECTED_CLASS);
- return selectedClass.toString();
+ return UIPanelMenu.SELECTED_CLASS;
}
return "";
}
@@ -299,16 +294,14 @@
public String getDivClass(FacesContext context, UIComponent component) {
String result = "";
if (isTopLevel(component))
- result = "dr-pmenu-top-group-div rich-pmenu-top-group-div";
+ result = "rich-pmenu-top-group-div";
return result;
}
public String getTableClass(FacesContext context, UIComponent component) {
- String result;
+ String result = "";
if (isTopLevel(component))
- result = "dr-pmenu-top-group rich-pmenu-top-group ";
- else
- result = "dr-pmenu-group";
+ result = "rich-pmenu-top-group ";
return result;
}
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2009-06-03
10:43:41 UTC (rev 14450)
@@ -207,12 +207,7 @@
public String getSelectedClass(FacesContext context, UIComponent component) {
if (isSelected(context, component)) {
- StringBuffer selectedClass = null;
- selectedClass= new StringBuffer();
- selectedClass.append(UIPanelMenu.DEFAULT_SELECTED_CLASS).
- append(" ").
- append(UIPanelMenu.USER_DEFINED_SELECTED_CLASS);
- return selectedClass.toString();
+ return UIPanelMenu.SELECTED_CLASS;
}
return "";
}
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss 2009-06-03
10:43:41 UTC (rev 14450)
@@ -10,7 +10,7 @@
padding-right: 4px;
}
- .dr-pmenu-top-group {
+ .rich-pmenu-top-group {
height: 20px;
background-repeat: repeat-x;
@@ -19,14 +19,14 @@
cursor: pointer;
}
- .dr-pmenu-group {
+ .rich-pmenu-group {
padding: 2px 1px 1px;
margin-top:1px;
cursor:pointer;
border-top: 1px solid;
}
- .dr-pmenu-item {
+ .rich-pmenu-item {
border-top: 1px solid;
cursor: pointer;
padding: 2px 1px 1px;
@@ -34,7 +34,7 @@
}
- .dr-pmenu-top-group-div {
+ .rich-pmenu-top-group-div {
border: 1px solid;
margin-bottom: 3px;
padding: 1px;
@@ -42,18 +42,18 @@
width: 100%;
}
- .dr-pmenu-group-self-label {
+ .rich-pmenu-group-self-label {
padding-left: 5px;
width: 100%;
}
- .dr-pmenu-nowrap {
+ .rich-pmenu-nowrap {
white-space: nowrap;
}
</f:verbatim>
- <u:selector name=".dr-pmenu-top-group">
+ <u:selector name=".rich-pmenu-top-group">
<u:style name="font-weight" skin="headerWeightFont"/>
<u:style name="font-family" skin="generalFamilyFont"/>
<u:style name="font-size" skin="headerSizeFont"/>
@@ -64,7 +64,7 @@
</u:style>
</u:selector>
- <u:selector name=".dr-pmenu-group">
+ <u:selector name=".rich-pmenu-group">
<u:style name="font-weight" skin="headerWeightFont"/>
<u:style name="font-family" skin="headerFamilyFont"/>
<u:style name="font-size" skin="headerSizeFont"/>
@@ -72,7 +72,7 @@
<u:style name="border-top-color" skin="tableBorderColor"/>
</u:selector>
- <u:selector name=".dr-pmenu-item">
+ <u:selector name=".rich-pmenu-item">
<u:style name="font-family" skin="generalFamilyFont"/>
<u:style name="font-weight" skin="generalWeightFont"/>
<u:style name="font-size" skin="generalSizeFont"/>
@@ -80,23 +80,23 @@
<u:style name="border-top-color" skin="tableBorderColor"/>
</u:selector>
- <u:selector name=".dr-pmenu-top-group-div" >
+ <u:selector name=".rich-pmenu-top-group-div" >
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
- <u:selector name=".dr-pmenu-disabled-element" >
+ <u:selector name=".rich-pmenu-disabled-element" >
<u:style name="color" skin="tabDisabledTextColor"/>
</u:selector>
- <u:selector name=".dr-pmenu-hovered-element" >
+ <u:selector name=".rich-pmenu-hovered-element" >
<u:style name="background-color"
skin="additionalBackgroundColor"/>
</u:selector>
<f:verbatim>
- .dr-pmenu-disabled-element {
+ .rich-pmenu-disabled-element {
cursor: default;
}
- .dr-pmenu-selected-item {
+ .rich-pmenu-selected-element {
font-style : italic;
}
</f:verbatim>
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2009-06-03
10:43:41 UTC (rev 14450)
@@ -18,8 +18,7 @@
this.expandSingle = so;
this.lastExpanded = null;
this.selectedChild = selectedChild;
- this.defaultSelectedClass = 'dr-pmenu-selected-item';
- this.userDefinedSelectedClass = 'rich-pmenu-selected-element';
+ this.selectedClass = 'rich-pmenu-selected-element';
this.is = 'panelMenu';
this.selectedNameInput = $(myId + 'selectedItemName');
PanelMenuStorage[myId] = this;
@@ -133,7 +132,7 @@
this.leftIcon = Richfaces.lastDescendant(mainCells[0]);
this.labelArea = mainCells[1];
this.rightIcon = Richfaces.firstDescendant(mainCells[2]);
- this.content = this.tdhider.select(".dr-pmenu-group-self-label")[0];
+ this.content = this.tdhider.select(".rich-pmenu-group-self-label")[0];
this.iconAlign = iconAlign;
/*
@@ -400,12 +399,10 @@
setSelectedClass: function(e){
- this.mainRow.addClassName(this.rootMenu.defaultSelectedClass);
- this.mainRow.addClassName(this.rootMenu.userDefinedSelectedClass);
+ this.mainRow.addClassName(this.rootMenu.selectedClass);
},
removeSelectedClass: function(e){
- this.mainRow.removeClassName(this.rootMenu.defaultSelectedClass);
- this.mainRow.removeClassName(this.rootMenu.userDefinedSelectedClass);
+ this.mainRow.removeClassName(this.rootMenu.selectedClass);
},
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2009-06-03
10:43:41 UTC (rev 14450)
@@ -29,13 +29,13 @@
<tbody>
<tr id="row_#{clientId}"
class="#{this:getSelectedClass( context, component )}" >
- <td class="dr-pmenu-nowrap #{this:getIconClass( context,
component,'left')}">
+ <td class="rich-pmenu-nowrap #{this:getIconClass( context,
component,'left')}">
<f:call name="insertSpacerImages" />
<f:call name="insertImage">
<f:parameter value="left" />
</f:call>
</td>
- <td style="width:100%" id="icon#{clientId}"
class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}"
>
+ <td style="width:100%" id="icon#{clientId}"
class="rich-pmenu-group-self-label #{this:getLabelClass( context, component )}"
>
<input type="hidden" name="panelMenuState#{clientId}"
value="#{isNodeOpened}" />
Modified:
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2009-06-03
10:43:41 UTC (rev 14450)
@@ -16,19 +16,19 @@
<div id="#{clientId}" style="#{this:getHideStyle(context,
component)}" >
<table cellspacing="0" cellpadding="0" border="0"
id="tablehide#{clientId}"
- class="dr-pmenu-item rich-pmenu-item #{this:getFullStyleClass( context,
component )} "
+ class="rich-pmenu-item #{this:getFullStyleClass( context, component )} "
style="#{this:getFullStyle( context, component )}"
x:passThruWithExclusions="cellspacing,cellpadding,border,id,class,styleClass,style">
<tbody>
<tr id="row_#{clientId}"
class="#{this:getSelectedClass( context, component )}" >
- <td class="dr-pmenu-nowrap #{this:getIconClass( context,
component,'left')}">
+ <td class="rich-pmenu-nowrap #{this:getIconClass( context,
component,'left')}">
<f:call name="insertSpacerImages" />
<f:call name="insertImage">
<f:parameter value="left" />
</f:call>
</td>
- <td style="width:100%" id="icon#{clientId}"
class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}"
>
+ <td style="width:100%" id="icon#{clientId}"
class="rich-pmenu-group-self-label #{this:getLabelClass( context, component )}"
>
<input type="hidden" name="panelMenuAction#{clientId}"
value=""/>
<f:call name="insertLabel"/>
<vcp:body>
Modified:
branches/community/3.3.X/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
===================================================================
---
branches/community/3.3.X/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2009-06-03
08:38:47 UTC (rev 14449)
+++
branches/community/3.3.X/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2009-06-03
10:43:41 UTC (rev 14450)
@@ -199,17 +199,16 @@
assertEquals("div", firstGroupDiv.getNodeName());
String styleClass = firstGroupDiv.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-top-group-div"));
+ assertTrue(styleClass.contains("rich-pmenu-top-group-div"));
HtmlElement firstGroupHide = page.getHtmlElementById("tablehide" +
group1.getClientId(facesContext));
assertNotNull(firstGroupHide);
assertEquals("table", firstGroupHide.getNodeName());
styleClass = firstGroupHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-top-group"));
+ assertTrue(styleClass.contains("rich-pmenu-top-group"));
assertTrue(styleClass.contains("rich-pmenu-group"));
assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
- assertTrue(styleClass.contains("dr-pmenu-disabled-element"));
HtmlElement subGroupDiv =
page.getHtmlElementById(group3.getClientId(facesContext));
assertNotNull(subGroupDiv);
@@ -220,7 +219,6 @@
assertEquals("table", subGroupHide.getNodeName());
styleClass = subGroupHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-group"));
assertTrue(styleClass.contains("rich-pmenu-group"));
HtmlElement leftIcon = page.getHtmlElementById("leftIcon" +
group1.getClientId(facesContext));
@@ -236,7 +234,6 @@
assertEquals("table", firstItemHide.getNodeName());
styleClass = firstItemHide.getAttributeValue("class");
- assertTrue(styleClass.contains("dr-pmenu-item"));
assertTrue(styleClass.contains("rich-pmenu-item"));
leftIcon = page.getHtmlElementById("leftIcon" +
item1.getClientId(facesContext));