Author: dbiatenia
Date: 2007-06-11 13:35:08 -0400 (Mon, 11 Jun 2007)
New Revision: 1126
Modified:
trunk/sandbox/panelmenu/src/main/config/component/panelMenu.xml
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenu.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
Log:
itemHover&standart attributes added to PanelMenu
Modified: trunk/sandbox/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/sandbox/panelmenu/src/main/config/component/panelMenu.xml 2007-06-11 17:20:51
UTC (rev 1125)
+++ trunk/sandbox/panelmenu/src/main/config/component/panelMenu.xml 2007-06-11 17:35:08
UTC (rev 1126)
@@ -123,25 +123,25 @@
<name>iconItemPosition</name>
<classname>java.lang.String</classname>
<description>Position of the icon (left, right none (default) ) for the item
icon</description>
- <defaultvalue><![CDATA["none"]]></defaultvalue>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
</property>
<property>
<name>iconItemTopPosition</name>
<classname>java.lang.String</classname>
<description>Position of the icon (left, right none (default) ) for the top
item icon</description>
- <defaultvalue><![CDATA["none"]]></defaultvalue>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
</property>
<property>
<name>iconGroupPosition</name>
<classname>java.lang.String</classname>
<description>Position of the icon (left, right none (default) ) for the group
icon</description>
- <defaultvalue><![CDATA["none"]]></defaultvalue>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
</property>
<property>
<name>iconGroupTopPosition</name>
<classname>java.lang.String</classname>
<description>Position of the icon (left, right none (default) ) for the top
group icon</description>
- <defaultvalue><![CDATA["none"]]></defaultvalue>
+ <defaultvalue><![CDATA["left"]]></defaultvalue>
</property>
<property>
<name>style</name>
@@ -207,7 +207,7 @@
<name>disabledItemClass</name>
<classname>java.lang.String</classname>
<description></description>
-
<defaultvalue><![CDATA["dr-pmenu-disabled-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
</property>
<property>
<name>disabledItemStyle</name>
@@ -219,7 +219,7 @@
<name>disabledGroupClass</name>
<classname>java.lang.String</classname>
<description></description>
-
<defaultvalue><![CDATA["dr-pmenu-disabled-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["dr-pmenu-disabled-element
rich-pmenu-disabled-element"]]></defaultvalue>
</property>
<property>
<name>disabledGroupStyle</name>
@@ -231,7 +231,7 @@
<name>hoveredItemClass</name>
<classname>java.lang.String</classname>
<description></description>
-
<defaultvalue><![CDATA["dr-pmenu-hovered-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
</property>
<property>
<name>hoveredItemStyle</name>
@@ -249,10 +249,44 @@
<name>hoveredGroupClass</name>
<classname>java.lang.String</classname>
<description></description>
-
<defaultvalue><![CDATA["dr-pmenu-hovered-element"]]></defaultvalue>
+ <defaultvalue><![CDATA["dr-pmenu-hovered-element
rich-pmenu-hovered-element"]]></defaultvalue>
</property>
&ui_component_attributes;
- &html_events;
+ &html_events;
+
+ <property>
+ <name>onclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>ondblclick</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseout</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmousemove</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>onmouseover</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+
+
+
<property>
<name>onitemhover</name>
<classname>java.lang.String</classname>
@@ -275,7 +309,7 @@
<name>disabled</name>
<classname>boolean</classname>
<description>
- If “true” sets state of the item to disabled state. “false” is default.
+ If true sets state of the item to disabled state. false is default.
</description>
<defaultvalue>false</defaultvalue>
</property>
Modified:
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenu.java
===================================================================
---
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenu.java 2007-06-11
17:20:51 UTC (rev 1125)
+++
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenu.java 2007-06-11
17:35:08 UTC (rev 1126)
@@ -89,4 +89,21 @@
public abstract boolean isDisabled();
public abstract void setDisabled(boolean disabled);
+ public abstract void setOnclick(String string);
+ public abstract String getOnclick();
+
+ public abstract void setOndblclick(String string);
+ public abstract String getOndblclick();
+
+ public abstract void setOnmouseout(String string);
+ public abstract String getOnmouseout();
+
+ public abstract void setOnmousemove(String string);
+ public abstract String getOnmousemove();
+
+ public abstract void setOnmouseover(String string);
+ public abstract String getOnmouseover();
+
+
+
}
Modified:
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
===================================================================
---
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-06-11
17:20:51 UTC (rev 1125)
+++
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-06-11
17:35:08 UTC (rev 1126)
@@ -162,6 +162,8 @@
addAjaxFunction(context,child,buffer);
+ addOnItemHover(parentMenu.getOnitemhover(), child, buffer);
+
String iconPos = "left";
boolean isTopLevel = isTopLevel(child);
if(child instanceof UIPanelMenuGroup){
@@ -423,4 +425,12 @@
buffer.append("\"");
}
+ protected void addOnItemHover(String menuOnItemHover, UIComponent child, StringBuffer
buffer) {
+ buffer.append(",\"");
+ if(child instanceof UIPanelMenuItem){
+ if(menuOnItemHover != null && !menuOnItemHover.equals(""))
buffer.append(menuOnItemHover);
+ }
+ buffer.append("\"");
+ }
+
}
Modified:
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-11
17:20:51 UTC (rev 1125)
+++
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-11
17:35:08 UTC (rev 1126)
@@ -24,7 +24,7 @@
PanelMenuItem = Class.create();
PanelMenuItem.prototype = {
- initialize: function(ids, options, hoveredStyles, hoveredClasses, level,
haveDynamicIcon, action, opened, ajaxFunction, iconAlign, iconExpanded, iconCollapsed,
iconSpacer){
+ initialize: function(ids, options, hoveredStyles, hoveredClasses, level,
haveDynamicIcon, action, opened, ajaxFunction, onItemHover, iconAlign, iconExpanded,
iconCollapsed, iconSpacer){
if (!ids.parentId){return};
this.type = options.type;
this.onopen = options.onopen;
@@ -37,6 +37,7 @@
this.mode = ("node" == this.type) ? "none" : "server";
this.ajaxSubmit = ajaxFunction;
+ this.onItemHover = onItemHover;
this.target = options.target;
this.hoveredStyles = hoveredStyles;
@@ -336,6 +337,12 @@
}
},
+ hoverItem: function (e){
+ if(this.onItemHover != ""){
+ eval(this.onItemHover);
+ }
+ },
+
_attachBehaviors: function() {
if (!this.disabled) {
if (this.event)
@@ -343,6 +350,8 @@
else
Event.observe(this.obj, "click",
this.itemClicked.bindAsEventListener(this), false);
+ Event.observe(this.obj, "mouseover",
this.hoverItem.bindAsEventListener(this), false);
+
Event.observe(this.obj, "mouseover",
this.addHoverStyles.bindAsEventListener(this), false);
Event.observe(this.obj, "mouseout",
this.removeHoverStyles.bindAsEventListener(this), false);
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-11
17:20:51 UTC (rev 1125)
+++ trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-11
17:35:08 UTC (rev 1126)
@@ -26,7 +26,12 @@
<f:call name="utils.encodeBeginFormIfNessesary"/>
<table cellpadding="0" cellspacing="0"
style="#{component.style};" class="#{component.styleClass}"
- id="#{clientId}" width="#{component.width}" >
+ id="#{clientId}" width="#{component.width}"
+ onclick="#{component.onclick}"
+ ondblclick="#{component.ondblclick}"
+ onmousemove="#{component.onmousemove}"
+ onmouseout="#{component.onmouseout}"
+ onmouseover="#{component.onmouseover}">
<tbody>
<vcp:body>