[richfaces-svn-commits] JBoss Rich Faces SVN: r9189 - trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Jun 24 10:09:35 EDT 2008


Author: nbelaevski
Date: 2008-06-24 10:09:35 -0400 (Tue, 24 Jun 2008)
New Revision: 9189

Modified:
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/TriangleIconBase.java
Log:
Changes reverted

Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/TriangleIconBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/TriangleIconBase.java	2008-06-24 14:08:01 UTC (rev 9188)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/TriangleIconBase.java	2008-06-24 14:09:35 UTC (rev 9189)
@@ -26,7 +26,6 @@
 import java.awt.Graphics2D;
 import java.awt.RenderingHints;
 import java.util.Date;
-import java.util.Map;
 
 import javax.faces.context.FacesContext;
 
@@ -45,12 +44,6 @@
  */
 public abstract class TriangleIconBase extends Java2Dresource {
 	
-	private static final String BORDER_COLOR_PARAMETER = "borderColor";
-
-	private static final String BACKGROUND_COLOR_PARAMETER = "backgroundColor";
-
-	private static final String ICON_COLOR_PARAMETER = "iconColor";
-
 	private static final Dimension DIMENSION = new Dimension(15, 15);
 	
 	protected static final String ICON_COLOR = "generalTextColor";
@@ -113,15 +106,10 @@
 	 * @param data - pass icon color and background color
 	 */
 	protected Object getDataToStore(FacesContext context, Object data) {
-		return storeData(context, ICON_COLOR, BACKGROUND_COLOR, BORDER_COLOR, data);
+		return storeData(context, ICON_COLOR, BACKGROUND_COLOR, BORDER_COLOR);
 	}
 		
-	private static final boolean isEmpty(String s) {
-		return s == null || s.length() == 0;
-	}
-	
-	protected Object storeData(FacesContext context, String colorSkinParam, String backgroundSkinParam, String borderSkinParam, 
-			Object data) {
+	protected Object storeData(FacesContext context, String colorSkinParam, String backgroundSkinParam, String borderSkinParam) {
 		Skin skin = SkinFactory.getInstance().getSkin(context);
 		Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
 		
@@ -130,62 +118,38 @@
 		Color color = null;
 		Zipper2 zipper = new Zipper2(ret);
 		
-		String iconColorString = null;
-		String backgroundColorString = null;
-		String borderColorString = null;
-
-		if (data instanceof Map) {
-			Map map = (Map) data;
-			
-			iconColorString = (String) map.get(ICON_COLOR_PARAMETER);
-			backgroundColorString = (String) map.get(BACKGROUND_COLOR_PARAMETER);
-			borderColorString = (String) map.get(BORDER_COLOR_PARAMETER);
-		}
+		String color1 = (String) skin.getParameter(context, colorSkinParam);
+		if (null == color1 || "".equals(color1))
+			color1 = (String) defaultSkin.getParameter(context, colorSkinParam);
 		
-		if (isEmpty(iconColorString)) {
-			iconColorString = (String) skin.getParameter(context, colorSkinParam);
+		if (color1 == null) {
+			color1 = "#FFFFFF";
 		}
-
-		if (isEmpty(iconColorString)) {
-			iconColorString = (String) defaultSkin.getParameter(context, colorSkinParam);
-		}
 		
-		if (isEmpty(iconColorString)) {
-			iconColorString = "#FFFFFF";
-		}
+		color = HtmlColor.decode(color1);
 		
-		color = HtmlColor.decode(iconColorString);
-		
 		zipper.addColor(color);
 		
-		if (isEmpty(backgroundColorString)) {
-			backgroundColorString = (String) skin.getParameter(context, backgroundSkinParam);
-		}
+		String color2 = (String) skin.getParameter(context, backgroundSkinParam);
+		if (null == color2 || "".equals(color2))
+			color2 = (String) defaultSkin.getParameter(context, backgroundSkinParam);
 		
-		if (isEmpty(backgroundColorString)) {
-			backgroundColorString = (String) defaultSkin.getParameter(context, backgroundSkinParam);
-		}		
-		
-		if (isEmpty(backgroundColorString)) {
-			backgroundColorString = "#000000";
+		if (color2 == null) {
+			color2 = "#000000";
 		}
 		
-		color = HtmlColor.decode(backgroundColorString);
+		color = HtmlColor.decode(color2);
 		zipper.addColor(color);
-
-		if (isEmpty(borderColorString)) {
-			borderColorString = (String) skin.getParameter(context, borderSkinParam);
+		
+		String color3 = (String) skin.getParameter(context, borderSkinParam);
+		if (null == color3 || "".equals(color3))
+			color3 = (String) defaultSkin.getParameter(context, backgroundSkinParam);
+		
+		if (color3 == null) {
+			color3 = "#000000";
 		}
-
-		if (isEmpty(borderColorString)) {
-			borderColorString = (String) defaultSkin.getParameter(context, borderSkinParam);
-		}
-
-		if (isEmpty(borderColorString)) {
-			borderColorString = "#000000";
-		}
 		
-		color = HtmlColor.decode(borderColorString);
+		color = HtmlColor.decode(color3);
 		zipper.addColor(color);
 		
 		return ret;




More information about the richfaces-svn-commits mailing list