You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sc...@apache.org on 2006/02/22 14:09:36 UTC

svn commit: r379762 - in /myfaces/tomahawk/trunk/sandbox: core/src/main/java/org/apache/myfaces/custom/schedule/ core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ core/src/main/tld/entities/ examples/src/main/java/org/apache/myfaces/examp...

Author: schof
Date: Wed Feb 22 05:09:34 2006
New Revision: 379762

URL: http://svn.apache.org/viewcvs?rev=379762&view=rev
Log:
Fixes TOMAHAWK-136 (Patch by Jurgen Lust)

Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractCompactScheduleRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/html_schedule_attributes.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/schedule/ScheduleSettings.java
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/editsettings.jsp
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/example3.jsp

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/ScheduleTag.java Wed Feb 22 05:09:34 2006
@@ -39,6 +39,7 @@
     private String actionListener;
     private String compactMonthRowHeight;
     private String compactWeekRowHeight;
+    private String detailedRowHeight;
     private String headerDateFormat;
     private String immediate;
     private String readonly;
@@ -178,6 +179,26 @@
     }
 
     /**
+     * The height in pixels of a cell in the detailed day view
+     * 
+     * @return the detailedRowHeight
+     */
+    public String getDetailedRowHeight()
+    {
+        return detailedRowHeight;
+    }
+
+    /**
+     * The height in pixels of a cell in the detailed day view
+     * 
+     * @param detailedRowHeight the detailedRowHeight
+     */
+    public void setDetailedRowHeight(String detailedRowHeight)
+    {
+        this.detailedRowHeight = detailedRowHeight;
+    }
+    
+    /**
      * @see javax.faces.webapp.UIComponentTag#getComponentType()
      */
     public String getComponentType()
@@ -720,6 +741,9 @@
         theme = null;
         tooltip = null;
         rendered = null;
+        compactMonthRowHeight = null;
+        compactWeekRowHeight = null;
+        detailedRowHeight = null;
         
         columnClass = null;
         backgroundClass = null;
@@ -903,6 +927,8 @@
                 compactWeekRowHeight);
         addAttribute(app, schedule, "compactMonthRowHeight",
                 compactMonthRowHeight);
+        addAttribute(app, schedule, "detailedRowHeight",
+                detailedRowHeight);
         addAttribute(app, schedule, "column", columnClass);
         addAttribute(app, schedule, "background", backgroundClass);
         addAttribute(app, schedule, "free", freeClass);
@@ -947,5 +973,6 @@
             }
         }
     }
+
 }
 //The End

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractCompactScheduleRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractCompactScheduleRenderer.java?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractCompactScheduleRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractCompactScheduleRenderer.java Wed Feb 22 05:09:34 2006
@@ -67,43 +67,6 @@
     }
 
     /**
-     * @return The default height, in pixels, of one row in the schedule grid
-     */
-    protected abstract int getDefaultRowHeight();
-
-    /**
-     * @return The name of the property that determines the row height
-     */
-    protected abstract String getRowHeightProperty();
-
-    /**
-     * @param attributes
-     *            The attributes
-     * 
-     * @return The row height, in pixels
-     */
-    protected int getRowHeight(Map attributes)
-    {
-        int rowHeight = 0;
-
-        try
-        {
-            rowHeight = Integer.valueOf(
-                    (String) attributes.get(getRowHeightProperty())).intValue();
-        } catch (Exception e)
-        {
-            rowHeight = 0;
-        }
-
-        if (rowHeight == 0)
-        {
-            rowHeight = getDefaultRowHeight();
-        }
-
-        return rowHeight;
-    }
-
-    /**
      * <p>
      * Draw one day in the schedule
      * </p>

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java Wed Feb 22 05:09:34 2006
@@ -46,7 +46,7 @@
  * @author Bruno Aranda (adaptation of Jurgen's code to myfaces)
  * @version $Revision$
  */
-public class AbstractScheduleRenderer extends Renderer
+public abstract class AbstractScheduleRenderer extends Renderer
 {
     //~ Static fields/initializers ---------------------------------------------
 
@@ -97,14 +97,15 @@
         //add needed CSS and Javascript files to the header 
 
         AddResource addResource = AddResourceFactory.getInstance(context);
-        addResource.addStyleSheet(context, AddResource.HEADER_BEGIN, HtmlSchedule.class, css);
+        addResource.addStyleSheet(context, AddResource.HEADER_BEGIN,
+                HtmlSchedule.class, css);
         addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                 HtmlSchedule.class, "javascript/alphaAPI.js");
         addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                 HtmlSchedule.class, "javascript/domLib.js");
         addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                 HtmlSchedule.class, "javascript/domTT.js");
-        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN, 
+        addResource.addJavaScriptAtPosition(context, AddResource.HEADER_BEGIN,
                 HtmlSchedule.class, "javascript/fadomatic.js");
 
         //hidden input field containing the id of the selected entry
@@ -184,7 +185,7 @@
             theme = "default";
         return theme;
     }
-    
+
     /**
      * <p>
      * Allow the developer to specify custom CSS classnames for the schedule
@@ -196,22 +197,23 @@
      */
     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;
+        //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;
     }
 
     /**
@@ -298,27 +300,71 @@
         return Boolean.valueOf((String) attributes.get("tooltip"))
                 .booleanValue();
     }
-    
-    protected ScheduleEntryRenderer getEntryRenderer(UIComponent component){
-        if (entryRenderer != null) return entryRenderer;
+
+    protected ScheduleEntryRenderer getEntryRenderer(UIComponent component)
+    {
+        if (entryRenderer != null)
+            return entryRenderer;
         String className = null;
         ValueBinding binding = component.getValueBinding("entryRenderer");
         if (binding != null)
         {
-            className = (String)binding.getValue(FacesContext.getCurrentInstance());
+            className = (String) binding.getValue(FacesContext
+                    .getCurrentInstance());
         }
-        if (className == null) {
+        if (className == null)
+        {
             Map attributes = component.getAttributes();
             className = (String) attributes.get("entryRenderer");
         }
         try
         {
-            entryRenderer = (ScheduleEntryRenderer)Class.forName(className).newInstance();
-        } catch (Exception e)
+            entryRenderer = (ScheduleEntryRenderer) Class.forName(className)
+                    .newInstance();
+        }
+        catch (Exception e)
         {
             entryRenderer = new DefaultScheduleEntryRenderer();
         }
         return entryRenderer;
+    }
+
+    /**
+     * @return The default height, in pixels, of one row in the schedule grid
+     */
+    protected abstract int getDefaultRowHeight();
+
+    /**
+     * @return The name of the property that determines the row height
+     */
+    protected abstract String getRowHeightProperty();
+
+    /**
+     * @param attributes
+     *            The attributes
+     * 
+     * @return The row height, in pixels
+     */
+    protected int getRowHeight(Map attributes)
+    {
+        int rowHeight = 0;
+
+        try
+        {
+            Integer rowHeightObject = (Integer)attributes.get(getRowHeightProperty());
+            rowHeight = rowHeightObject.intValue();
+        }
+        catch (Exception e)
+        {
+            rowHeight = 0;
+        }
+
+        if (rowHeight == 0)
+        {
+            rowHeight = getDefaultRowHeight();
+        }
+
+        return rowHeight;
     }
 }
 //The End

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/ScheduleDetailedDayRenderer.java Wed Feb 22 05:09:34 2006
@@ -20,6 +20,7 @@
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
+import java.util.Map;
 import java.util.TreeSet;
 
 import javax.faces.component.UIComponent;
@@ -45,7 +46,7 @@
 {
     //~ Instance fields --------------------------------------------------------
 
-    private final int rowHeightInPixels = 22;
+    private final int defaultRowHeightInPixels = 22;
 
     //~ Methods ----------------------------------------------------------------
 
@@ -65,6 +66,7 @@
 
         HtmlSchedule schedule = (HtmlSchedule) component;
         ResponseWriter writer = context.getResponseWriter();
+        int rowHeight = getRowHeight(schedule.getAttributes());
 
         //the number of rows in the grid is the number of half hours between
         //visible start hour and visible end hour, plus 1 for the header
@@ -73,11 +75,12 @@
 
         //the grid height = 22 pixels times the number of rows + 3, for the
         //table border and the cellpadding
-        int gridHeight = (numberOfRows * 22) + 3 + 10;
+        int gridHeight = (numberOfRows * rowHeight) + 3 + 10;
 
         //container div for the schedule grid
         writer.startElement(HTML.DIV_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-detailed-" + getTheme(schedule), null);
+        writer.writeAttribute(HTML.CLASS_ATTR, "schedule-detailed-"
+                + getTheme(schedule), null);
         writer.writeAttribute(HTML.STYLE_ATTR, "height: "
                 + String.valueOf(gridHeight) + "px; overflow: hidden;", null);
         writeBackground(context, schedule, writer);
@@ -104,10 +107,12 @@
         {
             ScheduleDay day = (ScheduleDay) dayIterator.next();
             writer.startElement(HTML.TD_ELEM, schedule);
-            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "column"), null);
+            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                    "column"), null);
             writer.writeAttribute(HTML.STYLE_ATTR, "height: 100%;", null);
             writer.startElement(HTML.DIV_ELEM, schedule);
-            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "column"), null);
+            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                    "column"), null);
             writer
                     .writeAttribute(
                             HTML.STYLE_ATTR,
@@ -225,8 +230,11 @@
     private void writeBackground(FacesContext context, HtmlSchedule schedule,
             ResponseWriter writer) throws IOException
     {
+        final int rowHeight = getRowHeight(schedule.getAttributes()) - 1;
+        final int headerHeight = rowHeight + 10;
         writer.startElement(HTML.DIV_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "background"), null);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                "background"), null);
         writer
                 .writeAttribute(
                         HTML.STYLE_ATTR,
@@ -235,7 +243,8 @@
 
         //background table for the schedule grid
         writer.startElement(HTML.TABLE_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "background"), null);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                "background"), null);
         writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
         writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
         writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%; height: 100%",
@@ -245,11 +254,14 @@
         //header row, containing the column names
         writer.startElement(HTML.TR_ELEM, schedule);
         writer.startElement(HTML.TD_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "gutter"), null);
+        writer.writeAttribute(HTML.CLASS_ATTR,
+                getStyleClass(schedule, "gutter"), null);
         writer
                 .writeAttribute(
                         HTML.STYLE_ATTR,
-                        "height: 21px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
+                        "height: "
+                                + rowHeight
+                                + "px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
                         null);
         writer.startElement(HTML.DIV_ELEM, schedule);
         writer
@@ -266,11 +278,12 @@
         {
             ScheduleDay day = (ScheduleDay) dayIterator.next();
             writer.startElement(HTML.TD_ELEM, schedule);
-            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "header"), null);
+            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                    "header"), null);
             writer
                     .writeAttribute(
                             HTML.STYLE_ATTR,
-                            "height: 31px; border-style: none; border-width: 0px; overflow: hidden;",
+                            "height: " + headerHeight + "px; border-style: none; border-width: 0px; overflow: hidden;",
                             null);
             writer.writeAttribute(HTML.WIDTH_ATTR, String.valueOf(columnWidth)
                     + "%", null);
@@ -283,7 +296,8 @@
 
             //write the date
             writer.startElement(HTML.SPAN_ELEM, schedule);
-            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "date"), null);
+            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                    "date"), null);
             writer
                     .writeAttribute(
                             HTML.STYLE_ATTR,
@@ -298,7 +312,8 @@
                     && (day.getSpecialDayName().length() > 0))
             {
                 writer.startElement(HTML.SPAN_ELEM, schedule);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "holiday"), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "holiday"), null);
                 writer
                         .writeAttribute(
                                 HTML.STYLE_ATTR,
@@ -326,15 +341,19 @@
             if ((row % 2) == 0)
             {
                 writer.startElement(HTML.TD_ELEM, schedule);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "gutter"), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "gutter"), null);
                 writer
                         .writeAttribute(
                                 HTML.STYLE_ATTR,
-                                "height: 21px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
+                                "height: "
+                                        + rowHeight
+                                        + "px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
                                 null);
                 writer.writeAttribute("rowspan", "2", null);
                 writer.startElement(HTML.SPAN_ELEM, schedule);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "hours"), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "hours"), null);
                 writer.writeAttribute(HTML.STYLE_ATTR,
                         "vertical-align: top; height: 100%; padding: 0px;",
                         null);
@@ -342,7 +361,8 @@
                         + (row / 2)), null);
                 writer.endElement(HTML.SPAN_ELEM);
                 writer.startElement(HTML.SPAN_ELEM, schedule);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "minutes"), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "minutes"), null);
                 writer.writeAttribute(HTML.STYLE_ATTR,
                         "vertical-align: top; height: 100%; padding: 0px;",
                         null);
@@ -358,7 +378,7 @@
                 writer.writeAttribute(HTML.CLASS_ATTR, getCellClass(schedule,
                         column, row), null);
                 writer.writeAttribute(HTML.STYLE_ATTR,
-                        "overflow: hidden; height: 21px;", null);
+                        "overflow: hidden; height: " + rowHeight + "px;", null);
                 writer.writeAttribute(HTML.WIDTH_ATTR, String
                         .valueOf(columnWidth)
                         + "%", null);
@@ -420,8 +440,10 @@
             //compose the CSS style for the entry box
             StringBuffer entryStyle = new StringBuffer();
             entryStyle.append(wrapper.getBounds(schedule, columnWidth));
-            String entryBorderColor = getEntryRenderer(schedule).getColor(context, schedule, wrapper.entry, selected); 
-            if (entryBorderColor != null) {
+            String entryBorderColor = getEntryRenderer(schedule).getColor(
+                    context, schedule, wrapper.entry, selected);
+            if (entryBorderColor != null)
+            {
                 entryStyle.append(" border-color: ");
                 entryStyle.append(entryBorderColor);
                 entryStyle.append(";");
@@ -430,17 +452,21 @@
             if (selected)
             {
                 writer.startElement(HTML.DIV_ELEM, schedule);
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "entry-selected"), null);
-                writer.writeAttribute(HTML.STYLE_ATTR, entryStyle.toString(), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "entry-selected"), null);
+                writer.writeAttribute(HTML.STYLE_ATTR, entryStyle.toString(),
+                        null);
 
                 //draw the tooltip
                 if (showTooltip(schedule))
                 {
-                    getEntryRenderer(schedule).renderToolTip(context, writer, schedule, wrapper.entry, selected);
+                    getEntryRenderer(schedule).renderToolTip(context, writer,
+                            schedule, wrapper.entry, selected);
                 }
 
                 //draw the content
-                getEntryRenderer(schedule).renderContent(context, writer, schedule, day, wrapper.entry, false, selected);
+                getEntryRenderer(schedule).renderContent(context, writer,
+                        schedule, day, wrapper.entry, false, selected);
                 writer.endElement(HTML.DIV_ELEM);
             }
             else
@@ -453,7 +479,8 @@
                 //draw the tooltip
                 if (showTooltip(schedule))
                 {
-                    getEntryRenderer(schedule).renderToolTip(context, writer, schedule, wrapper.entry, selected);
+                    getEntryRenderer(schedule).renderToolTip(context, writer,
+                            schedule, wrapper.entry, selected);
                 }
 
                 if (!schedule.isReadonly())
@@ -475,12 +502,15 @@
                             null);
                 }
 
-                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "entry"), null);
-                writer.writeAttribute(HTML.STYLE_ATTR, entryStyle.toString(), null);
+                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                        "entry"), null);
+                writer.writeAttribute(HTML.STYLE_ATTR, entryStyle.toString(),
+                        null);
 
                 //draw the content
-                getEntryRenderer(schedule).renderContent(context, writer, schedule, day, wrapper.entry, false, selected);
-                
+                getEntryRenderer(schedule).renderContent(context, writer,
+                        schedule, day, wrapper.entry, false, selected);
+
                 writer.endElement(schedule.isReadonly() ? HTML.DIV_ELEM : "a");
             }
         }
@@ -497,8 +527,11 @@
     private void writeForegroundStart(FacesContext context,
             HtmlSchedule schedule, ResponseWriter writer) throws IOException
     {
+        final int rowHeight = getRowHeight(schedule.getAttributes()) - 1;
+        final int headerHeight = rowHeight + 10;
         writer.startElement(HTML.DIV_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "foreground"), null);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                "foreground"), null);
         writer
                 .writeAttribute(
                         HTML.STYLE_ATTR,
@@ -506,7 +539,8 @@
                         null);
 
         writer.startElement(HTML.TABLE_ELEM, schedule);
-        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "foreground"), null);
+        writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                "foreground"), null);
         writer.writeAttribute(HTML.CELLSPACING_ATTR, "1", null);
         writer.writeAttribute(HTML.CELLPADDING_ATTR, "0", null);
         writer.writeAttribute(HTML.STYLE_ATTR, "width: 100%; height: 100%",
@@ -528,11 +562,12 @@
         {
             ScheduleDay day = (ScheduleDay) dayIterator.next();
             writer.startElement(HTML.TD_ELEM, schedule);
-            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "header"), null);
+            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
+                    "header"), null);
             writer
                     .writeAttribute(
                             HTML.STYLE_ATTR,
-                            "height: 31px; border-style: none; border-width: 0px; overflow: hidden;",
+                            "height: " + headerHeight + "px; border-style: none; border-width: 0px; overflow: hidden;",
                             null);
             writer.writeAttribute(HTML.WIDTH_ATTR, String.valueOf(columnWidth)
                     + "%", null);
@@ -554,6 +589,16 @@
 
     //~ Inner Classes ----------------------------------------------------------
 
+    protected String getRowHeightProperty()
+    {
+        return "detailedRowHeight";
+    }
+
+    protected int getDefaultRowHeight()
+    {
+        return defaultRowHeightInPixels;
+    }
+
     private class EntryWrapper implements Comparable
     {
         //~ Static fields/initializers -----------------------------------------
@@ -640,6 +685,7 @@
          */
         String getBounds(HtmlSchedule schedule, float columnWidth)
         {
+            int rowHeight = getRowHeight(schedule.getAttributes());
             float width = (columnWidth * colspan) - 0.5f;
             float left = column * columnWidth;
             Calendar cal = GregorianCalendar.getInstance();
@@ -674,13 +720,13 @@
             endMillis = day.equalsDate(entry.getEndTime()) ? Math.min(
                     endMillis, visibleEndMillis) : visibleEndMillis;
 
-            int top = (int) (((startMillis - visibleStartMillis) * rowHeightInPixels) / HALF_HOUR);
-            int height = (int) (((endMillis - startMillis) * rowHeightInPixels) / HALF_HOUR);
+            int top = (int) (((startMillis - visibleStartMillis) * rowHeight) / HALF_HOUR);
+            int height = (int) (((endMillis - startMillis) * rowHeight) / HALF_HOUR);
             StringBuffer buffer = new StringBuffer();
-            
+
             if (height <= 0)
             {
-            	buffer.append("visibility: hidden; ");
+                buffer.append("visibility: hidden; ");
             }
             buffer.append("position: absolute; height: ");
             buffer.append(height);
@@ -692,7 +738,7 @@
             buffer.append(width);
             buffer
                     .append("%; padding: 0px; overflow: hidden; border-width: 1.0px; border-style:solid;");
-            
+
             return buffer.toString();
         }
 

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/html_schedule_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/html_schedule_attributes.xml?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/html_schedule_attributes.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/html_schedule_attributes.xml Wed Feb 22 05:09:34 2006
@@ -11,6 +11,12 @@
          <type>java.lang.Integer</type>
       </attribute>
       <attribute>
+         <name>detailedRowHeight</name>
+         <required>false</required>
+         <rtexprvalue>false</rtexprvalue>
+         <type>java.lang.Integer</type>
+      </attribute>
+      <attribute>
          <name>headerDateFormat</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/schedule/ScheduleSettings.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/schedule/ScheduleSettings.java?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/schedule/ScheduleSettings.java (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/schedule/ScheduleSettings.java Wed Feb 22 05:09:34 2006
@@ -21,16 +21,18 @@
 
 public class ScheduleSettings implements Serializable
 {
-    private ScheduleModel model;
-    
     private static final long serialVersionUID = -8547428935814382762L;
 
     private int compactMonthRowHeight;
 
     private int compactWeekRowHeight;
 
+    private int detailedRowHeight;
+
     private String headerDateFormat;
 
+    private ScheduleModel model;
+
     private boolean readonly;
 
     private String theme;
@@ -55,11 +57,21 @@
         return compactWeekRowHeight;
     }
 
+    public int getDetailedRowHeight()
+    {
+        return detailedRowHeight;
+    }
+
     public String getHeaderDateFormat()
     {
         return headerDateFormat;
     }
 
+    public ScheduleModel getModel()
+    {
+        return model;
+    }
+
     public String getTheme()
     {
         return theme;
@@ -111,11 +123,21 @@
         this.compactWeekRowHeight = compactWeekRowHeight;
     }
 
+    public void setDetailedRowHeight(int detailedRowHeight)
+    {
+        this.detailedRowHeight = detailedRowHeight;
+    }
+
     public void setHeaderDateFormat(String headerDateFormat)
     {
         this.headerDateFormat = headerDateFormat;
     }
 
+    public void setModel(ScheduleModel model)
+    {
+        this.model = model;
+    }
+
     public void setReadonly(boolean readonly)
     {
         this.readonly = readonly;
@@ -149,15 +171,5 @@
     public void setWorkingStartHour(int workingStartHour)
     {
         this.workingStartHour = workingStartHour;
-    }
-
-    public ScheduleModel getModel()
-    {
-        return model;
-    }
-
-    public void setModel(ScheduleModel model)
-    {
-        this.model = model;
     }
 }

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Wed Feb 22 05:09:34 2006
@@ -405,6 +405,10 @@
   			<property-name>compactMonthRowHeight</property-name>
   			<value>100</value>
   		</managed-property>
+  		<managed-property>
+  			<property-name>detailedRowHeight</property-name>
+  			<value>22</value>
+  		</managed-property>
   </managed-bean>
 
   <managed-bean>

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/editsettings.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/editsettings.jsp?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/editsettings.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/editsettings.jsp Wed Feb 22 05:09:34 2006
@@ -93,6 +93,13 @@
 				<f:validateLongRange minimum="50" maximum="150" />
 			</h:inputText>
 			<h:message for="compactMonthRowHeight" />
+			<h:outputLabel for="detailedRowHeight"
+				value="Row height in detailed mode:" />
+			<h:inputText id="detailedRowHeight"
+				value="#{scheduleSettings2.detailedRowHeight}" required="true">
+				<f:validateLongRange minimum="22" maximum="50" />
+			</h:inputText>
+			<h:message for="detailedRowHeight" />
 		</h:panelGrid>
 		<h:panelGrid columns="2">
 			<h:commandButton action="#{scheduleSettings2.save}" value="save" />

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/example3.jsp
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/example3.jsp?rev=379762&r1=379761&r2=379762&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/example3.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/schedule/example3.jsp Wed Feb 22 05:09:34 2006
@@ -38,7 +38,8 @@
 				tooltip="#{scheduleSettings2.tooltip}"
 				headerDateFormat="#{scheduleSettings2.headerDateFormat}"
 				compactWeekRowHeight="#{scheduleSettings2.compactWeekRowHeight}"
-				compactMonthRowHeight="#{scheduleSettings2.compactMonthRowHeight}" />
+				compactMonthRowHeight="#{scheduleSettings2.compactMonthRowHeight}"
+				detailedRowHeight="#{scheduleSettings2.detailedRowHeight}"/>
 		</t:div>
 		<!--  The column on the left, containing the calendar and other controls -->
 		<t:div style="position: absolute; left: 5px; top: 5px; width: 210px;">