Author: sergeyhalipov
Date: 2008-04-22 14:28:57 -0400 (Tue, 22 Apr 2008)
New Revision: 8080
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-3022
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
---
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-04-22
17:47:08 UTC (rev 8079)
+++
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-04-22
18:28:57 UTC (rev 8080)
@@ -21,10 +21,14 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIContextMenu;
import org.richfaces.component.UIMenuGroup;
@@ -114,4 +118,19 @@
protected InternetResource[] getStyles() {
return super.getStyles();
}
+
+ protected void processLayerStyles(FacesContext context, UIComponent layer,
ResponseWriter writer) throws IOException {
+ Object style = layer.getAttributes().get(HTML.style_ATTRIBUTE);
+ Object styleClass = layer.getAttributes().get(HTML.STYLE_CLASS_ATTR);
+
+ if (null == style) {
+ style = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border
rich-menu-list-border " + styleClass, null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " +
style, null);
+ }
}
Modified:
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
---
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-04-22
17:47:08 UTC (rev 8079)
+++
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-04-22
18:28:57 UTC (rev 8080)
@@ -25,8 +25,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDropDownMenu;
import org.richfaces.component.UIMenuGroup;
import org.richfaces.renderkit.ScriptOptions;
@@ -113,4 +115,9 @@
super.encodeChildren(context, component);
}
+ protected void processLayerStyles(FacesContext context, UIComponent layer,
ResponseWriter writer) throws IOException {
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border
rich-menu-list-border", null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2;",
null);
+ }
+
}
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
---
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-04-22
17:47:08 UTC (rev 8079)
+++
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-04-22
18:28:57 UTC (rev 8080)
@@ -143,21 +143,10 @@
public void processLayer(FacesContext context, UIComponent layer, String width) throws
IOException {
String clientId = layer.getClientId(context);
- Object style = layer.getAttributes().get(HTML.style_ATTRIBUTE);
- Object styleClass = layer.getAttributes().get(HTML.STYLE_CLASS_ATTR);
-
- if (null == style) {
- style = "";
- }
- if (null == styleClass) {
- styleClass = "";
- }
-
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId+"_menu", null);
- writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border
rich-menu-list-border " + styleClass, null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " +
style, null);
+ processLayerStyles(context, layer, writer);
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-bg
rich-menu-list-bg", null);
encodeItems(context, layer);
@@ -210,5 +199,7 @@
}
}
}
+
+ protected abstract void processLayerStyles(FacesContext context, UIComponent layer,
ResponseWriter writer) throws IOException;
}