Author: maksimkaszynski
Date: 2007-09-10 09:11:04 -0400 (Mon, 10 Sep 2007)
New Revision: 2833
Added:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
Log:
http://jira.jboss.com/jira/browse/RF-870
Added:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java
(rev 0)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/DisabledCalendarIcon.java 2007-09-10
13:11:04 UTC (rev 2833)
@@ -0,0 +1,70 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - 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 javax.faces.context.FacesContext;
+
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DisabledCalendarIcon extends CalendarIcon {
+
+ /* (non-Javadoc)
+ * @see
org.richfaces.renderkit.html.iconimages.CalendarIcon#getDataToStore(javax.faces.context.FacesContext,
java.lang.Object)
+ */
+ protected Object getDataToStore(FacesContext context, Object data) {
+
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+
+ String skinParameter = "headerBackgroundColor";
+ String headerTextColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerTextColor || "".equals(headerTextColor))
+ headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if (headerTextColor == null) {
+ return null;
+ }
+
+
+ skinParameter = "tabDisabledTextColor";
+ String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerBackgroundColor || "".equals(headerBackgroundColor))
+ headerBackgroundColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if(headerBackgroundColor == null){
+ return null;
+ }
+
+ byte[] ret = new byte[6];
+ Zipper2 zipper2 = new
Zipper2(ret).addColor(HtmlColor.decode(headerTextColor).getRGB());
+ zipper2.addColor(HtmlColor.decode(headerBackgroundColor).getRGB());
+
+ return ret;
+ }
+}