Author: sergeyhalipov
Date: 2007-05-15 13:47:46 -0400 (Tue, 15 May 2007)
New Revision: 769
Modified:
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
Log:
Initial commit for panel menu component.
Modified:
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
===================================================================
---
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-05-15
17:33:33 UTC (rev 768)
+++
trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-05-15
17:47:46 UTC (rev 769)
@@ -268,24 +268,25 @@
if
(!iconNodeClosed.equals("")&&!iconNodeOpened.equals("")){
if
(!iconNodeClosed.equals("custom")&&!iconNodeOpened.equals("custom")){
if(component.getAttributes().get("iconOpened").equals("")&&component.getAttributes().get("iconClosed").equals("")){
- buffer.append(","+'"'+
(sourceIconNodeOpened.equals("")?customIconOpenedSource:sourceIconNodeOpened) +
'"').append(","+'"'+(sourceIconNodeClosed.equals("")?customIconClosedSource:sourceIconNodeClosed)+'"'+");");
+ buffer.append(","+'"'+
(sourceIconNodeOpened.equals("")?customIconOpenedSource:sourceIconNodeOpened) +
'"').append(","+'"'+(sourceIconNodeClosed.equals("")?customIconClosedSource:sourceIconNodeClosed)+'"'+";");
} else
if(component.getAttributes().get("iconOpened").equals("")){
- buffer.append(","+'"'+customIconClosedSource+'"').append(","+'"'+customIconClosedSource+'"'+");");
+ buffer.append(","+'"'+customIconClosedSource+'"').append(","+'"'+customIconClosedSource+'"'+";");
} else if
(component.getAttributes().get("iconClosed").equals("")) {
- buffer.append(","+'"'+customIconOpenedSource+'"').append(","+'"'+customIconOpenedSource+'"'+");");
+ buffer.append(","+'"'+customIconOpenedSource+'"').append(","+'"'+customIconOpenedSource+'"'+";");
} else {
- buffer.append(","+'"'+customIconOpenedSource+'"').append(","+'"'+customIconClosedSource+'"'+");");
+ buffer.append(","+'"'+customIconOpenedSource+'"').append(","+'"'+customIconClosedSource+'"'+";");
}
} else if (iconNodeClosed.equals("custom")){
- buffer.append(",\"" + (customIconOpened.equals("")?
sourceIconNodeOpened : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
PANEL_MENU_SPACER_ICON : customIconClosedSource)+"\");");
+ buffer.append(",\"" + (customIconOpened.equals("")?
sourceIconNodeOpened : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
PANEL_MENU_SPACER_ICON : customIconClosedSource)+"\";");
} else if (iconNodeOpened.equals("custom")){
- buffer.append(",\"" + (customIconOpened.equals("")?
PANEL_MENU_SPACER_ICON : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
sourceIconNodeClosed : customIconClosedSource)+"\");");
+ buffer.append(",\"" + (customIconOpened.equals("")?
PANEL_MENU_SPACER_ICON : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
sourceIconNodeClosed : customIconClosedSource)+"\";");
} else{
- buffer.append(",\"" + (customIconOpened.equals("")?
PANEL_MENU_SPACER_ICON : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
PANEL_MENU_SPACER_ICON : customIconClosedSource)+"\");");
+ buffer.append(",\"" + (customIconOpened.equals("")?
PANEL_MENU_SPACER_ICON : customIconOpenedSource) +
'"').append(",\"" + (customIconClosed.equals("")?
PANEL_MENU_SPACER_ICON : customIconClosedSource)+"\";");
}
} else {
- buffer.append(");");
+ buffer.append(",null, null");
}
+ buffer.append(",\"" + PANEL_MENU_SPACER_ICON + "\");");
} else {
if (!iconItem.equals("")){
if (!iconItem.equals("custom")){
Modified:
trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-05-15
17:33:33 UTC (rev 768)
+++
trunk/richfaces/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-05-15
17:47:46 UTC (rev 769)
@@ -17,7 +17,7 @@
PanelMenuStorage[myId] = this;}};
PanelMenuItem = Class.create();
PanelMenuItem.prototype = {
- initialize: function(ids, options, level, haveDynamicIcon, action, opened, iconAlign,
iconExpanded, iconCollapsed){
+ initialize: function(ids, options, level, haveDynamicIcon, action, opened, iconAlign,
iconExpanded, iconCollapsed, iconSpacer){
if (!ids.parentId){return};
this.type = options.type;
this.onopen = options.onopen;
@@ -42,6 +42,7 @@
}
this.iconCollapsed = iconCollapsed;
this.iconExpanded = iconExpanded;
+ this.iconSpacer = iconSpacer;
if(action){
this.action = action;
}
@@ -87,7 +88,7 @@
if (this.iconCollapsed!=null) {
img.src = this.iconCollapsed;
} else {
- img.src = "images/panelMenuSpacer.png";
+ img.src = this.iconSpacer;
}
}
}
@@ -120,7 +121,7 @@
if (this.iconExpanded!=null) {
img.src = this.iconExpanded;
} else {
- img.src = "images/panelMenuSpacer.png";}}}}
+ img.src = this.iconSpacer;}}}}
for (var i = 0; i < this.childObj.length; i++){
this.childObj[i].show();
}