[richfaces-svn-commits] JBoss Rich Faces SVN: r910 - in trunk/richfaces/panelmenu/src/main: java/org/richfaces/component/panelmenu and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon May 28 14:48:31 EDT 2007


Author: dbiatenia
Date: 2007-05-28 14:48:31 -0400 (Mon, 28 May 2007)
New Revision: 910

Modified:
   trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
   trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
   trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
   trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
Log:


Modified: trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml	2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/config/component/panelMenu.xml	2007-05-28 18:48:31 UTC (rev 910)
@@ -415,7 +415,13 @@
 	    	<classname>java.lang.String</classname>
 	    	<description>CSS style rules to be applied</description>
 	    	<defaultvalue><![CDATA[""]]></defaultvalue>
-	    </property>
+	    </property>
+	    <property>
+	    	<name>label</name>
+	    	<classname>java.lang.String</classname>
+	    	<description>Displayed node's text</description>
+	    	<defaultvalue><![CDATA[""]]></defaultvalue>
+	    </property>
 	</component>
 
 	<component>

Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java	2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java	2007-05-28 18:48:31 UTC (rev 910)
@@ -22,14 +22,14 @@
 package org.richfaces.component.panelmenu;
 
 import javax.faces.component.ActionSource;
-import javax.faces.component.UICommand;
 import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
 import javax.faces.event.ActionListener;
+import javax.faces.event.FacesEvent;
 
-import org.richfaces.component.UISwitchablePanel;
-
 public abstract class UIPanelMenuGroup extends UIInput implements ActionSource{
 	
 	public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
@@ -76,6 +76,8 @@
 	public abstract void setOncollapse(String ongroupcollapse);
 	public abstract String getOnexpand();
 	public abstract void setOnexpand(String ongroupexpand);
+	public abstract String getLabel();
+	public abstract void setLabel(String label);
 
 	
 	public void addActionListener(ActionListener listener) {
@@ -132,6 +134,23 @@
 		values[2] = saveAttachedState(context, actionListener);
 		return values;
 	}
-	
-	
+	public void broadcast(FacesEvent event) throws AbortProcessingException {
+		// TODO Auto-generated method stub
+		super.broadcast(event);
+		if(event instanceof ActionEvent){
+            FacesContext context = getFacesContext();
+            // Notify the specified action listener method (if any)
+            MethodBinding mb = getActionListener();
+            if (mb != null) {
+                mb.invoke(context, new Object[] { event });
+            }
+
+            // Invoke the default ActionListener
+            ActionListener listener =
+              context.getApplication().getActionListener();
+            if (listener != null) {
+                listener.processAction((ActionEvent) event);
+            }
+		}
+	}
 }

Modified: trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
===================================================================
--- trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java	2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java	2007-05-28 18:48:31 UTC (rev 910)
@@ -179,4 +179,12 @@
 		return "";
 
 	}
+	
+	public void insertLabel(FacesContext context, UIComponent component) throws IOException {
+		Object label = component.getAttributes().get("label");
+		if (label!=null){
+			context.getResponseWriter().write(label.toString());
+		}
+	}
+	
 }

Modified: trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx	2007-05-28 18:13:40 UTC (rev 909)
+++ trunk/richfaces/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx	2007-05-28 18:48:31 UTC (rev 910)
@@ -48,7 +48,7 @@
 						<input type="hidden" name="panelMenuAction#{clientId}"
 								value="" >
 						</input>
-						<f:call name="insertValue"/>
+						<f:call name="insertLabel"/>
 						
 					</td>
 					<td>




More information about the richfaces-svn-commits mailing list