Author: nbelaevski
Date: 2011-01-25 08:39:43 -0500 (Tue, 25 Jan 2011)
New Revision: 21204
Removed:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconSpacer.java
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/java/org/richfaces/renderkit/html/iconimages/PanelIconDisc.java
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconGrid.java
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconTriangleBasic.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/TableIconsRendererHelper.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/api/src/main/java/org/richfaces/renderkit/util/PanelIcons.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,28 +1,38 @@
package org.richfaces.renderkit.util;
public enum PanelIcons {
- none("rf-ico-none"),
- disc("rf-ico-disc"),
- grid("rf-ico-grid"),
- chevron("rf-ico-chevron"),
- chevronUp("rf-ico-chevron-up"),
- chevronDown("rf-ico-chevron-down"),
- triangle("rf-ico-triangle"),
- triangleUp("rf-ico-triangle-up"),
- triangleDown("rf-ico-triangle-down");
+ none("rf-ico-none", null),
+ 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");
public static final PanelIcons DEFAULT = none;
private final String cssClass;
- private PanelIcons(String cssClass) {
+ private final String headerClass;
+
+ private PanelIcons(String cssClass, String headerClass) {
this.cssClass = cssClass;
+ this.headerClass = headerClass;
}
public String cssClass() {
return cssClass;
}
+ public String headerClass() {
+ return headerClass;
+ }
+
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconBasic.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -24,7 +24,6 @@
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
-import java.awt.RenderingHints;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -33,6 +32,7 @@
import org.richfaces.resource.AbstractJava2DUserResource;
import org.richfaces.resource.PostConstructResource;
+import org.richfaces.resource.ResourceParameter;
import org.richfaces.resource.StateHolderResource;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
@@ -46,6 +46,9 @@
private Color color;
+ @ResourceParameter(defaultValue = "false")
+ private boolean headerIcon;
+
protected PanelIconBasic() {
super(DIMENSION);
}
@@ -55,12 +58,6 @@
return;
}
- graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- graphics2D.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- graphics2D.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- graphics2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- graphics2D.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
paintImage(graphics2D, color);
}
@@ -74,8 +71,12 @@
public void initialize() {
FacesContext context = FacesContext.getCurrentInstance();
Skin skin = SkinFactory.getInstance(context).getSkin(context);
- color = new Color(skin.getColorParameter(context,
"tabDisabledTextColor"));
+ color = new Color(skin.getColorParameter(context, headerIcon ?
Skin.HEADER_TEXT_COLOR : "tabDisabledTextColor"));
}
+
+ public void setHeaderIcon(boolean topIcon) {
+ this.headerIcon = topIcon;
+ }
public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
dataOutput.writeInt(color.getRGB());
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconDisc.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconDisc.java 2011-01-25
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconDisc.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -21,14 +21,13 @@
package org.richfaces.renderkit.html.iconimages;
-import org.richfaces.resource.DynamicUserResource;
-
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
-import java.awt.RenderingHints;
import java.awt.geom.Ellipse2D;
+import org.richfaces.resource.DynamicUserResource;
+
@DynamicUserResource
public class PanelIconDisc extends PanelIconBasic {
@@ -38,7 +37,6 @@
Dimension dimension = getDimension();
long dim = Math.round(dimension.getWidth() / 3);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(color);
g2d.translate(dim, dim);
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconGrid.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconGrid.java 2011-01-25
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconGrid.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -21,29 +21,20 @@
package org.richfaces.renderkit.html.iconimages;
-import org.richfaces.resource.DynamicUserResource;
-
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
-import java.awt.RenderingHints;
import java.awt.geom.Rectangle2D;
+import org.richfaces.resource.DynamicUserResource;
+
@DynamicUserResource
public class PanelIconGrid extends PanelIconBasic {
@Override
protected void paintImage(Graphics2D g2d, Color color) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
-
Rectangle2D.Float path = new Rectangle2D.Float();
Dimension dimension = getDimension();
Deleted:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconSpacer.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconSpacer.java 2011-01-25
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconSpacer.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,35 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import org.richfaces.resource.DynamicUserResource;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-
-@DynamicUserResource
-public class PanelIconSpacer extends PanelIconBasic {
-
- protected void paintImage(Graphics2D g2d, Color color) {
- }
-
-}
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconTriangleBasic.java
===================================================================
---
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconTriangleBasic.java 2011-01-25
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/html/iconimages/PanelIconTriangleBasic.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -23,7 +23,6 @@
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
-import java.awt.RenderingHints;
import java.awt.geom.GeneralPath;
/**
@@ -33,10 +32,6 @@
protected void paintImage(Graphics2D g2d, Color color) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING,
RenderingHints.VALUE_DITHER_ENABLE);
-
GeneralPath path = new GeneralPath();
Dimension dimension = getDimension();
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/resources/META-INF/resources/org.richfaces/icons.ecss 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,13 +1,95 @@
+.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 {
+ width: 16px;
+ height: 16px;
+}
-.rf-ico-none { width: 16px; height: 16px; }
-.rf-ico-chevron { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:Chevron.png']})" }
-.rf-ico-chevron-down { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:ChevronDown.png']})" }
-.rf-ico-chevron-left { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:ChevronLeft.png']})" }
-.rf-ico-chevron-up { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:ChevronUp.png']})" }
-.rf-ico-disc { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:Disc.png']})" }
-.rf-ico-grid { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:Grid.png']})" }
-.rf-ico-spacer { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:Spacer.png']})" }
-.rf-ico-triangle { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:Triangle.png']})" }
-.rf-ico-triangle-down { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:TriangleDown.png']})" }
-.rf-ico-triangle-left { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:TriangleLeft.png']})" }
-.rf-ico-triangle-up { width: 16px; height: 16px; background-image:
"url(#{resource['org.richfaces.images:TriangleUp.png']})" }
\ No newline at end of file
+.rf-ico-chevron {
+ 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-down {
+ 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-left {
+ 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-up {
+ 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-disc {
+ background-image: "url(#{resource['org.richfaces.images:Disc.png']})"
+}
+
+.rf-ico-hdr-disc {
+ background-image:
"url(#{resource['org.richfaces.images:HeaderDisc.png']})"
+}
+
+.rf-ico-grid {
+ background-image: "url(#{resource['org.richfaces.images:Grid.png']})"
+}
+
+.rf-ico-hdr-grid {
+ background-image:
"url(#{resource['org.richfaces.images:HeaderGrid.png']})"
+}
+
+.rf-ico-triangle {
+ 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-down {
+ 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-left {
+ 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-up {
+ 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
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/common/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,21 +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\:ChevronDown.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronDown
+org.richfaces.images\:HeaderChevronDown.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronDown{headerIcon=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\:ChevronUp.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronUp
+org.richfaces.images\:HeaderChevronUp.png=org.richfaces.renderkit.html.iconimages.PanelIconChevronUp{headerIcon=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\:Grid.png=org.richfaces.renderkit.html.iconimages.PanelIconGrid
+org.richfaces.images\:HeaderGrid.png=org.richfaces.renderkit.html.iconimages.PanelIconGrid{headerIcon=true}
-org.richfaces.images\:Spacer.png=org.richfaces.renderkit.html.iconimages.PanelIconSpacer
-
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\:TriangleDown.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleDown
+org.richfaces.images\:HeaderTriangleDown.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleDown{headerIcon=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\:TriangleUp.png=org.richfaces.renderkit.html.iconimages.PanelIconTriangleUp
\ No newline at end of file
+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
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -24,7 +24,7 @@
String iconInactive = panel.isDisabled() ? panel.getLeftIconDisabled() :
panel.getLeftIconInactive();
String iconActive = panel.isDisabled() ? panel.getLeftIconDisabled() :
panel.getLeftIconActive();
- encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconInactive,
iconActive);
+ encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconInactive,
iconActive, true);
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context,
AbstractAccordionItem panel) throws IOException {
@@ -32,16 +32,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);
+ encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconInactive, iconActive, true);
}
@Override
- protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue) throws IOException
{
+ protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, boolean header)
throws IOException {
writer.startElement(TD_ELEM, null);
writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-act");
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-inact");
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-act", header);
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-inact", header);
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/CollapsiblePanelRenderer.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -68,13 +68,13 @@
protected void encodeHeaderLeftIcon(ResponseWriter writer, FacesContext context,
AbstractCollapsiblePanel panel) throws IOException {
encodeTdIcon(writer, context, cssClassPrefix + "-ico",
- panel.getLeftIconCollapsed(), panel.getLeftIconExpanded());
+ panel.getLeftIconCollapsed(), panel.getLeftIconExpanded(), true);
}
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());
+ panel.getRightIconCollapsed(), panel.getRightIconExpanded(), true);
}
@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
13:38:22 UTC (rev 21203)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupHeaderRenderer.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,11 +1,12 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.AbstractPanelMenuGroup;
+import java.io.IOException;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import java.io.IOException;
+import org.richfaces.component.AbstractPanelMenuGroup;
+
class PanelMenuGroupHeaderRenderer extends
TableIconsRendererHelper<AbstractPanelMenuGroup> {
PanelMenuGroupHeaderRenderer(String cssClassPrefix) {
@@ -16,7 +17,7 @@
String iconCollapsed = group.isDisabled() ? group.getLeftIconDisabled() :
group.getLeftIconCollapsed();
String iconExpanded = group.isDisabled() ? group.getLeftIconDisabled() :
group.getLeftIconExpanded();
- encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconCollapsed,
iconExpanded);
+ encodeTdIcon(writer, context, cssClassPrefix + "-ico", iconCollapsed,
iconExpanded, group.isTopItem());
}
protected void encodeHeaderRightIcon(ResponseWriter writer, FacesContext context,
AbstractPanelMenuGroup group) throws IOException {
@@ -24,6 +25,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);
+ encodeTdIcon(writer, context, cssClassPrefix + "-exp-ico",
iconCollapsed, iconExpanded, group.isTopItem());
}
}
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-25
13:39:43 UTC (rev 21204)
@@ -1,15 +1,24 @@
package org.richfaces.renderkit.html;
-import org.richfaces.renderkit.RenderKitUtils;
-import org.richfaces.renderkit.util.PanelIcons;
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.renderkit.HtmlConstants.ALT_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.CLASS_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.DIV_ELEM;
+import static org.richfaces.renderkit.HtmlConstants.IMG_ELEMENT;
+import static org.richfaces.renderkit.HtmlConstants.SRC_ATTRIBUTE;
+import static org.richfaces.renderkit.HtmlConstants.TABLE_ELEMENT;
+import static org.richfaces.renderkit.HtmlConstants.TBODY_ELEMENT;
+import static org.richfaces.renderkit.HtmlConstants.TD_ELEM;
+import static org.richfaces.renderkit.HtmlConstants.TR_ELEMENT;
+import java.io.IOException;
+
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import static org.richfaces.component.util.HtmlUtil.concatClasses;
-import static org.richfaces.renderkit.HtmlConstants.*;
+import org.richfaces.renderkit.RenderKitUtils;
+import org.richfaces.renderkit.util.PanelIcons;
public abstract class TableIconsRendererHelper<T extends UIComponent> {
@@ -74,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) throws IOException
{
+ protected void encodeTdIcon(ResponseWriter writer, FacesContext context, String
cssClass, String attrIconCollapsedValue, String attrIconExpandedValue, boolean header)
throws IOException {
writer.startElement(TD_ELEM, null);
writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-colps");
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-exp");
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix +
"-colps", header);
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix +
"-exp", header);
writer.endElement(TD_ELEM);
}
- protected void encodeIdIcon(ResponseWriter writer, FacesContext context, String
attrIconValue, String styleClass) throws IOException {
+ protected void encodeIdIcon(ResponseWriter writer, FacesContext context, String
attrIconValue, String styleClass, boolean header) throws IOException {
if (attrIconValue == null || attrIconValue.trim().length() <= 0) {
- encodeDivIcon(writer, PanelIcons.none, styleClass);
+ encodeDivIcon(writer, PanelIcons.none, styleClass, header);
} else {
PanelIcons icon = PanelIcons.getIcon(attrIconValue);
if (icon != null) {
- encodeDivIcon(writer, icon, styleClass);
+ encodeDivIcon(writer, icon, styleClass, header);
} else {
encodeImage(writer, context, attrIconValue);
}
}
}
- public static void encodeDivIcon(ResponseWriter writer, PanelIcons icon, String
styleClass) throws IOException {
+ public static void encodeDivIcon(ResponseWriter writer, PanelIcons icon, String
styleClass, boolean header) throws IOException {
writer.startElement(DIV_ELEM, null);
- writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(styleClass,
icon.cssClass()), null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, concatClasses(styleClass, header ?
icon.headerClass() : icon.cssClass()), null);
writer.endElement(DIV_ELEM);
}
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
13:38:22 UTC (rev 21203)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2011-01-25
13:39:43 UTC (rev 21204)
@@ -180,7 +180,6 @@
border-width: 1px;
border-style: solid;
border-color: '#{richSkin.panelBorderColor}';
- margin-bottom: 3px
}
.rf-pm-top-gr-hov {