Author: nbelaevski
Date: 2011-01-24 20:09:50 -0500 (Mon, 24 Jan 2011)
New Revision: 21189
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10158
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-01-25
00:26:19 UTC (rev 21188)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2011-01-25
01:09:50 UTC (rev 21189)
@@ -119,7 +119,8 @@
writer.startElement(DIV_ELEM, null);
writer.writeAttribute(ID_ATTRIBUTE, menuGroup.getClientId(context) +
":hdr", null);
writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(getCssClass(menuGroup,
"-hdr"),
- "rf-pm-hdr-" + (menuGroup.isExpanded() ? "exp" :
"colps")), null);
+ "rf-pm-hdr-" + (menuGroup.isExpanded() ? "exp" :
"colps"),
+ menuGroup.isDisabled() ? getCssClass(menuGroup, "-hdr-dis") :
null), null);
(menuGroup.isTopItem() ? topHeaderRenderer : headerRenderer).encodeHeader(writer,
context, menuGroup);
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java 2011-01-25
00:26:19 UTC (rev 21188)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconBasic.java 2011-01-25
01:09:50 UTC (rev 21189)
@@ -21,12 +21,6 @@
package org.richfaces.renderkit.html.iconimages;
-import org.richfaces.resource.AbstractJava2DUserResource;
-import org.richfaces.resource.StateHolderResource;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-import javax.faces.context.FacesContext;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
@@ -35,18 +29,22 @@
import java.io.DataOutput;
import java.io.IOException;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.AbstractJava2DUserResource;
+import org.richfaces.resource.PostConstructResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
/**
* @author Alex.Kolonitsky
*/
public abstract class PanelMenuIconBasic extends AbstractJava2DUserResource implements
StateHolderResource {
- private static final String TOP_BULLET_COLOR = Skin.HEADER_TEXT_COLOR;
- private static final String ORDINAL_BULLET_COLOR = Skin.HEADER_BACKGROUND_COLOR;
private static final Dimension DIMENSION = new Dimension(16, 16);
private Color color;
- private Color topBulletColor;
- private Color ordinalBulletColor;
protected PanelMenuIconBasic() {
super(DIMENSION);
@@ -72,17 +70,19 @@
return false;
}
- public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ @PostConstructResource
+ public void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
Skin skin = SkinFactory.getInstance(context).getSkin(context);
- dataOutput.writeInt(skin.getColorParameter(context, Skin.SELECT_CONTROL_COLOR));
- dataOutput.writeInt(skin.getColorParameter(context, TOP_BULLET_COLOR));
- dataOutput.writeInt(skin.getColorParameter(context, ORDINAL_BULLET_COLOR));
+ color = new Color(skin.getColorParameter(context,
"tabDisabledTextColor"));
}
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ dataOutput.writeInt(color.getRGB());
+ }
public void readState(FacesContext context, DataInput dataInput) throws IOException
{
color = new Color(dataInput.readInt());
- topBulletColor = new Color(dataInput.readInt());
- ordinalBulletColor = new Color(dataInput.readInt());
}
}
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-01-25
00:26:19 UTC (rev 21188)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-01-25
01:09:50 UTC (rev 21189)
@@ -62,10 +62,6 @@
margin: 0px 3px;
}
-.rf-pm-itm-dis {
- color: #BED6F8;
-}
-
.rf-pm-itm-hov {
background-color: '#{richSkin.additionalBackgroundColor}';
}
@@ -81,10 +77,6 @@
border-top-color: '#{richSkin.panelBorderColor}';
}
-.rf-pm-gr-dis {
- color: #BED6F8;
-}
-
.rf-pm-gr-hov {
background: '#{richSkin.additionalBackgroundColor}';
@@ -175,10 +167,6 @@
margin: 0px 3px;
}
-.rf-pm-top-itm-dis {
- color: #BED6F8;
-}
-
.rf-pm-top-itm-hov {
background-color:#ffd700;
}
@@ -195,10 +183,6 @@
margin-bottom: 3px
}
-.rf-pm-top-gr-dis {
- color: #BED6F8;
-}
-
.rf-pm-top-gr-hov {
background-color: green;
color: white; /*TODO skin?*/
@@ -226,6 +210,11 @@
font-weight: bold;
}
+.rf-pm-top-gr-hdr-dis, .rf-pm-gr-hdr-dis, .rf-pm-itm-dis, .rf-pm-top-itm-dis {
+ color: '#{richSkin.tabDisabledTextColor}';
+ cursor: default;
+}
+
.rf-pm-top-gr-cnt {
}
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-25
00:26:19 UTC (rev 21188)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-25
01:09:50 UTC (rev 21189)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup-dis" class="rf-pm-gr groupClass rf-pm-gr-dis
groupDisableClass">
<input id="f:panelMenuGroup-dis:expanded"
name="f:panelMenuGroup-dis:expanded" type="hidden"
value="false"/>
- <div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr
rf-pm-hdr-colps">
+ <div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr
rf-pm-hdr-colps rf-pm-gr-hdr-dis">
<table class="rf-pm-gr-gr">
<tbody>
<tr>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-25
00:26:19 UTC (rev 21188)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-25
01:09:50 UTC (rev 21189)
@@ -1,6 +1,6 @@
<div id="f:panelMenuGroup-topDis" class="rf-pm-top-gr topGroupClass
rf-pm-top-gr-dis topGroupClassDisabled">
<input id="f:panelMenuGroup-topDis:expanded"
name="f:panelMenuGroup-topDis:expanded" type="hidden"
value="false"/>
- <div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr
rf-pm-hdr-colps">
+ <div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr
rf-pm-hdr-colps rf-pm-top-gr-hdr-dis">
<table class="rf-pm-top-gr-gr">
<tbody>
<tr>