Author: nbelaevski
Date: 2011-01-25 10:19:06 -0500 (Tue, 25 Jan 2011)
New Revision: 21213
Modified:
trunk/ui/common/api/src/main/java/org/richfaces/renderkit/util/PanelIcons.java
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconBasic.java
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/icons.ecss
trunk/ui/common/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
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-itemDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml
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-topItemDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10158
Modified: trunk/ui/common/api/src/main/java/org/richfaces/renderkit/util/PanelIcons.java
===================================================================
---
trunk/ui/common/api/src/main/java/org/richfaces/renderkit/util/PanelIcons.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/common/api/src/main/java/org/richfaces/renderkit/util/PanelIcons.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -1,38 +1,80 @@
package org.richfaces.renderkit.util;
public enum PanelIcons {
- none("rf-ico-none", "rf-ico-none"),
- chevron("rf-ico-chevron", "rf-ico-hdr-chevron"),
- chevronLeft("rf-ico-chevron-left", "rf-ico-hdr-chevron-left"),
- chevronUp("rf-ico-chevron-up", "rf-ico-hdr-chevron-up"),
- chevronDown("rf-ico-chevron-down", "rf-ico-hdr-chevron-down"),
- disc("rf-ico-disc", "rf-ico-hdr-disc"),
- grid("rf-ico-grid", "rf-ico-hdr-grid"),
- transparent("rf-ico-transparent", "rf-ico-hdr-transparent"),
- triangle("rf-ico-triangle", "rf-ico-hdr-triangle"),
- triangleLeft("rf-ico-triangle-left",
"rf-ico-hdr-triangle-left"),
- triangleUp("rf-ico-triangle-up", "rf-ico-hdr-triangle-up"),
- triangleDown("rf-ico-triangle-down",
"rf-ico-hdr-triangle-down");
+
+ none("rf-ico-none"),
+ chevron("rf-ico-chevron"),
+ chevronLeft("rf-ico-chevron-left"),
+ chevronUp("rf-ico-chevron-up"),
+ chevronDown("rf-ico-chevron-down"),
+ disc("rf-ico-disc"),
+ grid("rf-ico-grid"),
+ transparent("rf-ico-transparent"),
+ triangle("rf-ico-triangle"),
+ triangleLeft("rf-ico-triangle-left"),
+ triangleUp("rf-ico-triangle-up"),
+ triangleDown("rf-ico-triangle-down");
+ public enum State {
+ common {
+ @Override
+ public String getCssClass(PanelIcons icons) {
+ return icons.cssClass();
+ }
+ }, commonDisabled {
+ @Override
+ public String getCssClass(PanelIcons icons) {
+ return icons.disabledCssClass();
+ }
+ }, header {
+ @Override
+ public String getCssClass(PanelIcons icons) {
+ return icons.headerClass();
+ }
+ }, headerDisabled {
+ @Override
+ public String getCssClass(PanelIcons icons) {
+ return icons.disabledHeaderClass();
+ }
+ };
+
+ public abstract String getCssClass(PanelIcons icons);
+ }
+
public static final PanelIcons DEFAULT = none;
private final String cssClass;
private final String headerClass;
- private PanelIcons(String cssClass, String headerClass) {
- this.cssClass = cssClass;
- this.headerClass = headerClass;
+ private final String disabledCssClass;
+
+ private final String disabledHeaderClass;
+
+ private PanelIcons(String baseClass) {
+ this.cssClass = baseClass;
+
+ this.headerClass = baseClass + "-hdr";
+ this.disabledCssClass = baseClass + "-dis";
+ this.disabledHeaderClass = baseClass + "-hdr-dis";
}
- public String cssClass() {
+ private String cssClass() {
return cssClass;
}
- public String headerClass() {
+ private String headerClass() {
return headerClass;
}
+ private String disabledCssClass() {
+ return disabledCssClass;
+ }
+
+ private String disabledHeaderClass() {
+ return disabledHeaderClass;
+ }
+
public static PanelIcons getIcon(String attrIconCollapsedValue) {
if (attrIconCollapsedValue == null) {
return null;
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconBasic.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconBasic.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconBasic.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -47,7 +47,7 @@
private Color color;
@ResourceParameter(defaultValue = "false")
- private boolean headerIcon;
+ private boolean disabled;
protected PanelIconBasic() {
super(DIMENSION);
@@ -71,11 +71,11 @@
public void initialize() {
FacesContext context = FacesContext.getCurrentInstance();
Skin skin = SkinFactory.getInstance(context).getSkin(context);
- color = new Color(skin.getColorParameter(context, headerIcon ?
Skin.HEADER_TEXT_COLOR : "tabDisabledTextColor"));
+ color = new Color(skin.getColorParameter(context, disabled ?
"tabDisabledTextColor" : Skin.HEADER_TEXT_COLOR));
}
- public void setHeaderIcon(boolean topIcon) {
- this.headerIcon = topIcon;
+ public void setDisabled(boolean topIcon) {
+ this.disabled = topIcon;
}
public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
Modified:
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/icons.ecss
===================================================================
---
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/icons.ecss 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/icons.ecss 2011-01-25
15:19:06 UTC (rev 21213)
@@ -1,95 +1,96 @@
-.rf-ico-none,
-.rf-ico-chevron, .rf-ico-hdr-chevron,
-.rf-ico-chevron-down, .rf-ico-hdr-chevron-down,
-.rf-ico-chevron-left, .rf-ico-hdr-chevron-left,
-.rf-ico-chevron-up, .rf-ico-hdr-chevron-up,
-.rf-ico-disc, .rf-ico-hdr-disc,
-.rf-ico-grid, .rf-ico-hdr-grid,
-.rf-ico-transparent, .rf-ico-hdr-transparent,
-.rf-ico-triangle, .rf-ico-hdr-triangle,
-.rf-ico-triangle-down, .rf-ico-hdr-triangle-down,
-.rf-ico-triangle-left, .rf-ico-hdr-triangle-left,
-.rf-ico-triangle-up, .rf-ico-hdr-triangle-up {
+.rf-ico-none, .rf-ico-none-hdr, .rf-ico-none-dis, .rf-ico-none-hdr-dis,
+.rf-ico-chevron, .rf-ico-chevron-hdr, .rf-ico-chevron-dis, .rf-ico-chevron-hdr-dis,
+.rf-ico-chevron-down, .rf-ico-chevron-down-hdr, .rf-ico-chevron-down-dis,
.rf-ico-chevron-down-hdr-dis,
+.rf-ico-chevron-left, .rf-ico-chevron-left-hdr, .rf-ico-chevron-left-dis,
.rf-ico-chevron-left-hdr-dis,
+.rf-ico-chevron-up, .rf-ico-chevron-up-hdr, .rf-ico-chevron-up-dis,
.rf-ico-chevron-up-hdr-dis,
+.rf-ico-disc, .rf-ico-disc-hdr, .rf-ico-disc-dis, .rf-ico-disc-hdr-dis,
+.rf-ico-grid, .rf-ico-grid-hdr, .rf-ico-grid-dis, .rf-ico-grid-hdr-dis,
+.rf-ico-transparent, .rf-ico-transparent-hdr, .rf-ico-transparent-dis,
.rf-ico-transparent-hdr-dis,
+.rf-ico-triangle, .rf-ico-triangle-hdr, .rf-ico-triangle-dis, .rf-ico-triangle-hdr-dis,
+.rf-ico-triangle-down, .rf-ico-triangle-down-hdr, .rf-ico-triangle-down-dis,
.rf-ico-triangle-down-hdr-dis,
+.rf-ico-triangle-left, .rf-ico-triangle-left-hdr, .rf-ico-triangle-left-dis,
.rf-ico-triangle-left-hdr-dis,
+.rf-ico-triangle-up, .rf-ico-triangle-up-dis, .rf-ico-triangle-up-hdr,
.rf-ico-triangle-up-hdr-dis {
width: 16px;
height: 16px;
}
-.rf-ico-chevron {
+.rf-ico-chevron-hdr {
background-image:
"url(#{resource['org.richfaces.images:Chevron.png']})"
}
-.rf-ico-hdr-chevron {
- background-image:
"url(#{resource['org.richfaces.images:HeaderChevron.png']})"
+.rf-ico-chevron, .rf-ico-chevron-dis, .rf-ico-chevron-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:ChevronDisabled.png']})"
}
-.rf-ico-chevron-down {
+.rf-ico-chevron-down-hdr {
background-image:
"url(#{resource['org.richfaces.images:ChevronDown.png']})"
}
-.rf-ico-hdr-chevron-down {
- background-image:
"url(#{resource['org.richfaces.images:HeaderChevronDown.png']})"
+.rf-ico-chevron-down, .rf-ico-chevron-down-dis, .rf-ico-chevron-down-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:ChevronDownDisabled.png']})"
}
-.rf-ico-chevron-left {
+.rf-ico-chevron-left-hdr {
background-image:
"url(#{resource['org.richfaces.images:ChevronLeft.png']})"
}
-.rf-ico-hdr-chevron-left {
- background-image:
"url(#{resource['org.richfaces.images:HeaderChevronLeft.png']})"
+.rf-ico-chevron-left, .rf-ico-chevron-left-dis, .rf-ico-chevron-left-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:ChevronLeftDisabled.png']})"
}
-.rf-ico-chevron-up {
+.rf-ico-chevron-up-hdr {
background-image:
"url(#{resource['org.richfaces.images:ChevronUp.png']})"
}
-.rf-ico-hdr-chevron-up {
- background-image:
"url(#{resource['org.richfaces.images:HeaderChevronUp.png']})"
+.rf-ico-chevron-up, .rf-ico-chevron-up-dis, .rf-ico-chevron-up-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:ChevronUpDisabled.png']})"
}
-.rf-ico-disc {
+.rf-ico-disc-hdr {
background-image: "url(#{resource['org.richfaces.images:Disc.png']})"
}
-.rf-ico-hdr-disc {
- background-image:
"url(#{resource['org.richfaces.images:HeaderDisc.png']})"
+.rf-ico-disc, .rf-ico-disc-dis, .rf-ico-disc-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:DiscDisabled.png']})"
}
-.rf-ico-grid {
+.rf-ico-grid-hdr {
background-image: "url(#{resource['org.richfaces.images:Grid.png']})"
}
-.rf-ico-hdr-grid {
- background-image:
"url(#{resource['org.richfaces.images:HeaderGrid.png']})"
+.rf-ico-grid, .rf-ico-grid-dis, .rf-ico-grid-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:GridDisabled.png']})"
}
-.rf-ico-triangle {
+.rf-ico-triangle-hdr {
background-image:
"url(#{resource['org.richfaces.images:Triangle.png']})"
}
-.rf-ico-hdr-triangle {
- background-image:
"url(#{resource['org.richfaces.images:HeaderTriangle.png']})"
+.rf-ico-triangle, .rf-ico-triangle-dis, .rf-ico-triangle-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:TriangleDisabled.png']})"
}
-.rf-ico-triangle-down {
+.rf-ico-triangle-down-hdr {
background-image:
"url(#{resource['org.richfaces.images:TriangleDown.png']})"
}
-.rf-ico-hdr-triangle-down {
- background-image:
"url(#{resource['org.richfaces.images:HeaderTriangleDown.png']})"
+.rf-ico-triangle-down, .rf-ico-triangle-down-dis, .rf-ico-triangle-down-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:TriangleDownDisabled.png']})"
}
-.rf-ico-triangle-left {
+.rf-ico-triangle-left-hdr {
background-image:
"url(#{resource['org.richfaces.images:TriangleLeft.png']})"
}
-.rf-ico-hdr-triangle-left {
- background-image:
"url(#{resource['org.richfaces.images:HeaderTriangleLeft.png']})"
+.rf-ico-triangle-left, .rf-ico-triangle-left-dis, .rf-ico-triangle-left-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:TriangleLeftDisabled.png']})"
}
-.rf-ico-triangle-up {
+.rf-ico-triangle-up-hdr {
background-image:
"url(#{resource['org.richfaces.images:TriangleUp.png']})"
}
-.rf-ico-hdr-triangle-up {
- background-image:
"url(#{resource['org.richfaces.images:HeaderTriangleUp.png']})"
-}
\ No newline at end of file
+.rf-ico-triangle-up, .rf-ico-triangle-up-dis, .rf-ico-triangle-up-hdr-dis {
+ background-image:
"url(#{resource['org.richfaces.images:TriangleUpDisabled.png']})"
+}
+
Modified:
trunk/ui/common/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
---
trunk/ui/common/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/common/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2011-01-25
15:19:06 UTC (rev 21213)
@@ -1,29 +1,29 @@
org.richfaces.images\:Chevron.png=org.richfaces.renderkit.html.iconimages.PanelIconChevron
-org.richfaces.images\:HeaderChevron.png=org.richfaces.renderkit.html.iconimages.PanelIconChevron{headerIcon=true}
+org.richfaces.images\:ChevronDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconChevron{disabled=true}
org.richfaces.images\:ChevronDown.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronDown
-org.richfaces.images\:HeaderChevronDown.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronDown{headerIcon=true}
+org.richfaces.images\:ChevronDownDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronDown{disabled=true}
org.richfaces.images\:ChevronLeft.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronLeft
-org.richfaces.images\:HeaderChevronLeft.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronLeft{headerIcon=true}
+org.richfaces.images\:ChevronLeftDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronLeft{disabled=true}
org.richfaces.images\:ChevronUp.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronUp
-org.richfaces.images\:HeaderChevronUp.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronUp{headerIcon=true}
+org.richfaces.images\:ChevronUpDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronUp{disabled=true}
org.richfaces.images\:Disc.png=org.richfaces.renderkit.html.iconimages.PanelIconDisc
-org.richfaces.images\:HeaderDisc.png=org.richfaces.renderkit.html.iconimages.PanelIconDisc{headerIcon=true}
+org.richfaces.images\:DiscDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconDisc{disabled=true}
org.richfaces.images\:Grid.png=org.richfaces.renderkit.html.iconimages.PanelIconGrid
-org.richfaces.images\:HeaderGrid.png=org.richfaces.renderkit.html.iconimages.PanelIconGrid{headerIcon=true}
+org.richfaces.images\:GridDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconGrid{disabled=true}
org.richfaces.images\:Triangle.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangle
-org.richfaces.images\:HeaderTriangle.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangle{headerIcon=true}
+org.richfaces.images\:TriangleDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangle{disabled=true}
org.richfaces.images\:TriangleDown.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleDown
-org.richfaces.images\:HeaderTriangleDown.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleDown{headerIcon=true}
+org.richfaces.images\:TriangleDownDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleDown{disabled=true}
org.richfaces.images\:TriangleLeft.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleLeft
-org.richfaces.images\:HeaderTriangleLeft.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleLeft{headerIcon=true}
+org.richfaces.images\:TriangleLeftDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleLeft{disabled=true}
org.richfaces.images\:TriangleUp.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleUp
-org.richfaces.images\:HeaderTriangleUp.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleUp{headerIcon=true}
\ No newline at end of file
+org.richfaces.images\:TriangleUpDisabled.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleUp{disabled=true}
\ No newline at end of file
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -13,6 +13,8 @@
import org.richfaces.component.AbstractAccordionItem;
import org.richfaces.component.AbstractTogglePanelTitledItem;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.renderkit.util.PanelIcons;
+import org.richfaces.renderkit.util.PanelIcons.State;
class AccordionItemHeaderRenderer extends
TableIconsRendererHelper<AbstractAccordionItem> {
@@ -24,7 +26,7 @@
String iconInactive = panel.isDisabled() ? panel.getLeftIconDisabled() :
panel.getLeftIconInactive();
String iconActive = panel.isDisabled() ? panel.getLeftIconDisabled() :
panel.getLeftIconActive();
- encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconInactive,
iconActive, true);
+ encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconInactive,
iconActive, panel.isDisabled() ? State.commonDisabled : State.common);
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context,
AbstractAccordionItem panel) throws IOException {
@@ -32,16 +34,16 @@
String iconActive = panel.isDisabled() ? panel.getRightIconDisabled() :
panel.getRightIconActive();
//TODO nick - should this be "-ico-exp"? also why expanded icon state
is connected with right icon alignment?
- encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconInactive, iconActive, true);
+ encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconInactive, iconActive, panel.isDisabled() ? State.headerDisabled : State.header);
}
@Override
- protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, boolean header)
throws IOException {
+ protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, PanelIcons.State
state) throws IOException {
writer.startElement(TD_ELEM, null);
writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-act", header);
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-inact", header);
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-act", state);
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-inact", state);
writer.endElement(TD_ELEM);
}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -41,6 +41,7 @@
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.component.AbstractCollapsiblePanel;
import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.renderkit.util.PanelIcons;
/**
* @author akolonitsky
@@ -68,13 +69,13 @@
protected void encodeHeaderLeftIcon(ResponseWriter writer, FacesContext context,
AbstractCollapsiblePanel panel) throws IOException {
encodeTdIcon(writer, context, cssClassPrefix + "-ico",
- panel.getLeftIconCollapsed(), panel.getLeftIconExpanded(), true);
+ panel.getLeftIconCollapsed(), panel.getLeftIconExpanded(),
PanelIcons.State.header);
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context,
AbstractCollapsiblePanel panel) throws IOException {
//TODO nick - should this be "-ico-exp"? also why expanded icon
state is connected with right icon alignment?
encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
- panel.getRightIconCollapsed(), panel.getRightIconExpanded(), true);
+ panel.getRightIconCollapsed(), panel.getRightIconExpanded(),
PanelIcons.State.header);
}
@Override
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -6,6 +6,8 @@
import javax.faces.context.ResponseWriter;
import org.richfaces.component.AbstractPanelMenuGroup;
+import org.richfaces.renderkit.util.PanelIcons;
+import org.richfaces.renderkit.util.PanelIcons.State;
class PanelMenuGroupHeaderRenderer extends
TableIconsRendererHelper<AbstractPanelMenuGroup> {
@@ -13,11 +15,19 @@
super("label", cssClassPrefix, "rf-pm-ico");
}
+ private PanelIcons.State getState(AbstractPanelMenuGroup group) {
+ if (group.isTopItem()) {
+ return group.isDisabled() ? State.headerDisabled : State.header;
+ } else {
+ return group.isDisabled() ? State.commonDisabled : State.common;
+ }
+ }
+
protected void encodeHeaderLeftIcon(ResponseWriter writer, FacesContext context,
AbstractPanelMenuGroup group) throws IOException {
String iconCollapsed = group.isDisabled() ? group.getLeftIconDisabled() :
group.getLeftIconCollapsed();
String iconExpanded = group.isDisabled() ? group.getLeftIconDisabled() :
group.getLeftIconExpanded();
- encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconCollapsed,
iconExpanded, group.isTopItem());
+ encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconCollapsed,
iconExpanded, getState(group));
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context,
AbstractPanelMenuGroup group) throws IOException {
@@ -25,6 +35,6 @@
String iconExpanded = group.isDisabled() ? group.getRightIconDisabled() :
group.getRightIconExpanded();
//TODO nick - should this be "-ico-exp"? also why expanded icon state
is connected with right icon alignment?
- encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconCollapsed, iconExpanded, group.isTopItem());
+ encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconCollapsed, iconExpanded, getState(group));
}
}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -44,6 +44,7 @@
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
import org.richfaces.renderkit.util.PanelIcons;
+import org.richfaces.renderkit.util.PanelIcons.State;
/**
* @author akolonitsky
@@ -94,26 +95,30 @@
writer.endElement("table");
}
+ private PanelIcons.State getState(AbstractPanelMenuItem item) {
+ return item.isDisabled() ? State.commonDisabled : State.common;
+ }
+
private void encodeHeaderGroupRightIcon(ResponseWriter writer, FacesContext context,
AbstractPanelMenuItem menuItem, String classPrefix) throws IOException {
String icon = menuItem.isDisabled() ? menuItem.getRightIconDisabled() :
menuItem.getRightIcon();
String cssClasses = concatClasses(classPrefix + "-exp-ico",
menuItem.getLeftIconClass());
- encodeTdIcon(writer, context, cssClasses, icon);
+ encodeTdIcon(writer, context, cssClasses, icon, getState(menuItem));
}
private void encodeHeaderGroupLeftIcon(ResponseWriter writer, FacesContext context,
AbstractPanelMenuItem menuItem, String classPrefix) throws IOException {
String icon = menuItem.isDisabled() ? menuItem.getLeftIconDisabled() :
menuItem.getLeftIcon();
String cssClasses = concatClasses(classPrefix + "-ico",
menuItem.getLeftIconClass());
- encodeTdIcon(writer, context, cssClasses, icon);
+ encodeTdIcon(writer, context, cssClasses, icon, getState(menuItem));
}
//TODO nick - the same as in PanelMenuGroupRenderer
- public void encodeTdIcon(ResponseWriter writer, FacesContext context, String
classPrefix, String attrIconValue) throws IOException {
+ public void encodeTdIcon(ResponseWriter writer, FacesContext context, String
classPrefix, String attrIconValue, PanelIcons.State state) throws IOException {
writer.startElement(TD_ELEM, null);
try {
PanelIcons icon = PanelIcons.valueOf(attrIconValue);
- writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(classPrefix,
icon.cssClass()), null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(classPrefix,
state.getCssClass(icon)), null);
} catch (IllegalArgumentException e) {
writer.writeAttribute(CLASS_ATTRIBUTE, classPrefix, null);
if(attrIconValue != null && attrIconValue.trim().length() != 0) {
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-25
15:19:06 UTC (rev 21213)
@@ -83,32 +83,32 @@
protected abstract void encodeHeaderRightIcon(ResponseWriter writer, FacesContext
context, T menuItem) throws IOException;
- protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, boolean header)
throws IOException {
+ protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, PanelIcons.State
state) throws IOException {
writer.startElement(TD_ELEM, null);
writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-colps", header);
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-exp", header);
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-colps", state);
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-exp", state);
writer.endElement(TD_ELEM);
}
- protected void encodeIdIcon(ResponseWriter writer, FacesContext context, String
attrIconValue, String styleClass, boolean header) throws IOException {
+ protected void encodeIdIcon(ResponseWriter writer, FacesContext context, String
attrIconValue, String styleClass, PanelIcons.State state) throws IOException {
if (attrIconValue == null || attrIconValue.trim().length() <= 0) {
- encodeDivIcon(writer, PanelIcons.none, styleClass, header);
+ encodeDivIcon(writer, PanelIcons.none, styleClass, state);
} else {
PanelIcons icon = PanelIcons.getIcon(attrIconValue);
if (icon != null) {
- encodeDivIcon(writer, icon, styleClass, header);
+ encodeDivIcon(writer, icon, styleClass, state);
} else {
encodeImage(writer, context, attrIconValue);
}
}
}
- public static void encodeDivIcon(ResponseWriter writer, PanelIcons icon, String
styleClass, boolean header) throws IOException {
+ public static void encodeDivIcon(ResponseWriter writer, PanelIcons icon, String
styleClass, PanelIcons.State state) throws IOException {
writer.startElement(DIV_ELEM, null);
- writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(styleClass, header ?
icon.headerClass() : icon.cssClass()), null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(styleClass,
state.getCssClass(icon)), null);
writer.endElement(DIV_ELEM);
}
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/accordionItem.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -12,8 +12,8 @@
<div
class="rf-ac-itm-lbl-inact">item</div>
</td>
<td class="rf-ac-itm-exp-ico">
- <div class="rf-ac-itm-ico-act
rf-ico-none"></div>
- <div class="rf-ac-itm-ico-inact
rf-ico-none"></div>
+ <div class="rf-ac-itm-ico-act
rf-ico-none-hdr"></div>
+ <div class="rf-ac-itm-ico-inact
rf-ico-none-hdr"></div>
</td>
</tr>
</tbody>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/collapsiblePanel.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -8,16 +8,16 @@
<tbody>
<tr>
<td class="rf-cp-ico">
- <div class="rf-cp-ico-colps
rf-ico-none"></div>
- <div class="rf-cp-ico-exp
rf-ico-none"></div>
+ <div class="rf-cp-ico-colps
rf-ico-none-hdr"></div>
+ <div class="rf-cp-ico-exp
rf-ico-none-hdr"></div>
</td>
<td class="rf-cp-lbl">
<div class="rf-cp-lbl-exp"></div>
<div class="rf-cp-lbl-colps"></div>
</td>
<td class="rf-cp-exp-ico">
- <div class="rf-cp-ico-colps
rf-ico-none"></div>
- <div class="rf-cp-ico-exp
rf-ico-none"></div>
+ <div class="rf-cp-ico-colps
rf-ico-none-hdr"></div>
+ <div class="rf-cp-ico-exp
rf-ico-none-hdr"></div>
</td>
</tr>
</tbody>
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
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-gr-ico">
- <div class="rf-pm-ico-colps
rf-ico-chevron-down"></div>
- <div class="rf-pm-ico-exp
rf-ico-chevron-down"></div>
+ <div class="rf-pm-ico-colps
rf-ico-chevron-down-dis"></div>
+ <div class="rf-pm-ico-exp
rf-ico-chevron-down-dis"></div>
</td>
<td class="rf-pm-gr-lbl"></td>
<td class="rf-pm-gr-exp-ico">
- <div class="rf-pm-ico-colps
rf-ico-chevron-up"></div>
- <div class="rf-pm-ico-exp
rf-ico-chevron-up"></div>
+ <div class="rf-pm-ico-colps
rf-ico-chevron-up-dis"></div>
+ <div class="rf-pm-ico-exp
rf-ico-chevron-up-dis"></div>
</td>
</tr>
</tbody>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -2,9 +2,9 @@
<table class="rf-pm-itm-gr">
<tbody>
<tr>
- <td class="rf-pm-itm-ico rf-ico-chevron-down"></td>
+ <td class="rf-pm-itm-ico
rf-ico-chevron-down-dis"></td>
<td class="rf-pm-itm-lbl">panelMenuItem</td>
- <td class="rf-pm-itm-exp-ico
rf-ico-chevron-up"></td>
+ <td class="rf-pm-itm-exp-ico
rf-ico-chevron-up-dis"></td>
</tr>
</tbody>
</table>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-top-gr-ico">
- <div class="rf-pm-ico-colps
rf-ico-hdr-triangle"></div>
- <div class="rf-pm-ico-exp
rf-ico-hdr-disc"></div>
+ <div class="rf-pm-ico-colps
rf-ico-triangle-hdr"></div>
+ <div class="rf-pm-ico-exp
rf-ico-disc-hdr"></div>
</td>
<td class="rf-pm-top-gr-lbl"></td>
<td class="rf-pm-top-gr-exp-ico">
- <div class="rf-pm-ico-colps
rf-ico-hdr-triangle"></div>
- <div class="rf-pm-ico-exp
rf-ico-hdr-disc"></div>
+ <div class="rf-pm-ico-colps
rf-ico-triangle-hdr"></div>
+ <div class="rf-pm-ico-exp
rf-ico-disc-hdr"></div>
</td>
</tr>
</tbody>
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
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-top-gr-ico">
- <div class="rf-pm-ico-colps
rf-ico-hdr-chevron"></div>
- <div class="rf-pm-ico-exp
rf-ico-hdr-chevron"></div>
+ <div class="rf-pm-ico-colps
rf-ico-chevron-hdr-dis"></div>
+ <div class="rf-pm-ico-exp
rf-ico-chevron-hdr-dis"></div>
</td>
<td class="rf-pm-top-gr-lbl"></td>
<td class="rf-pm-top-gr-exp-ico">
- <div class="rf-pm-ico-colps
rf-ico-hdr-chevron"></div>
- <div class="rf-pm-ico-exp
rf-ico-hdr-chevron"></div>
+ <div class="rf-pm-ico-colps
rf-ico-chevron-hdr-dis"></div>
+ <div class="rf-pm-ico-exp
rf-ico-chevron-hdr-dis"></div>
</td>
</tr>
</tbody>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -2,9 +2,9 @@
<table class="rf-pm-top-itm-gr">
<tbody>
<tr>
- <td class="rf-pm-top-itm-ico rf-ico-chevron"></td>
+ <td class="rf-pm-top-itm-ico
rf-ico-chevron-dis"></td>
<td class="rf-pm-top-itm-lbl">panelMenuItem</td>
- <td class="rf-pm-top-itm-exp-ico
rf-ico-chevron"></td>
+ <td class="rf-pm-top-itm-exp-ico
rf-ico-chevron-dis"></td>
</tr>
</tbody>
</table>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-25
15:03:05 UTC (rev 21212)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2011-01-25
15:19:06 UTC (rev 21213)
@@ -5,13 +5,13 @@
<tbody>
<tr>
<td class="rf-pm-top-gr-ico">
- <div class="rf-pm-ico-colps
rf-ico-none"></div>
- <div class="rf-pm-ico-exp
rf-ico-none"></div>
+ <div class="rf-pm-ico-colps
rf-ico-none-hdr"></div>
+ <div class="rf-pm-ico-exp
rf-ico-none-hdr"></div>
</td>
<td class="rf-pm-top-gr-lbl">Group Label</td>
<td class="rf-pm-top-gr-exp-ico">
- <div class="rf-pm-ico-colps
rf-ico-none"></div>
- <div class="rf-pm-ico-exp
rf-ico-none"></div>
+ <div class="rf-pm-ico-colps
rf-ico-none-hdr"></div>
+ <div class="rf-pm-ico-exp
rf-ico-none-hdr"></div>
</td>
</tr>
</tbody>