myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r427657 [17/42] - in /myfaces: core/trunk/api/src/main/java/javax/faces/component/ core/trunk/api/src/test/java/javax/faces/ core/trunk/api/src/test/java/javax/faces/application/ core/trunk/api/src/test/java/javax/faces/component/ core/trun...
Date Tue, 01 Aug 2006 17:44:01 GMT
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java Tue Aug  1 10:43:28 2006
@@ -1,237 +1,237 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.custom.schedule.renderer;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.el.ValueBinding;
-
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.model.ScheduleDay;
-import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
-import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
-
-/**
- * The default implementation of the ScheduleEntryRenderer
- * 
- * @author Jurgen Lust (latest modification by $Author$)
- * @version $Revision$
- */
-public class DefaultScheduleEntryRenderer implements ScheduleEntryRenderer,
-        Serializable
-{
-    private static final long serialVersionUID = 4987926168243581739L;
-
-    /**
-     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#renderContent(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleDay, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean, boolean)
-     */
-    public void renderContent(FacesContext context, ResponseWriter writer,
-                              HtmlSchedule schedule, ScheduleDay day, ScheduleEntry entry,
-                              boolean compact, boolean selected) throws IOException
-    {
-        if (compact)
-        {
-            StringBuffer text = new StringBuffer();
-            Date startTime = entry.getStartTime();
-
-            if (day.getDayStart().after(entry.getStartTime()))
-            {
-                startTime = day.getDayStart();
-            }
-
-            Date endTime = entry.getEndTime();
-
-            if (day.getDayEnd().before(entry.getEndTime()))
-            {
-                endTime = day.getDayEnd();
-            }
-
-            if (!entry.isAllDay())
-            {
-            	DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT);
-            	text.append(format.format(startTime));
-            	if (!startTime.equals(endTime)) {
-            		text.append("-");
-            		text.append(format.format(endTime));
-            	}
-            	text.append(": ");
-            }
-            text.append(entry.getTitle());
-
-            writer.writeText(text.toString(), null);
-        } else
-        {
-            if (selected)
-            {
-                StringBuffer entryStyle = new StringBuffer();
-                entryStyle.append("height: 100%; width: 100%;");
-                //the left border of a selected entry should have the same
-                //color as the entry border
-                String entryColor = getColor(context, schedule, entry, selected);
-                if (entryColor != null) {
-                    entryStyle.append("border-color: ");
-                    entryStyle.append(entryColor);
-                    entryStyle.append(";");
-                }
-                // draw the contents of the selected entry
-                writer.startElement(HTML.DIV_ELEM, null);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
-                                                                     "text"), null);
-                writer.writeAttribute(HTML.STYLE_ATTR,entryStyle.toString(), null);
-                // write the title of the entry
-                if (entry.getTitle() != null)
-                {
-                    writer.startElement(HTML.SPAN_ELEM, schedule);
-                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
-                            schedule, "title"), null);
-                    writer.writeText(entry.getTitle(), null);
-                    writer.endElement(HTML.SPAN_ELEM);
-                }
-                if (entry.getSubtitle() != null)
-                {
-                    writer.startElement("br", schedule);
-                    writer.endElement("br");
-                    writer.startElement(HTML.SPAN_ELEM, schedule);
-                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
-                            schedule, "subtitle"), null);
-                    writer.writeText(entry.getSubtitle(), null);
-                    writer.endElement(HTML.SPAN_ELEM);
-                }
-
-                writer.endElement(HTML.DIV_ELEM);
-            } else
-            {
-                // write the title
-                if (entry.getTitle() != null)
-                {
-                    writer.startElement(HTML.SPAN_ELEM, schedule);
-                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
-                            schedule, "title"), null);
-                    writer.writeText(entry.getTitle(), null);
-                    writer.endElement(HTML.SPAN_ELEM);
-                }
-                // write the subtitle
-                if (entry.getSubtitle() != null)
-                {
-                    writer.startElement("br", schedule);
-                    writer.endElement("br");
-                    writer.startElement(HTML.SPAN_ELEM, schedule);
-                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
-                            schedule, "subtitle"), null);
-                    writer.writeText(entry.getSubtitle(), null);
-                    writer.endElement(HTML.SPAN_ELEM);
-                }
-            }
-        }
-
-    }
-
-    /**
-     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#getColor(javax.faces.context.FacesContext, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)
-     */
-    public String getColor(FacesContext context, HtmlSchedule schedule,
-                           ScheduleEntry entry, boolean selected)
-    {
-        return null;
-    }
-
-    /**
-     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#renderToolTip(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)
-     */
-    public void renderToolTip(FacesContext context, ResponseWriter writer,
-                              HtmlSchedule schedule, ScheduleEntry entry, boolean selected)
-            throws IOException
-    {
-        StringBuffer buffer = new StringBuffer();
-        buffer
-                .append("return makeTrue(domTT_activate(this, event, 'caption', '");
-
-        if (entry.getTitle() != null)
-        {
-            buffer.append(escape(entry.getTitle()));
-        }
-
-        buffer.append("', 'content', '<i>");
-
-        if (entry.getSubtitle() != null)
-        {
-            buffer.append(escape(entry.getSubtitle()));
-        }
-
-        buffer.append("</i>");
-
-        if (entry.getDescription() != null)
-        {
-            buffer.append("<br/>");
-            buffer.append(escape(entry.getDescription()));
-        }
-
-        buffer.append("', 'trail', true));");
-        writer.writeAttribute("onmouseover", buffer.toString(), null);
-    }
-
-    private String escape(String text)
-    {
-        if (text == null)
-        {
-            return null;
-        }
-
-        return text.replaceAll("'", "\\\\\'").replaceAll("\n", "\\\\n").replaceAll("\r", "\\\\r");
-    }
-
-    /**
-     * <p>
-     * Allow the developer to specify custom CSS classnames for the schedule
-     * component.
-     * </p>
-     * 
-     * @param component
-     *            the component
-     * @param className
-     *            the default CSS classname
-     * @return the custom classname
-     */
-    protected String getStyleClass(UIComponent component, String className)
-    {
-        // first check if the styleClass property is a value binding expression
-        ValueBinding binding = component.getValueBinding(className);
-        if (binding != null)
-        {
-            String value = (String) binding.getValue(FacesContext
-                    .getCurrentInstance());
-
-            if (value != null)
-            {
-                return value;
-            }
-        }
-        // it's not a value binding expression, so check for the string value
-        // in the attributes
-        Map attributes = component.getAttributes();
-        String returnValue = (String) attributes.get(className);
-        return returnValue == null ? className : returnValue;
-    }
-
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.custom.schedule.renderer;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.model.ScheduleDay;
+import org.apache.myfaces.custom.schedule.model.ScheduleEntry;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+
+/**
+ * The default implementation of the ScheduleEntryRenderer
+ * 
+ * @author Jurgen Lust (latest modification by $Author$)
+ * @version $Revision$
+ */
+public class DefaultScheduleEntryRenderer implements ScheduleEntryRenderer,
+        Serializable
+{
+    private static final long serialVersionUID = 4987926168243581739L;
+
+    /**
+     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#renderContent(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleDay, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean, boolean)
+     */
+    public void renderContent(FacesContext context, ResponseWriter writer,
+                              HtmlSchedule schedule, ScheduleDay day, ScheduleEntry entry,
+                              boolean compact, boolean selected) throws IOException
+    {
+        if (compact)
+        {
+            StringBuffer text = new StringBuffer();
+            Date startTime = entry.getStartTime();
+
+            if (day.getDayStart().after(entry.getStartTime()))
+            {
+                startTime = day.getDayStart();
+            }
+
+            Date endTime = entry.getEndTime();
+
+            if (day.getDayEnd().before(entry.getEndTime()))
+            {
+                endTime = day.getDayEnd();
+            }
+
+            if (!entry.isAllDay())
+            {
+            	DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT);
+            	text.append(format.format(startTime));
+            	if (!startTime.equals(endTime)) {
+            		text.append("-");
+            		text.append(format.format(endTime));
+            	}
+            	text.append(": ");
+            }
+            text.append(entry.getTitle());
+
+            writer.writeText(text.toString(), null);
+        } else
+        {
+            if (selected)
+            {
+                StringBuffer entryStyle = new StringBuffer();
+                entryStyle.append("height: 100%; width: 100%;");
+                //the left border of a selected entry should have the same
+                //color as the entry border
+                String entryColor = getColor(context, schedule, entry, selected);
+                if (entryColor != null) {
+                    entryStyle.append("border-color: ");
+                    entryStyle.append(entryColor);
+                    entryStyle.append(";");
+                }
+                // draw the contents of the selected entry
+                writer.startElement(HTML.DIV_ELEM, null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                                                                     "text"), null);
+                writer.writeAttribute(HTML.STYLE_ATTR,entryStyle.toString(), null);
+                // write the title of the entry
+                if (entry.getTitle() != null)
+                {
+                    writer.startElement(HTML.SPAN_ELEM, schedule);
+                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
+                            schedule, "title"), null);
+                    writer.writeText(entry.getTitle(), null);
+                    writer.endElement(HTML.SPAN_ELEM);
+                }
+                if (entry.getSubtitle() != null)
+                {
+                    writer.startElement("br", schedule);
+                    writer.endElement("br");
+                    writer.startElement(HTML.SPAN_ELEM, schedule);
+                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
+                            schedule, "subtitle"), null);
+                    writer.writeText(entry.getSubtitle(), null);
+                    writer.endElement(HTML.SPAN_ELEM);
+                }
+
+                writer.endElement(HTML.DIV_ELEM);
+            } else
+            {
+                // write the title
+                if (entry.getTitle() != null)
+                {
+                    writer.startElement(HTML.SPAN_ELEM, schedule);
+                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
+                            schedule, "title"), null);
+                    writer.writeText(entry.getTitle(), null);
+                    writer.endElement(HTML.SPAN_ELEM);
+                }
+                // write the subtitle
+                if (entry.getSubtitle() != null)
+                {
+                    writer.startElement("br", schedule);
+                    writer.endElement("br");
+                    writer.startElement(HTML.SPAN_ELEM, schedule);
+                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(
+                            schedule, "subtitle"), null);
+                    writer.writeText(entry.getSubtitle(), null);
+                    writer.endElement(HTML.SPAN_ELEM);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#getColor(javax.faces.context.FacesContext, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)
+     */
+    public String getColor(FacesContext context, HtmlSchedule schedule,
+                           ScheduleEntry entry, boolean selected)
+    {
+        return null;
+    }
+
+    /**
+     * @see org.apache.myfaces.custom.schedule.renderer.ScheduleEntryRenderer#renderToolTip(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)
+     */
+    public void renderToolTip(FacesContext context, ResponseWriter writer,
+                              HtmlSchedule schedule, ScheduleEntry entry, boolean selected)
+            throws IOException
+    {
+        StringBuffer buffer = new StringBuffer();
+        buffer
+                .append("return makeTrue(domTT_activate(this, event, 'caption', '");
+
+        if (entry.getTitle() != null)
+        {
+            buffer.append(escape(entry.getTitle()));
+        }
+
+        buffer.append("', 'content', '<i>");
+
+        if (entry.getSubtitle() != null)
+        {
+            buffer.append(escape(entry.getSubtitle()));
+        }
+
+        buffer.append("</i>");
+
+        if (entry.getDescription() != null)
+        {
+            buffer.append("<br/>");
+            buffer.append(escape(entry.getDescription()));
+        }
+
+        buffer.append("', 'trail', true));");
+        writer.writeAttribute("onmouseover", buffer.toString(), null);
+    }
+
+    private String escape(String text)
+    {
+        if (text == null)
+        {
+            return null;
+        }
+
+        return text.replaceAll("'", "\\\\\'").replaceAll("\n", "\\\\n").replaceAll("\r", "\\\\r");
+    }
+
+    /**
+     * <p>
+     * Allow the developer to specify custom CSS classnames for the schedule
+     * component.
+     * </p>
+     * 
+     * @param component
+     *            the component
+     * @param className
+     *            the default CSS classname
+     * @return the custom classname
+     */
+    protected String getStyleClass(UIComponent component, String className)
+    {
+        // first check if the styleClass property is a value binding expression
+        ValueBinding binding = component.getValueBinding(className);
+        if (binding != null)
+        {
+            String value = (String) binding.getValue(FacesContext
+                    .getCurrentInstance());
+
+            if (value != null)
+            {
+                return value;
+            }
+        }
+        // it's not a value binding expression, so check for the string value
+        // in the attributes
+        Map attributes = component.getAttributes();
+        String returnValue = (String) attributes.get(className);
+        return returnValue == null ? className : returnValue;
+    }
+
+}

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/DefaultScheduleEntryRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactMonthRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactMonthRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactMonthRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactMonthRenderer.java Tue Aug  1 10:43:28 2006
@@ -1,169 +1,169 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.custom.schedule.renderer;
-
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.model.ScheduleDay;
-import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
-
-
-/**
- * <p>
- * Renderer for the month view of the Schedule component
- * </p>
- *
- * @author Jurgen Lust (latest modification by $Author: schof $)
- * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
- * @version $Revision: 382051 $
- */
-public class ScheduleCompactMonthRenderer
-    extends AbstractCompactScheduleRenderer
-    implements Serializable
-{
-
-    private static final long serialVersionUID = 2926607881214603314L;
-    
-    //~ Methods ----------------------------------------------------------------
-
-    /**
-     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void encodeBegin(
-        FacesContext context,
-        UIComponent component
-    )
-        throws IOException
-    {
-        if (!component.isRendered()) {
-            return;
-        }
-
-        super.encodeBegin(context, component);
-
-        HtmlSchedule schedule = (HtmlSchedule) component;
-        ResponseWriter writer = context.getResponseWriter();
-
-        //container div for the schedule grid
-        writer.startElement(HTML.DIV_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact-" + getTheme(schedule), null);
-        writer.writeAttribute(
-            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
-        );
-
-        writer.startElement(HTML.TABLE_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "month"), null);
-        writer.writeAttribute(
-            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
-            null
-        );
-        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
-        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
-        writer.writeAttribute("border", "0", null);
-        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
-        writer.startElement(HTML.TBODY_ELEM, schedule);
-
-        Calendar cal = GregorianCalendar.getInstance();
-        cal.setTime(schedule.getModel().getSelectedDate());
-        int selectedMonth = cal.get(Calendar.MONTH);
-
-        for (
-            Iterator dayIterator = schedule.getModel().iterator();
-            dayIterator.hasNext();
-        ) {
-            ScheduleDay day = (ScheduleDay) dayIterator.next();
-            cal.setTime(day.getDate());
-
-            int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
-            int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
-            int currentMonth = cal.get(Calendar.MONTH);
-            boolean isWeekend =
-                (dayOfWeek == Calendar.SATURDAY) ||
-                (dayOfWeek == Calendar.SUNDAY);
-
-            cal.setTime(day.getDate());
-
-            writeDayCell(
-                context, writer, schedule, day, dayOfWeek, dayOfMonth, isWeekend,
-                currentMonth == selectedMonth, isWeekend ? 1 : 2
-            );
-
-        }
-
-        writer.endElement(HTML.TBODY_ELEM);
-        writer.endElement(HTML.TABLE_ELEM);
-
-        writer.endElement(HTML.DIV_ELEM);
-    }
-
-    /**
-     * @see AbstractCompactScheduleRenderer#getDefaultRowHeight()
-     */
-    protected int getDefaultRowHeight()
-    {
-        return 120;
-    }
-
-    /**
-     * @see AbstractCompactScheduleRenderer#getRowHeightProperty()
-     */
-    protected String getRowHeightProperty()
-    {
-        return "compactMonthRowHeight";
-    }
-
-    /**
-     */
-    protected void writeDayCell(
-        FacesContext context,
-        ResponseWriter writer,
-        HtmlSchedule schedule,
-        ScheduleDay day,
-        int dayOfWeek,
-        int dayOfMonth,
-        boolean isWeekend,
-        boolean isCurrentMonth,
-        int rowspan
-    )
-        throws IOException
-    {
-        if ((dayOfWeek == Calendar.MONDAY) || (dayOfWeek == Calendar.SUNDAY)) {
-            writer.startElement(HTML.TR_ELEM, schedule);
-        }
-
-        super.writeDayCell(
-            context, writer, schedule, day, 100f / 6, dayOfWeek, dayOfMonth,
-            isWeekend, isCurrentMonth, rowspan
-        );
-
-        if ((dayOfWeek == Calendar.SATURDAY) || (dayOfWeek == Calendar.SUNDAY)) {
-            writer.endElement(HTML.TR_ELEM);
-        }
-    }
-}
-//The End
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.custom.schedule.renderer;
+
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.model.ScheduleDay;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+
+
+/**
+ * <p>
+ * Renderer for the month view of the Schedule component
+ * </p>
+ *
+ * @author Jurgen Lust (latest modification by $Author: schof $)
+ * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
+ * @version $Revision: 382051 $
+ */
+public class ScheduleCompactMonthRenderer
+    extends AbstractCompactScheduleRenderer
+    implements Serializable
+{
+
+    private static final long serialVersionUID = 2926607881214603314L;
+    
+    //~ Methods ----------------------------------------------------------------
+
+    /**
+     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void encodeBegin(
+        FacesContext context,
+        UIComponent component
+    )
+        throws IOException
+    {
+        if (!component.isRendered()) {
+            return;
+        }
+
+        super.encodeBegin(context, component);
+
+        HtmlSchedule schedule = (HtmlSchedule) component;
+        ResponseWriter writer = context.getResponseWriter();
+
+        //container div for the schedule grid
+        writer.startElement(HTML.DIV_ELEM, schedule);
+        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact-" + getTheme(schedule), null);
+        writer.writeAttribute(
+            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
+        );
+
+        writer.startElement(HTML.TABLE_ELEM, schedule);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "month"), null);
+        writer.writeAttribute(
+            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
+            null
+        );
+        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
+        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
+        writer.writeAttribute("border", "0", null);
+        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
+        writer.startElement(HTML.TBODY_ELEM, schedule);
+
+        Calendar cal = GregorianCalendar.getInstance();
+        cal.setTime(schedule.getModel().getSelectedDate());
+        int selectedMonth = cal.get(Calendar.MONTH);
+
+        for (
+            Iterator dayIterator = schedule.getModel().iterator();
+            dayIterator.hasNext();
+        ) {
+            ScheduleDay day = (ScheduleDay) dayIterator.next();
+            cal.setTime(day.getDate());
+
+            int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
+            int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
+            int currentMonth = cal.get(Calendar.MONTH);
+            boolean isWeekend =
+                (dayOfWeek == Calendar.SATURDAY) ||
+                (dayOfWeek == Calendar.SUNDAY);
+
+            cal.setTime(day.getDate());
+
+            writeDayCell(
+                context, writer, schedule, day, dayOfWeek, dayOfMonth, isWeekend,
+                currentMonth == selectedMonth, isWeekend ? 1 : 2
+            );
+
+        }
+
+        writer.endElement(HTML.TBODY_ELEM);
+        writer.endElement(HTML.TABLE_ELEM);
+
+        writer.endElement(HTML.DIV_ELEM);
+    }
+
+    /**
+     * @see AbstractCompactScheduleRenderer#getDefaultRowHeight()
+     */
+    protected int getDefaultRowHeight()
+    {
+        return 120;
+    }
+
+    /**
+     * @see AbstractCompactScheduleRenderer#getRowHeightProperty()
+     */
+    protected String getRowHeightProperty()
+    {
+        return "compactMonthRowHeight";
+    }
+
+    /**
+     */
+    protected void writeDayCell(
+        FacesContext context,
+        ResponseWriter writer,
+        HtmlSchedule schedule,
+        ScheduleDay day,
+        int dayOfWeek,
+        int dayOfMonth,
+        boolean isWeekend,
+        boolean isCurrentMonth,
+        int rowspan
+    )
+        throws IOException
+    {
+        if ((dayOfWeek == Calendar.MONDAY) || (dayOfWeek == Calendar.SUNDAY)) {
+            writer.startElement(HTML.TR_ELEM, schedule);
+        }
+
+        super.writeDayCell(
+            context, writer, schedule, day, 100f / 6, dayOfWeek, dayOfMonth,
+            isWeekend, isCurrentMonth, rowspan
+        );
+
+        if ((dayOfWeek == Calendar.SATURDAY) || (dayOfWeek == Calendar.SUNDAY)) {
+            writer.endElement(HTML.TR_ELEM);
+        }
+    }
+}
+//The End

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactMonthRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactWeekRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactWeekRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactWeekRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactWeekRenderer.java Tue Aug  1 10:43:28 2006
@@ -1,150 +1,150 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.custom.schedule.renderer;
-
-
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.model.ScheduleDay;
-import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
-
-/**
- * <p>
- * Renderer for the week view of the UISchedule component
- * </p>
- *
- * @author Jurgen Lust (latest modification by $Author: schof $)
- * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
- * @version $Revision: 382051 $
- */
-public class ScheduleCompactWeekRenderer
-    extends AbstractCompactScheduleRenderer
-    implements Serializable
-{
-    private static final long serialVersionUID = 5504081783797695487L;
-
-    //~ Methods ----------------------------------------------------------------
-
-    /**
-     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void encodeBegin(
-        FacesContext context,
-        UIComponent component
-    )
-        throws IOException
-    {
-        if (!component.isRendered()) {
-            return;
-        }
-
-        super.encodeBegin(context, component);
-
-        HtmlSchedule schedule = (HtmlSchedule) component;
-        ResponseWriter writer = context.getResponseWriter();
-
-        //container div for the schedule grid
-        writer.startElement(HTML.DIV_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact-" + getTheme(schedule), null);
-        writer.writeAttribute(
-            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
-        );
-
-        writer.startElement(HTML.TABLE_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "week"), null);
-        writer.writeAttribute(
-            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
-            null
-        );
-        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
-        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
-        writer.writeAttribute("border", "0", null);
-        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
-        writer.startElement(HTML.TBODY_ELEM, schedule);
-
-        Calendar cal = GregorianCalendar.getInstance();
-
-        for (
-            Iterator dayIterator = schedule.getModel().iterator();
-                dayIterator.hasNext();
-        ) {
-            ScheduleDay day = (ScheduleDay) dayIterator.next();
-            cal.setTime(day.getDate());
-
-            int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
-            int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
-            boolean isWeekend =
-                (dayOfWeek == Calendar.SATURDAY) ||
-                (dayOfWeek == Calendar.SUNDAY);
-
-            if (
-                (dayOfWeek == Calendar.MONDAY) ||
-                    (dayOfWeek == Calendar.WEDNESDAY) ||
-                    (dayOfWeek == Calendar.FRIDAY) ||
-                    (dayOfWeek == Calendar.SUNDAY)
-            ) {
-                writer.startElement(HTML.TR_ELEM, schedule);
-            }
-
-            writeDayCell(
-                context, writer, schedule, day, 50f, dayOfWeek, dayOfMonth,
-                isWeekend, true, (dayOfWeek == Calendar.FRIDAY) ? 2 : 1
-            );
-
-            if (
-                (dayOfWeek == Calendar.TUESDAY) ||
-                    (dayOfWeek == Calendar.THURSDAY) ||
-                    (dayOfWeek == Calendar.SATURDAY) ||
-                    (dayOfWeek == Calendar.SUNDAY)
-            ) {
-                writer.endElement(HTML.TR_ELEM);
-            }
-        }
-
-        writer.endElement(HTML.TBODY_ELEM);
-        writer.endElement(HTML.TABLE_ELEM);
-
-        writer.endElement(HTML.DIV_ELEM);
-    }
-
-    /**
-     * @see org.apache.myfaces.custom.schedule.renderer.AbstractCompactScheduleRenderer#getDefaultRowHeight()
-     */
-    protected int getDefaultRowHeight()
-    {
-        return 200;
-    }
-
-    /**
-     * @see org.apache.myfaces.custom.schedule.renderer.AbstractCompactScheduleRenderer#getRowHeightProperty()
-     */
-    protected String getRowHeightProperty()
-    {
-        return "compactWeekRowHeight";
-    }
-}
-//The End
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.custom.schedule.renderer;
+
+
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.model.ScheduleDay;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.HTML;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
+
+/**
+ * <p>
+ * Renderer for the week view of the UISchedule component
+ * </p>
+ *
+ * @author Jurgen Lust (latest modification by $Author: schof $)
+ * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
+ * @version $Revision: 382051 $
+ */
+public class ScheduleCompactWeekRenderer
+    extends AbstractCompactScheduleRenderer
+    implements Serializable
+{
+    private static final long serialVersionUID = 5504081783797695487L;
+
+    //~ Methods ----------------------------------------------------------------
+
+    /**
+     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void encodeBegin(
+        FacesContext context,
+        UIComponent component
+    )
+        throws IOException
+    {
+        if (!component.isRendered()) {
+            return;
+        }
+
+        super.encodeBegin(context, component);
+
+        HtmlSchedule schedule = (HtmlSchedule) component;
+        ResponseWriter writer = context.getResponseWriter();
+
+        //container div for the schedule grid
+        writer.startElement(HTML.DIV_ELEM, schedule);
+        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact-" + getTheme(schedule), null);
+        writer.writeAttribute(
+            HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
+        );
+
+        writer.startElement(HTML.TABLE_ELEM, schedule);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "week"), null);
+        writer.writeAttribute(
+            HTML.STYLE_ATTR, "position: relative; left: 0px; top: 0px; width: 100%;",
+            null
+        );
+        writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
+        writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
+        writer.writeAttribute("border", "0", null);
+        writer.writeAttribute(HTML.WIDTH_ATTR, "100%", null);
+        writer.startElement(HTML.TBODY_ELEM, schedule);
+
+        Calendar cal = GregorianCalendar.getInstance();
+
+        for (
+            Iterator dayIterator = schedule.getModel().iterator();
+                dayIterator.hasNext();
+        ) {
+            ScheduleDay day = (ScheduleDay) dayIterator.next();
+            cal.setTime(day.getDate());
+
+            int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
+            int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
+            boolean isWeekend =
+                (dayOfWeek == Calendar.SATURDAY) ||
+                (dayOfWeek == Calendar.SUNDAY);
+
+            if (
+                (dayOfWeek == Calendar.MONDAY) ||
+                    (dayOfWeek == Calendar.WEDNESDAY) ||
+                    (dayOfWeek == Calendar.FRIDAY) ||
+                    (dayOfWeek == Calendar.SUNDAY)
+            ) {
+                writer.startElement(HTML.TR_ELEM, schedule);
+            }
+
+            writeDayCell(
+                context, writer, schedule, day, 50f, dayOfWeek, dayOfMonth,
+                isWeekend, true, (dayOfWeek == Calendar.FRIDAY) ? 2 : 1
+            );
+
+            if (
+                (dayOfWeek == Calendar.TUESDAY) ||
+                    (dayOfWeek == Calendar.THURSDAY) ||
+                    (dayOfWeek == Calendar.SATURDAY) ||
+                    (dayOfWeek == Calendar.SUNDAY)
+            ) {
+                writer.endElement(HTML.TR_ELEM);
+            }
+        }
+
+        writer.endElement(HTML.TBODY_ELEM);
+        writer.endElement(HTML.TABLE_ELEM);
+
+        writer.endElement(HTML.DIV_ELEM);
+    }
+
+    /**
+     * @see org.apache.myfaces.custom.schedule.renderer.AbstractCompactScheduleRenderer#getDefaultRowHeight()
+     */
+    protected int getDefaultRowHeight()
+    {
+        return 200;
+    }
+
+    /**
+     * @see org.apache.myfaces.custom.schedule.renderer.AbstractCompactScheduleRenderer#getRowHeightProperty()
+     */
+    protected String getRowHeightProperty()
+    {
+        return "compactWeekRowHeight";
+    }
+}
+//The End

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleCompactWeekRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDelegatingRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDelegatingRenderer.java?rev=427657&r1=427656&r2=427657&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDelegatingRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDelegatingRenderer.java Tue Aug  1 10:43:28 2006
@@ -1,112 +1,112 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.custom.schedule.renderer;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.render.Renderer;
-
-import org.apache.myfaces.custom.schedule.HtmlSchedule;
-import org.apache.myfaces.custom.schedule.model.ScheduleModel;
-
-/**
- * <p>
- * Renderer for the Schedule component that delegates the actual rendering
- * to a compact or detailed renderer, depending on the mode of the ScheduleModel
- * </p>
- *
- * @author Jurgen Lust (latest modification by $Author: skitching $)
- * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
- * @version $Revision: 367444 $
- */
-public class ScheduleDelegatingRenderer extends Renderer implements Serializable
-{
-    private static final long serialVersionUID = -837566590780480244L;
-    
-    //~ Instance fields --------------------------------------------------------
-
-    private final ScheduleCompactMonthRenderer monthDelegate = new ScheduleCompactMonthRenderer();
-    private final ScheduleCompactWeekRenderer weekDelegate = new ScheduleCompactWeekRenderer();
-    private final ScheduleDetailedDayRenderer dayDelegate = new ScheduleDetailedDayRenderer();
-
-    //~ Methods ----------------------------------------------------------------
-
-    /**
-     * @see javax.faces.render.Renderer#decode(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void decode(FacesContext context, UIComponent component)
-    {
-        getDelegateRenderer(component).decode(context, component);
-    }
-
-    /**
-     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void encodeBegin(FacesContext context, UIComponent component)
-            throws IOException
-    {
-        getDelegateRenderer(component).encodeBegin(context, component);
-    }
-
-    /**
-     * @see javax.faces.render.Renderer#encodeChildren(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void encodeChildren(FacesContext context, UIComponent component)
-            throws IOException
-    {
-        getDelegateRenderer(component).encodeChildren(context, component);
-    }
-
-    /**
-     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
-     *      javax.faces.component.UIComponent)
-     */
-    public void encodeEnd(FacesContext context, UIComponent component)
-            throws IOException
-    {
-        getDelegateRenderer(component).encodeEnd(context, component);
-    }
-
-    private Renderer getDelegateRenderer(UIComponent component)
-    {
-        HtmlSchedule schedule = (HtmlSchedule) component;
-
-        if ((schedule == null) || (schedule.getModel() == null))
-        {
-            return dayDelegate;
-        }
-
-        switch (schedule.getModel().getMode())
-        {
-        case ScheduleModel.WEEK:
-            return weekDelegate;
-
-        case ScheduleModel.MONTH:
-            return monthDelegate;
-
-        default:
-            return dayDelegate;
-        }
-    }
-}
-//The End
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.custom.schedule.renderer;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;
+
+import org.apache.myfaces.custom.schedule.HtmlSchedule;
+import org.apache.myfaces.custom.schedule.model.ScheduleModel;
+
+/**
+ * <p>
+ * Renderer for the Schedule component that delegates the actual rendering
+ * to a compact or detailed renderer, depending on the mode of the ScheduleModel
+ * </p>
+ *
+ * @author Jurgen Lust (latest modification by $Author: skitching $)
+ * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
+ * @version $Revision: 367444 $
+ */
+public class ScheduleDelegatingRenderer extends Renderer implements Serializable
+{
+    private static final long serialVersionUID = -837566590780480244L;
+    
+    //~ Instance fields --------------------------------------------------------
+
+    private final ScheduleCompactMonthRenderer monthDelegate = new ScheduleCompactMonthRenderer();
+    private final ScheduleCompactWeekRenderer weekDelegate = new ScheduleCompactWeekRenderer();
+    private final ScheduleDetailedDayRenderer dayDelegate = new ScheduleDetailedDayRenderer();
+
+    //~ Methods ----------------------------------------------------------------
+
+    /**
+     * @see javax.faces.render.Renderer#decode(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void decode(FacesContext context, UIComponent component)
+    {
+        getDelegateRenderer(component).decode(context, component);
+    }
+
+    /**
+     * @see javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void encodeBegin(FacesContext context, UIComponent component)
+            throws IOException
+    {
+        getDelegateRenderer(component).encodeBegin(context, component);
+    }
+
+    /**
+     * @see javax.faces.render.Renderer#encodeChildren(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void encodeChildren(FacesContext context, UIComponent component)
+            throws IOException
+    {
+        getDelegateRenderer(component).encodeChildren(context, component);
+    }
+
+    /**
+     * @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext,
+     *      javax.faces.component.UIComponent)
+     */
+    public void encodeEnd(FacesContext context, UIComponent component)
+            throws IOException
+    {
+        getDelegateRenderer(component).encodeEnd(context, component);
+    }
+
+    private Renderer getDelegateRenderer(UIComponent component)
+    {
+        HtmlSchedule schedule = (HtmlSchedule) component;
+
+        if ((schedule == null) || (schedule.getModel() == null))
+        {
+            return dayDelegate;
+        }
+
+        switch (schedule.getModel().getMode())
+        {
+        case ScheduleModel.WEEK:
+            return weekDelegate;
+
+        case ScheduleModel.MONTH:
+            return monthDelegate;
+
+        default:
+            return dayDelegate;
+        }
+    }
+}
+//The End

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDelegatingRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message