Commit 327ce8965c1f45941b5301af893643e7df049842

Authored by bernard
1 parent ab039fd3

Schedule initial import

Showing 40 changed files with 3239 additions and 0 deletions

Too many changes to show.

To preserve performance only 40 of 40+ files are displayed.

  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  3 + xmlns="http://maven.apache.org/POM/4.0.0"
  4 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  5 + <modelVersion>4.0.0</modelVersion>
  6 + <parent>
  7 + <artifactId>ui</artifactId>
  8 + <groupId>org.richfaces.sandbox</groupId>
  9 + <version>3.3.3.Final</version>
  10 + </parent>
  11 + <groupId>org.richfaces.sandbox.ui</groupId>
  12 + <artifactId>schedule</artifactId>
  13 + <name>schedule</name>
  14 + <build>
  15 + <plugins>
  16 + <plugin>
  17 + <groupId>org.richfaces.cdk</groupId>
  18 + <artifactId>maven-cdk-plugin</artifactId>
  19 + <version>${project.version}</version>
  20 + <executions>
  21 + <execution>
  22 + <phase>generate-sources</phase>
  23 + <goals>
  24 + <goal>generate</goal>
  25 + </goals>
  26 + </execution>
  27 + <execution>
  28 + <id>generate-test-sources</id>
  29 + <phase>generate-test-sources</phase>
  30 + <goals>
  31 + <goal>generate-tests</goal>
  32 + </goals>
  33 + </execution>
  34 + </executions>
  35 + <configuration>
  36 + <library>
  37 + <prefix>org.richfaces.ui</prefix>
  38 + <taglib>
  39 + <shortName>schedule</shortName>
  40 + </taglib>
  41 + </library>
  42 + </configuration>
  43 + </plugin>
  44 + <plugin>
  45 + <groupId>org.apache.maven.plugins</groupId>
  46 + <artifactId>maven-surefire-plugin</artifactId>
  47 + <configuration>
  48 + <systemProperties>
  49 + <property>
  50 + <name>displayedDaysForMonthViewCalculationTestData</name>
  51 + <value>${basedir}/src/test/resources/displayedDaysForMonthViewCalculationTestData.txt</value>
  52 + </property>
  53 + <property>
  54 + <name>displayedDaysForWeekViewCalculationTestData</name>
  55 + <value>${basedir}/src/test/resources/displayedDaysForWeekViewCalculationTestData.txt</value>
  56 + </property>
  57 + <property>
  58 + <name>displayedDaysForDayViewCalculationTestData</name>
  59 + <value>${basedir}/src/test/resources/displayedDaysForDayViewCalculationTestData.txt</value>
  60 + </property>
  61 + </systemProperties>
  62 + </configuration>
  63 + </plugin>
  64 + </plugins>
  65 + </build>
  66 + <dependencies>
  67 + <dependency>
  68 + <groupId>org.richfaces.framework</groupId>
  69 + <artifactId>richfaces-impl</artifactId>
  70 + <version>${project.version}</version>
  71 + </dependency>
  72 + </dependencies>
  73 +</project>
  1 +<property>
  2 + <name>timeFormat</name>
  3 + <classname>java.lang.String</classname>
  4 + <description>
  5 + Determines the time-text that will be displayed on each event.
  6 + Time-text will only be displayed for Event Objects that have allDay equal to false.
  7 + default for agendaDay and agendaWeek: 'h:mm{ - h:mm}', // 5:00 - 6:30
  8 + default for all others: 'h(:mm)t' // 7p
  9 + </description>
  10 + <defaultvalue>null</defaultvalue>
  11 +</property>
  12 +<property>
  13 + <name>columnFormat</name>
  14 + <classname>java.lang.String</classname>
  15 + <description>
  16 + Determines the text that will be displayed on the calendar's column headings.
  17 + default for month: 'ddd', // Mon
  18 + default for week: 'ddd M/d', // Mon 9/7
  19 + default for day: 'dddd M/d' // Monday 9/7
  20 + </description>
  21 + <defaultvalue>null</defaultvalue>
  22 +</property>
  23 +<property>
  24 + <name>titleFormat</name>
  25 + <classname>java.lang.String</classname>
  26 + <description>
  27 + Determines the text that will be displayed in the header's title.
  28 + default for month: 'MMMM yyyy', // September 2009
  29 + default for week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}", // Sep 7 - 13 2009
  30 + default for day: 'dddd, MMM d, yyyy' // Tuesday, Sep 8, 2009
  31 + </description>
  32 + <defaultvalue>null</defaultvalue>
  33 +</property>
  34 +<property>
  35 + <name>dragOpacity</name>
  36 + <classname>java.lang.Double</classname>
  37 + <description>
  38 + The opacity of an event while it is being dragged.
  39 + default for agendaWeek: .5
  40 + default for other views: 1
  41 + </description>
  42 + <defaultvalue>null</defaultvalue>
  43 +</property>
  1 +<listener>
  2 + <name>itemSelectedListener</name>
  3 + <property existintag="true" exist="true" el="true" elonly="true">
  4 + <name>binding</name>
  5 + <classname>org.richfaces.scheduleItemSelectedListener</classname>
  6 + <description>The attribute takes a value-binding expression for a component property of
  7 + a backing bean
  8 + </description>
  9 + </property>
  10 + <listenerclass>
  11 + org.richfaces.component.event.ScheduleItemSelectedListener
  12 + </listenerclass>
  13 + <componentclass>
  14 + org.richfaces.component.event.ScheduleListenerEventsProducer
  15 + </componentclass>
  16 + <eventclass>
  17 + org.richfaces.component.event.ScheduleItemSelectedEvent
  18 + </eventclass>
  19 + <taghandler generate="true">
  20 + <classname>
  21 + org.richfaces.taglib.ScheduleItemSelectedListenerTagHandler
  22 + </classname>
  23 + </taghandler>
  24 + <tag generate="true">
  25 + <classname>
  26 + org.richfaces.taglib.ItemSelectedListenerTag
  27 + </classname>
  28 + </tag>
  29 +
  30 + <property existintag="true" exist="true" el="false">
  31 + <name>type</name>
  32 + <classname>java.lang.String</classname>
  33 + <description>The fully qualified Java class name for the listener</description>
  34 + </property>
  35 +</listener>
  36 +
  37 +<listener>
  38 + <name>itemMoveListener</name>
  39 + <property existintag="true" exist="true" el="true" elonly="true">
  40 + <name>binding</name>
  41 + <classname>org.richfaces.scheduleItemMoveListener</classname>
  42 + <description>The attribute takes a value-binding expression for a component property of
  43 + a backing bean
  44 + </description>
  45 + </property>
  46 + <listenerclass>
  47 + org.richfaces.component.event.ScheduleItemMoveListener
  48 + </listenerclass>
  49 + <componentclass>
  50 + org.richfaces.component.event.ScheduleListenerEventsProducer
  51 + </componentclass>
  52 + <eventclass>
  53 + org.richfaces.component.event.ScheduleItemMoveEvent
  54 + </eventclass>
  55 + <taghandler generate="true">
  56 + <classname>
  57 + org.richfaces.taglib.ScheduleItemMoveListenerTagHandler
  58 + </classname>
  59 + </taghandler>
  60 + <tag generate="true">
  61 + <classname>
  62 + org.richfaces.taglib.ItemMoveListenerTag
  63 + </classname>
  64 + </tag>
  65 +
  66 + <property existintag="true" exist="true" el="false">
  67 + <name>type</name>
  68 + <classname>java.lang.String</classname>
  69 + <description>The fully qualified Java class name for the listener</description>
  70 + </property>
  71 +</listener>
  72 +
  73 +<listener>
  74 + <name>itemResizeListener</name>
  75 + <property existintag="true" exist="true" el="true" elonly="true">
  76 + <name>binding</name>
  77 + <classname>org.richfaces.scheduleItemResizeListener</classname>
  78 + <description>The attribute takes a value-binding expression for a component property of
  79 + a backing bean
  80 + </description>
  81 + </property>
  82 + <listenerclass>
  83 + org.richfaces.component.event.ScheduleItemResizeListener
  84 + </listenerclass>
  85 + <componentclass>
  86 + org.richfaces.component.event.ScheduleListenerEventsProducer
  87 + </componentclass>
  88 + <eventclass>
  89 + org.richfaces.component.event.ScheduleItemResizeEvent
  90 + </eventclass>
  91 + <taghandler generate="true">
  92 + <classname>
  93 + org.richfaces.taglib.ScheduleItemResizeListenerTagHandler
  94 + </classname>
  95 + </taghandler>
  96 + <tag generate="true">
  97 + <classname>
  98 + org.richfaces.taglib.ItemResizeListenerTag
  99 + </classname>
  100 + </tag>
  101 +
  102 + <property existintag="true" exist="true" el="false">
  103 + <name>type</name>
  104 + <classname>java.lang.String</classname>
  105 + <description>The fully qualified Java class name for the listener</description>
  106 + </property>
  107 +</listener>
  108 +
  109 +<listener>
  110 + <name>viewChangedListener</name>
  111 + <property existintag="true" exist="true" el="true" elonly="true">
  112 + <name>binding</name>
  113 + <classname>org.richfaces.scheduleViewChangedListener</classname>
  114 + <description>The attribute takes a value-binding expression for a component property of
  115 + a backing bean
  116 + </description>
  117 + </property>
  118 + <listenerclass>
  119 + org.richfaces.component.event.ScheduleViewChangedListener
  120 + </listenerclass>
  121 + <componentclass>
  122 + org.richfaces.component.event.ScheduleListenerEventsProducer
  123 + </componentclass>
  124 + <eventclass>
  125 + org.richfaces.component.event.ScheduleViewChangedEvent
  126 + </eventclass>
  127 + <taghandler generate="true">
  128 + <classname>
  129 + org.richfaces.taglib.ScheduleViewChangedListenerTagHandler
  130 + </classname>
  131 + </taghandler>
  132 + <tag generate="true">
  133 + <classname>
  134 + org.richfaces.taglib.ViewChangedListenerTag
  135 + </classname>
  136 + </tag>
  137 +
  138 + <property existintag="true" exist="true" el="false">
  139 + <name>type</name>
  140 + <classname>java.lang.String</classname>
  141 + <description>The fully qualified Java class name for the listener</description>
  142 + </property>
  143 +</listener>
  144 +
  145 +<listener>
  146 + <name>dateRangeChangedListener</name>
  147 + <property existintag="true" exist="true" el="true" elonly="true">
  148 + <name>binding</name>
  149 + <classname>org.richfaces.scheduleDateRangeChangedListener</classname>
  150 + <description>The attribute takes a value-binding expression for a component property of
  151 + a backing bean
  152 + </description>
  153 + </property>
  154 + <listenerclass>
  155 + org.richfaces.component.event.ScheduleDateRangeChangedListener
  156 + </listenerclass>
  157 + <componentclass>
  158 + org.richfaces.component.event.ScheduleListenerEventsProducer
  159 + </componentclass>
  160 + <eventclass>
  161 + org.richfaces.component.event.ScheduleDateRangeChangedEvent
  162 + </eventclass>
  163 + <taghandler generate="true">
  164 + <classname>
  165 + org.richfaces.taglib.ScheduleDateRangeChangedListenerTagHandler
  166 + </classname>
  167 + </taghandler>
  168 + <tag generate="true">
  169 + <classname>
  170 + org.richfaces.taglib.DateRangeChangedListenerTag
  171 + </classname>
  172 + </tag>
  173 +
  174 + <property existintag="true" exist="true" el="false">
  175 + <name>type</name>
  176 + <classname>java.lang.String</classname>
  177 + <description>The fully qualified Java class name for the listener</description>
  178 + </property>
  179 +</listener>
  180 +
  181 +<listener>
  182 + <name>dateSelectedListener</name>
  183 + <property existintag="true" exist="true" el="true" elonly="true">
  184 + <name>binding</name>
  185 + <classname>org.richfaces.scheduleDateSelectedListener</classname>
  186 + <description>The attribute takes a value-binding expression for a component property of
  187 + a backing bean
  188 + </description>
  189 + </property>
  190 + <listenerclass>
  191 + org.richfaces.component.event.ScheduleDateSelectedListener
  192 + </listenerclass>
  193 + <componentclass>
  194 + org.richfaces.component.event.ScheduleListenerEventsProducer
  195 + </componentclass>
  196 + <eventclass>
  197 + org.richfaces.component.event.ScheduleDateSelectedEvent
  198 + </eventclass>
  199 + <taghandler generate="true">
  200 + <classname>
  201 + org.richfaces.taglib.ScheduleDateSelectedListenerTagHandler
  202 + </classname>
  203 + </taghandler>
  204 + <tag generate="true">
  205 + <classname>
  206 + org.richfaces.taglib.DateSelectedListenerTag
  207 + </classname>
  208 + </tag>
  209 +
  210 + <property existintag="true" exist="true" el="false">
  211 + <name>type</name>
  212 + <classname>java.lang.String</classname>
  213 + <description>The fully qualified Java class name for the listener</description>
  214 + </property>
  215 +</listener>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 + [
  5 + <!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 + <!ENTITY listeners SYSTEM "listeners.ent">
  7 + ]
  8 + >
  9 +<components>
  10 + <component>
  11 + <name>org.richfaces.Schedule</name>
  12 + <family>org.richfaces.Schedule</family>
  13 + <classname>org.richfaces.component.html.HtmlSchedule</classname>
  14 + <superclass>org.richfaces.component.UISchedule</superclass>
  15 + <description>
  16 + <![CDATA[
  17 + ]]>
  18 + </description>
  19 + <renderer generate="true" override="true">
  20 + <name>org.richfaces.renderkit.ScheduleRenderer</name>
  21 + <template>org/richfaces/htmlSchedule.jspx</template>
  22 + <superclass>org.richfaces.renderkit.ScheduleRendererBase</superclass>
  23 + </renderer>
  24 + <tag>
  25 + <name>schedule</name>
  26 + <classname>org.richfaces.taglib.ScheduleTag</classname>
  27 + <superclass>
  28 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  29 + </superclass>
  30 + </tag>
  31 + <taghandler generate="true">
  32 + <classname>org.richfaces.taglib.ScheduleTagHandler</classname>
  33 + <superclass>org.richfaces.taglib.ScheduleTagHandlerBase</superclass>
  34 + </taghandler>
  35 + <!--
  36 + -->
  37 + &ui_component_attributes;
  38 + &commonViewAttributes;
  39 + <!--&ui_data_attributes;-->
  40 + <!--TODO how about reRender ajaxSingle and others?-->
  41 + <!--TODO add style attribute-->
  42 + <property>
  43 + <name>switchType</name>
  44 + <classname>java.lang.String</classname>
  45 + <description>
  46 + Available options:
  47 + <ul>
  48 + <li>ajax</li>
  49 + <li>server</li>
  50 + <li>client</li>
  51 + </ul>
  52 + </description>
  53 + <defaultvalue>"ajax"</defaultvalue>
  54 + </property>
  55 + <property>
  56 + <name>view</name>
  57 + <classname>java.lang.String</classname>
  58 + <description>
  59 + Schedule has a number of different "views",
  60 + or ways of displaying days and events.
  61 + The following 5 views are all built in to schedule:
  62 + <ul>
  63 + <li>month</li>
  64 + <li>basicWeek</li>
  65 + <li>basicDay</li>
  66 + <li>agendaWeek</li>
  67 + <li>agendaDay</li>
  68 + </ul>
  69 + default: 'month'
  70 + </description>
  71 + <defaultvalue>null</defaultvalue>
  72 + </property>
  73 + <property>
  74 + <name>headerLeft</name>
  75 + <classname>java.lang.String</classname>
  76 + <description>
  77 + Defines the buttons and title at the top of the calendar.
  78 + Values separated by a comma will be displayed adjacently.
  79 + Values separated by a space will be displayed with a small gap in between.
  80 + Strings can contain any of the following values:
  81 + <ul>
  82 + <li>
  83 + <b>title</b>
  84 + - text containing the current month/week/day
  85 + </li>
  86 + <li>
  87 + <b>prev</b>
  88 + - button for moving the calendar back one month/week/day
  89 + </li>
  90 + <li>
  91 + <b>next</b>
  92 + - button for moving the calendar forward one month/week/day
  93 + </li>
  94 + <li>
  95 + <b>prevYear</b>
  96 + - button for moving the calendar back on year
  97 + </li>
  98 + <li>
  99 + <b>nextYear</b>
  100 + - button for moving the calendar forward one year
  101 + </li>
  102 + <li>
  103 + <b>today</b>
  104 + - button for moving the calendar to the current month/week/day
  105 + </li>
  106 + <li>
  107 + <i>a view name</i>
  108 + - button that will switch the calendar to any of the available views; see defaultView
  109 + </li>
  110 + </ul>
  111 + default: 'title'
  112 + </description>
  113 + <defaultvalue>null</defaultvalue>
  114 + </property>
  115 + <property>
  116 + <name>headerCenter</name>
  117 + <classname>java.lang.String</classname>
  118 + <description>
  119 + Defines the buttons and title at the top of the calendar.
  120 + Values separated by a comma will be displayed adjacently.
  121 + Values separated by a space will be displayed with a small gap in between.
  122 + Strings can contain any of the following values:
  123 + <ul>
  124 + <li>
  125 + <b>title</b>
  126 + - text containing the current month/week/day
  127 + </li>
  128 + <li>
  129 + <b>prev</b>
  130 + - button for moving the calendar back one month/week/day
  131 + </li>
  132 + <li>
  133 + <b>next</b>
  134 + - button for moving the calendar forward one month/week/day
  135 + </li>
  136 + <li>
  137 + <b>prevYear</b>
  138 + - button for moving the calendar back on year
  139 + </li>
  140 + <li>
  141 + <b>nextYear</b>
  142 + - button for moving the calendar forward one year
  143 + </li>
  144 + <li>
  145 + <b>today</b>
  146 + - button for moving the calendar to the current month/week/day
  147 + </li>
  148 + <li>
  149 + <i>a view name</i>
  150 + - button that will switch the calendar to any of the available views; see defaultView
  151 + </li>
  152 + </ul>
  153 + default: ''
  154 + </description>
  155 + <defaultvalue>null</defaultvalue>
  156 + </property>
  157 + <property>
  158 + <name>headerRight</name>
  159 + <classname>java.lang.String</classname>
  160 + <description>
  161 + Defines the buttons and title at the top of the calendar.
  162 + Values separated by a comma will be displayed adjacently.
  163 + Values separated by a space will be displayed with a small gap in between.
  164 + Strings can contain any of the following values:
  165 + <ul>
  166 + <li>
  167 + <b>title</b>
  168 + - text containing the current month/week/day
  169 + </li>
  170 + <li>
  171 + <b>prev</b>
  172 + - button for moving the calendar back one month/week/day
  173 + </li>
  174 + <li>
  175 + <b>next</b>
  176 + - button for moving the calendar forward one month/week/day
  177 + </li>
  178 + <li>
  179 + <b>prevYear</b>
  180 + - button for moving the calendar back on year
  181 + </li>
  182 + <li>
  183 + <b>nextYear</b>
  184 + - button for moving the calendar forward one year
  185 + </li>
  186 + <li>
  187 + <b>today</b>
  188 + - button for moving the calendar to the current month/week/day
  189 + </li>
  190 + <li>
  191 + <i>a view name</i>
  192 + - button that will switch the calendar to any of the available views; see defaultView
  193 + </li>
  194 + </ul>
  195 + default: 'today prev,next'
  196 + </description>
  197 + <defaultvalue>null</defaultvalue>
  198 + </property>
  199 + <property>
  200 + <name>allDaySlot</name>
  201 + <classname>java.lang.Boolean</classname>
  202 + <description>
  203 + Determines if the "all-day" slot is displayed at the top of the calendar.
  204 + When hidden with false, all-day events will not be displayed in agenda views.
  205 + default: true
  206 + </description>
  207 + <defaultvalue>null</defaultvalue>
  208 + </property>
  209 + <property>
  210 + <name>allDayText</name>
  211 + <classname>java.lang.String</classname>
  212 + <description>
  213 + The text titling the "all-day" slot at the top of the calendar.
  214 + default: 'all-day'
  215 + </description>
  216 + <defaultvalue>null</defaultvalue>
  217 + </property>
  218 + <property>
  219 + <name>axisFormat</name>
  220 + <classname>java.lang.String</classname>
  221 + <description>
  222 + Determines the time-text that will be displayed on the vertical axis of the agenda views.
  223 + The default value will produce times that look like "5pm" and "5:30pm".
  224 + default: 'h(:mm)tt'
  225 + </description>
  226 + <defaultvalue>null</defaultvalue>
  227 + </property>
  228 + <property>
  229 + <name>slotMinutes</name>
  230 + <classname>java.lang.Integer</classname>
  231 + <description>
  232 + The frequency for displaying time slots, in minutes.
  233 + The default will make a slot every half hour.
  234 + default: 30
  235 + </description>
  236 + <defaultvalue>null</defaultvalue>
  237 + </property>
  238 + <property>
  239 + <name>defaultEventMinutes</name>
  240 + <classname>java.lang.Integer</classname>
  241 + <description>
  242 + Determines the length (in minutes) an event appears to be when it has an unspecified end date.
  243 + By default, if an Event Object has no end, it will appear to be 2 hours.
  244 + This option only affects events that appear in the agenda slots, meaning they have allDay set to true.
  245 + default: 120
  246 + </description>
  247 + <defaultvalue>null</defaultvalue>
  248 + </property>
  249 + <property>
  250 + <name>firstHour</name>
  251 + <classname>java.lang.Integer</classname>
  252 + <description>
  253 + Determines the first hour that will be visible in the scroll pane.
  254 + Values must be from 0-23, where 0=midnight, 1=1am, etc.
  255 + The user will be able to scroll upwards to see events before this time.
  256 + If you want to prevent users from doing this, use the minTime option instead.
  257 + default: 6
  258 + </description>
  259 + <defaultvalue>null</defaultvalue>
  260 + </property>
  261 + <property>
  262 + <name>minTime</name>
  263 + <classname>java.lang.String</classname>
  264 + <description>
  265 + Determines the first hour/time that will be displayed, even when the scrollbars have been scrolled all
  266 + the way up.
  267 + This can be a number like 5 (which means 5am), a string like '5:30' (which means 5:30am) or a string
  268 + like '5:30am'.
  269 + default: 0
  270 + </description>
  271 + <defaultvalue>null</defaultvalue>
  272 + </property>
  273 + <property>
  274 + <name>maxTime</name>
  275 + <classname>java.lang.String</classname>
  276 + <description>
  277 + Determines the last hour/time (exclusively) that will be displayed, even when the scrollbars have been
  278 + scrolled all the way down.
  279 + This can be a number like 22 (which means 10pm), a string like '22:30' (which means 10:30pm) or a string
  280 + like '10:30pm'.
  281 + default: 24
  282 + </description>
  283 + <defaultvalue>null</defaultvalue>
  284 + </property>
  285 + <property>
  286 + <name>firstDay</name>
  287 + <classname>java.lang.Integer</classname>
  288 + <description>
  289 + The day that each week begins.
  290 + The value must be a number that represents the day of the week.
  291 + Sunday=0, Monday=1, Tuesday=2, etc.
  292 + default: 0
  293 + </description>
  294 + <defaultvalue>null</defaultvalue>
  295 + </property>
  296 + <property>
  297 + <name>isRTL</name>
  298 + <classname>java.lang.Boolean</classname>
  299 + <description>
  300 + Displays the calendar in right-to-left mode.
  301 + default: false
  302 + </description>
  303 + <defaultvalue>null</defaultvalue>
  304 + </property>
  305 + <property>
  306 + <name>showWeekends</name>
  307 + <classname>java.lang.Boolean</classname>
  308 + <description>
  309 + Whether to include Saturday/Sunday columns in any of the calendar views.
  310 + default: true
  311 + </description>
  312 + <defaultvalue>null</defaultvalue>
  313 + </property>
  314 + <property>
  315 + <name>height</name>
  316 + <classname>java.lang.Integer</classname>
  317 + <description>
  318 + Will make the entire calendar (including header) a pixel height.
  319 + By default, this option is unset and the calendar's height is calculated by aspectRatio.
  320 + </description>
  321 + <defaultvalue>null</defaultvalue>
  322 + </property>
  323 + <property>
  324 + <name>contentHeight</name>
  325 + <classname>java.lang.Integer</classname>
  326 + <description>
  327 + Will make the calendar's content area a pixel height.
  328 + By default, this option is unset and the calendar's height is calculated by aspectRatio.
  329 + </description>
  330 + <defaultvalue>null</defaultvalue>
  331 + </property>
  332 + <property>
  333 + <name>aspectRatio</name>
  334 + <classname>java.lang.Double</classname>
  335 + <description>
  336 + Determines the width-to-height aspect ratio of the calendar.
  337 + A calendar is a block-level element that fills its entire avaiable width. The calendar’s height,
  338 + however, is determined by this ratio of width-to-height. (Hint: larger numbers make smaller heights).
  339 + default: 1.35
  340 + </description>
  341 + <defaultvalue>null</defaultvalue>
  342 + </property>
  343 + <property>
  344 + <name>allDayByDefault</name>
  345 + <classname>java.lang.Boolean</classname>
  346 + <description>
  347 + Determines the default value for each Event Object's allDay property, when it is unspecified.
  348 + default: true
  349 + </description>
  350 + <defaultvalue>null</defaultvalue>
  351 + </property>
  352 +
  353 + <property>
  354 + <name>editable</name>
  355 + <classname>java.lang.Boolean</classname>
  356 + <description>
  357 + Determines whether the events on the calendar can be modified.
  358 + This determines if the events can be dragged and resized.
  359 + Enables/disables both at the same time.
  360 + If you don't want both, use editable in conjunction with disableDragging and disableResizing.
  361 + This option can be overridden on a per-event basis with the Event Object editable property.
  362 + default: false
  363 + </description>
  364 + <defaultvalue>null</defaultvalue>
  365 + </property>
  366 + <property>
  367 + <name>disableDragging</name>
  368 + <classname>java.lang.Boolean</classname>
  369 + <description>
  370 + Disables all event dragging, even when events are editable.
  371 + default: false
  372 + </description>
  373 + <defaultvalue>null</defaultvalue>
  374 + </property>
  375 + <property>
  376 + <name>disableResizing</name>
  377 + <classname>java.lang.Boolean</classname>
  378 + <description>
  379 + Disables all event resizing, even when events are editable.
  380 + default: false
  381 + </description>
  382 + <defaultvalue>null</defaultvalue>
  383 + </property>
  384 + <property>
  385 + <name>dragRevertDuration</name>
  386 + <classname>java.lang.Integer</classname>
  387 + <description>
  388 + Time in millisecond it takes for an event to revert to its original position after an unsuccessful drag.
  389 + default: 500
  390 + </description>
  391 + <defaultvalue>null</defaultvalue>
  392 + </property>
  393 +
  394 + <property>
  395 + <name>date</name>
  396 + <classname>java.util.Date</classname>
  397 + <description>
  398 + The initial date when schedule loads.
  399 + default:
  400 + <i>current date</i>
  401 + </description>
  402 + <defaultvalue>null</defaultvalue>
  403 + </property>
  404 +
  405 + <property>
  406 + <name>onItemSelected</name>
  407 + <classname>java.lang.String</classname>
  408 + <description>
  409 + <!--TODO add description here-->
  410 + </description>
  411 + <defaultvalue>null</defaultvalue>
  412 + </property>
  413 + <property>
  414 + <name>onItemDragStart</name>
  415 + <classname>java.lang.String</classname>
  416 + <description>
  417 + <!--TODO add description here-->
  418 + </description>
  419 + <defaultvalue>null</defaultvalue>
  420 + </property>
  421 + <property>
  422 + <name>onItemDragStop</name>
  423 + <classname>java.lang.String</classname>
  424 + <description>
  425 + <!--TODO add description here-->
  426 + </description>
  427 + <defaultvalue>null</defaultvalue>
  428 + </property>
  429 + <property>
  430 + <name>onItemResizeStart</name>
  431 + <classname>java.lang.String</classname>
  432 + <description>
  433 + <!--TODO add description here-->
  434 + </description>
  435 + <defaultvalue>null</defaultvalue>
  436 + </property>
  437 + <property>
  438 + <name>onItemResizeStop</name>
  439 + <classname>java.lang.String</classname>
  440 + <description>
  441 + <!--TODO add description here-->
  442 + </description>
  443 + <defaultvalue>null</defaultvalue>
  444 + </property>
  445 + <property>
  446 + <name>onItemDrop</name>
  447 + <classname>java.lang.String</classname>
  448 + <description>
  449 + <!--TODO add description here-->
  450 + </description>
  451 + <defaultvalue>null</defaultvalue>
  452 + </property>
  453 + <property>
  454 + <name>onItemResized</name>
  455 + <classname>java.lang.String</classname>
  456 + <description>
  457 + <!--TODO add description here-->
  458 + </description>
  459 + <defaultvalue>null</defaultvalue>
  460 + </property>
  461 + <property>
  462 + <name>onItemMouseover</name>
  463 + <classname>java.lang.String</classname>
  464 + <description>
  465 + <!--TODO add description here-->
  466 + </description>
  467 + <defaultvalue>null</defaultvalue>
  468 + </property>
  469 + <property>
  470 + <name>onItemMouseout</name>
  471 + <classname>java.lang.String</classname>
  472 + <description>
  473 + <!--TODO add description here-->
  474 + </description>
  475 + <defaultvalue>null</defaultvalue>
  476 + </property>
  477 + <property>
  478 + <name>onViewDisplay</name>
  479 + <classname>java.lang.String</classname>
  480 + <description>
  481 + <!--TODO add description here-->
  482 + </description>
  483 + <defaultvalue>null</defaultvalue>
  484 + </property>
  485 + <property>
  486 + <name>onDateSelected</name>
  487 + <classname>java.lang.String</classname>
  488 + <description>
  489 + <!--TODO add description here-->
  490 + </description>
  491 + <defaultvalue>null</defaultvalue>
  492 + </property>
  493 + <property>
  494 + <name>styleClass</name>
  495 + <classname>java.lang.String</classname>
  496 + <description>
  497 + </description>
  498 + <defaultvalue>null</defaultvalue>
  499 + </property>
  500 + <!--TODO what about buttonText and other language dependant stuff? there is so many attributes there-->
  501 +
  502 + <property elonly="true" attachedstate="true">
  503 + <name>itemMoveListener</name>
  504 + <classname>javax.faces.el.MethodBinding</classname>
  505 + <!--<methodargs>org.richfaces.component.event.ScheduleItemMoveEvent</methodargs>-->
  506 + <returntype>boolean</returntype>
  507 + </property>
  508 +
  509 + <property elonly="true" attachedstate="true">
  510 + <name>itemResizeListener</name>
  511 + <classname>javax.faces.el.MethodBinding</classname>
  512 + </property>
  513 +
  514 + <property elonly="true" attachedstate="true">
  515 + <name>itemSelectedListener</name>
  516 + <classname>javax.faces.el.MethodBinding</classname>
  517 + </property>
  518 +
  519 + <property elonly="true" attachedstate="true">
  520 + <name>viewChangedListener</name>
  521 + <classname>javax.faces.el.MethodBinding</classname>
  522 + </property>
  523 +
  524 + <property elonly="true" attachedstate="true">
  525 + <name>dateRangeChangedListener</name>
  526 + <classname>javax.faces.el.MethodBinding</classname>
  527 + </property>
  528 +
  529 + <property elonly="true" attachedstate="true">
  530 + <name>dateSelectedListener</name>
  531 + <classname>javax.faces.el.MethodBinding</classname>
  532 + </property>
  533 +
  534 +
  535 + </component>
  536 + &listeners;
  537 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 +[
  5 +<!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 +]
  7 +>
  8 +<components>
  9 + <component>
  10 + <name>org.richfaces.ScheduleAgendaDayView</name>
  11 + <family>org.richfaces.Schedule</family>
  12 + <classname>org.richfaces.component.html.HtmlScheduleAgendaDayView</classname>
  13 + <superclass>org.richfaces.component.UIScheduleAgendaDayView</superclass>
  14 + <description>
  15 + <![CDATA[
  16 + ]]>
  17 + </description>
  18 + <tag>
  19 + <name>scheduleAgendaDayView</name>
  20 + <classname>org.richfaces.taglib.ScheduleAgendaDayViewTag</classname>
  21 + <superclass>
  22 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  23 + </superclass>
  24 + </tag>
  25 + <!--
  26 + <taghandler>
  27 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  28 + </taghandler>
  29 + -->
  30 + &ui_component_attributes;
  31 + &commonViewAttributes;
  32 + </component>
  33 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 +[
  5 +<!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 +]
  7 +>
  8 +<components>
  9 + <component>
  10 + <name>org.richfaces.ScheduleAgendaWeekView</name>
  11 + <family>org.richfaces.Schedule</family>
  12 + <classname>org.richfaces.component.html.HtmlScheduleAgendaWeekView</classname>
  13 + <superclass>org.richfaces.component.UIScheduleAgendaWeekView</superclass>
  14 + <description>
  15 + <![CDATA[
  16 + ]]>
  17 + </description>
  18 + <tag>
  19 + <name>scheduleAgendaWeekView</name>
  20 + <classname>org.richfaces.taglib.ScheduleAgendaWeekViewTag</classname>
  21 + <superclass>
  22 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  23 + </superclass>
  24 + </tag>
  25 + <!--
  26 + <taghandler>
  27 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  28 + </taghandler>
  29 + -->
  30 + &ui_component_attributes;
  31 + &commonViewAttributes;
  32 + </component>
  33 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 +[
  5 +<!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 +]
  7 +>
  8 +<components>
  9 + <component>
  10 + <name>org.richfaces.ScheduleBasicDayView</name>
  11 + <family>org.richfaces.Schedule</family>
  12 + <classname>org.richfaces.component.html.HtmlScheduleBasicDayView</classname>
  13 + <superclass>org.richfaces.component.UIScheduleBasicDayView</superclass>
  14 + <description>
  15 + <![CDATA[
  16 + ]]>
  17 + </description>
  18 + <tag>
  19 + <name>scheduleBasicDayView</name>
  20 + <classname>org.richfaces.taglib.ScheduleBasicDayViewTag</classname>
  21 + <superclass>
  22 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  23 + </superclass>
  24 + </tag>
  25 + <!--
  26 + <taghandler>
  27 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  28 + </taghandler>
  29 + -->
  30 + &ui_component_attributes;
  31 + &commonViewAttributes;
  32 + </component>
  33 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 +[
  5 +<!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 +]
  7 +>
  8 +<components>
  9 + <component>
  10 + <name>org.richfaces.ScheduleBasicWeekView</name>
  11 + <family>org.richfaces.Schedule</family>
  12 + <classname>org.richfaces.component.html.HtmlScheduleBasicWeekView</classname>
  13 + <superclass>org.richfaces.component.UIScheduleBasicWeekView</superclass>
  14 + <description>
  15 + <![CDATA[
  16 + ]]>
  17 + </description>
  18 + <tag>
  19 + <name>scheduleBasicWeekView</name>
  20 + <classname>org.richfaces.taglib.ScheduleBasicWeekViewTag</classname>
  21 + <superclass>
  22 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  23 + </superclass>
  24 + </tag>
  25 + <!--
  26 + <taghandler>
  27 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  28 + </taghandler>
  29 + -->
  30 + &ui_component_attributes;
  31 + &commonViewAttributes;
  32 + </component>
  33 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
  4 +
  5 +<components>
  6 + <component>
  7 + <name>org.richfaces.ScheduleItem</name>
  8 + <family>org.richfaces.Schedule</family>
  9 + <classname>org.richfaces.component.html.HtmlScheduleItem</classname>
  10 + <superclass>org.richfaces.component.UIScheduleItem</superclass>
  11 + <description>
  12 + <![CDATA[
  13 + ]]>
  14 + </description>
  15 + <tag>
  16 + <name>scheduleItem</name>
  17 + <classname>org.richfaces.taglib.ScheduleItemTag</classname>
  18 + <superclass>
  19 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  20 + </superclass>
  21 + </tag>
  22 + <!--
  23 + <taghandler>
  24 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  25 + </taghandler>
  26 + -->
  27 + &ui_component_attributes;
  28 + <!--
  29 + -->
  30 + <property>
  31 + <name>styleClass</name>
  32 + <classname>java.lang.String</classname>
  33 + <description>
  34 + </description>
  35 + <defaultvalue>null</defaultvalue>
  36 + </property>
  37 + <property required="true">
  38 + <name>startDate</name>
  39 + <classname>java.util.Date</classname>
  40 + <description>
  41 + </description>
  42 + </property>
  43 + <property>
  44 + <name>endDate</name>
  45 + <classname>java.util.Date</classname>
  46 + <description>
  47 + </description>
  48 + </property>
  49 + <property required="true">
  50 + <name>eventId</name>
  51 + <classname>java.lang.String</classname>
  52 + <description>
  53 + </description>
  54 + </property>
  55 + <property required="true">
  56 + <name>title</name>
  57 + <classname>java.lang.String</classname>
  58 + <description>
  59 + </description>
  60 + </property>
  61 + <property>
  62 + <name>allDay</name>
  63 + <classname>java.lang.Boolean</classname>
  64 + <description>
  65 + </description>
  66 + <defaultvalue>null</defaultvalue>
  67 + </property>
  68 + <property>
  69 + <name>url</name>
  70 + <classname>java.lang.String</classname>
  71 + <defaultvalue>null</defaultvalue>
  72 + </property>
  73 + <property>
  74 + <name>editable</name>
  75 + <classname>java.lang.Boolean</classname>
  76 + <defaultvalue>null</defaultvalue>
  77 + </property>
  78 + <!--TODO test data attribute in both scheduleItem and schedule-->
  79 + <property>
  80 + <name>data</name>
  81 + <classname>java.lang.Object</classname>
  82 + <defaultvalue>null</defaultvalue>
  83 + </property>
  84 + </component>
  85 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
  3 + "http://labs.jboss.com/jbossrichfaces/component-config.dtd"
  4 +[
  5 +<!ENTITY commonViewAttributes SYSTEM "commonViewAttributes.ent">
  6 +]
  7 +>
  8 +<components>
  9 + <component>
  10 + <name>org.richfaces.ScheduleMonthView</name>
  11 + <family>org.richfaces.Schedule</family>
  12 + <classname>org.richfaces.component.html.HtmlScheduleMonthView</classname>
  13 + <superclass>org.richfaces.component.UIScheduleMonthView</superclass>
  14 + <description>
  15 + <![CDATA[
  16 + ]]>
  17 + </description>
  18 + <tag>
  19 + <name>scheduleMonthView</name>
  20 + <classname>org.richfaces.taglib.ScheduleMonthViewTag</classname>
  21 + <superclass>
  22 + org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
  23 + </superclass>
  24 + </tag>
  25 + <!--
  26 + <taghandler>
  27 + <classname>org.ajax4jsf.tag.TestHandler</classname>
  28 + </taghandler>
  29 + -->
  30 + &ui_component_attributes;
  31 + &commonViewAttributes;
  32 + <!--
  33 + -->
  34 + <property>
  35 + <name>weekMode</name>
  36 + <classname>java.lang.String</classname>
  37 + <description>
  38 + Determines the number of weeks displayed in a month view. Also determines each week's height.
  39 + Available options:
  40 + <ul>
  41 + <li>
  42 + <b>fixed</b>
  43 + - The calendar will always be 6 weeks tall. The height will always be the same, as determined by
  44 + height, contentHeight, or aspectRatio.
  45 + </li>
  46 + <li>
  47 + <b>liquid</b>
  48 + - The calendar will have either 4, 5, or 6 weeks, depending on the month. The height of the
  49 + weeks will stretch to fill the available height, as determined by height, contentHeight, or
  50 + aspectRatio.
  51 + </li>
  52 + <li>
  53 + <b>variable</b>
  54 + - The calendar will have either 4, 5, or 6 weeks, depending on the month. Each week will have
  55 + the same constant height, meaning the calendar’s height will change month-to-month.
  56 + </li>
  57 + </ul>
  58 + default: 'fixed'
  59 + </description>
  60 + <defaultvalue>null</defaultvalue>
  61 + </property>
  62 + </component>
  63 +</components>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<resource-config>
  3 + <resource class="org.richfaces.renderkit.html.scripts.ScheduleMessages">
  4 + <name>org.richfaces.renderkit.html.scripts.ScheduleMessages</name>
  5 + </resource>
  6 +</resource-config>
  1 +package org.richfaces.component;
  2 +
  3 +public interface ScheduleCommonViewAttributes {
  4 +
  5 + public String getTimeFormat();
  6 +
  7 + public void setTimeFormat(String format);
  8 +
  9 + public String getColumnFormat();
  10 +
  11 + public void setColumnFormat(String format);
  12 +
  13 + public String getTitleFormat();
  14 +
  15 + public void setTitleFormat(String format);
  16 +
  17 + public Double getDragOpacity();
  18 +
  19 + public void setDragOpacity(Double dragOpacity);
  20 +}
  1 +package org.richfaces.component;
  2 +
  3 +import org.richfaces.component.event.ScheduleViewChangedEvent;
  4 +import org.richfaces.component.event.ScheduleDateRangeChangedEvent;
  5 +import org.richfaces.component.event.ScheduleItemResizeEvent;
  6 +import org.richfaces.component.event.ScheduleItemSelectedEvent;
  7 +import org.ajax4jsf.context.AjaxContext;
  8 +import org.ajax4jsf.model.DataVisitor;
  9 +import org.ajax4jsf.model.ExtendedDataModel;
  10 +
  11 +import javax.el.ELContext;
  12 +import javax.el.ValueExpression;
  13 +import javax.faces.component.UIComponent;
  14 +import javax.faces.component.UIComponentBase;
  15 +import javax.faces.context.FacesContext;
  16 +import javax.faces.el.MethodBinding;
  17 +import javax.faces.event.AbortProcessingException;
  18 +import javax.faces.event.FacesEvent;
  19 +import javax.faces.model.*;
  20 +import javax.servlet.jsp.jstl.sql.Result;
  21 +import java.io.IOException;
  22 +import java.sql.ResultSet;
  23 +import java.text.DateFormat;
  24 +import java.text.SimpleDateFormat;
  25 +import java.util.*;
  26 +
  27 +import org.richfaces.component.event.ScheduleDateRangeChangedListener;
  28 +import org.richfaces.component.event.ScheduleDateSelectedEvent;
  29 +import org.richfaces.component.event.ScheduleDateSelectedListener;
  30 +import org.richfaces.component.event.ScheduleItemSelectedListener;
  31 +import org.richfaces.component.event.ScheduleItemMoveEvent;
  32 +import org.richfaces.component.event.ScheduleItemMoveListener;
  33 +import org.richfaces.component.event.ScheduleItemResizeListener;
  34 +import org.richfaces.component.event.ScheduleListenerEventsProducer;
  35 +import org.richfaces.component.event.ScheduleViewChangedListener;
  36 +import org.richfaces.component.model.DateRange;
  37 +
  38 +public abstract class UISchedule extends UIComponentBase implements ScheduleCommonViewAttributes, ScheduleListenerEventsProducer {
  39 +
  40 + public static final String COMPONENT_TYPE = "org.richfaces.Schedule";
  41 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  42 + public static final String VIEW_MONTH = "month";
  43 + public static final String VIEW_BASIC_WEEK = "basicWeek";
  44 + public static final String VIEW_AGENDA_WEEK = "agendaWeek";
  45 + public static final String VIEW_BASIC_DAY = "basicDay";
  46 + public static final String VIEW_AGENDA_DAY = "agendaDay";
  47 + public static final String WEEK_MODE_FIXED = "fixed";
  48 + private DataModel model;
  49 +
  50 + public abstract Object getValue();
  51 +
  52 + public abstract void setValue(Object value);
  53 +
  54 + public abstract String getVar();
  55 +
  56 + public abstract void setVar(String value);
  57 +
  58 + public abstract Date getDate();
  59 +
  60 + public abstract void setDate(Date date);
  61 +
  62 + public abstract String getSwitchType();
  63 +
  64 + public abstract void setSwitchType(String switchType);
  65 +
  66 + public abstract String getView();
  67 +
  68 + public abstract void setView(String defaultView);
  69 +
  70 + public abstract String getHeaderLeft();
  71 +
  72 + public abstract void setHeaderLeft(String headerLeft);
  73 +
  74 + public abstract String getHeaderCenter();
  75 +
  76 + public abstract void setHeaderCenter(String headerCenter);
  77 +
  78 + public abstract String getHeaderRight();
  79 +
  80 + public abstract void setHeaderRight(String headerRight);
  81 +
  82 + public abstract Integer getFirstDay();
  83 +
  84 + public abstract void setFirstDay(Integer firstDay);
  85 +
  86 + public abstract Boolean getIsRTL();
  87 +
  88 + public abstract void setIsRTL(Boolean isrtl);
  89 +
  90 + public abstract Boolean getShowWeekends();
  91 +
  92 + public abstract void setShowWeekends(Boolean showWeekends);
  93 +
  94 + public abstract String getWeekMode();
  95 +
  96 + public abstract void setWeekMode(String weekMode);
  97 +
  98 + public abstract Integer getHeight();
  99 +
  100 + public abstract void setHeight(Integer height);
  101 +
  102 + public abstract Integer getContentHeight();
  103 +
  104 + public abstract void setContentHeight(Integer contentHeight);
  105 +
  106 + public abstract Double getAspectRatio();
  107 +
  108 + public abstract void setAspectRatio(Double aspectRatio);
  109 +
  110 + public abstract Boolean getAllDayByDefault();
  111 +
  112 + public abstract void setAllDayByDefault(Boolean allDayByDefault);
  113 +
  114 + public abstract Boolean getAllDaySlot();
  115 +
  116 + public abstract void setAllDaySlot(Boolean allDaySlot);
  117 +
  118 + public abstract String getAllDayText();
  119 +
  120 + public abstract void setAllDayText(String allDayText);
  121 +
  122 + public abstract String getAxisFormat();
  123 +
  124 + public abstract void setAxisFormat(String axisFormat);
  125 +
  126 + public abstract Integer getSlotMinutes();
  127 +
  128 + public abstract void setSlotMinutes(Integer slotMinutes);
  129 +
  130 + public abstract Integer getDefaultEventMinutes();
  131 +
  132 + public abstract void setDefaultEventMinutes(Integer defaultEventMinutes);
  133 +
  134 + public abstract Integer getFirstHour();
  135 +
  136 + public abstract void setFirstHour(Integer firstHour);
  137 +
  138 + public abstract String getMinTime();
  139 +
  140 + public abstract void setMinTime(String minTime);
  141 +
  142 + public abstract String getMaxTime();
  143 +
  144 + public abstract void setMaxTime(String maxTime);
  145 +
  146 + public abstract Boolean getEditable();
  147 +
  148 + public abstract void setEditable(Boolean editable);
  149 +
  150 + public abstract Boolean getDisableDragging();
  151 +
  152 + public abstract void setDisableDragging(Boolean disableDragging);
  153 +
  154 + public abstract Boolean getDisableResizing();
  155 +
  156 + public abstract void setDisableResizing(Boolean disableResizing);
  157 +
  158 + public abstract Integer getDragRevertDuration();
  159 +
  160 + public abstract void setDragRevertDuration(Integer dragRevertDuration);
  161 +
  162 + public abstract Double getDragOpacity();
  163 +
  164 + public abstract void setDragOpacity(Double dragOpacity);
  165 +
  166 + public abstract String getStyleClass();
  167 +
  168 + public abstract void setStyleClass(String styleClass);
  169 +
  170 + public abstract String getOnItemSelected();
  171 +
  172 + public abstract void setOnItemSelected(String onItemSelect);
  173 +
  174 + public abstract String getOnItemDragStart();
  175 +
  176 + public abstract void setOnItemDragStart(String onItemDragStart);
  177 +
  178 + public abstract String getOnItemDragStop();
  179 +
  180 + public abstract void setOnItemDragStop(String onItemDragStop);
  181 +
  182 + public abstract String getOnItemDrop();
  183 +
  184 + public abstract void setOnItemDrop(String onItemDrop);
  185 +
  186 + public abstract String getOnItemResizeStart();
  187 +
  188 + public abstract void setOnItemResizeStart(String onItemResizeStart);
  189 +
  190 + public abstract String getOnItemResizeStop();
  191 +
  192 + public abstract void setOnItemResizeStop(String onItemResizeStop);
  193 +
  194 + public abstract String getOnItemResized();
  195 +
  196 + public abstract void setOnItemResized(String onItemMouseover);
  197 +
  198 + public abstract String getOnItemMouseover();
  199 +
  200 + public abstract void setOnItemMouseover(String onItemMouseover);
  201 +
  202 + public abstract String getOnItemMouseout();
  203 +
  204 + public abstract void setOnItemMouseout(String onItemMouseout);
  205 +
  206 + public abstract String getOnViewDisplay();
  207 +
  208 + public abstract void setOnViewDisplay(String onViewDisplay);
  209 +
  210 + public abstract String getOnDateSelected();
  211 +
  212 + public abstract void setOnDateSelected(String onDaySelected);
  213 +
  214 + // TODO do we use MethodBinding or MethodExpression?
  215 + public abstract MethodBinding getItemMoveListener();
  216 +
  217 + public abstract void setItemMoveListener(MethodBinding listener);
  218 +
  219 + public abstract MethodBinding getItemSelectedListener();
  220 +
  221 + public abstract void setItemSelectedListener(MethodBinding listener);
  222 +
  223 + public abstract MethodBinding getItemResizeListener();
  224 +
  225 + public abstract void setItemResizeListener(MethodBinding listener);
  226 +
  227 + public abstract MethodBinding getViewChangedListener();
  228 +
  229 + public abstract void setViewChangedListener(MethodBinding listener);
  230 +
  231 + public abstract MethodBinding getDateRangeChangedListener();
  232 +
  233 + public abstract void setDateRangeChangedListener(MethodBinding listener);
  234 +
  235 + public abstract MethodBinding getDateSelectedListener();
  236 +
  237 + public abstract void setDateSelectedListener(MethodBinding listener);
  238 +
  239 + @Override
  240 + public void broadcast(FacesEvent event) throws AbortProcessingException {
  241 + if (event instanceof ScheduleDateRangeChangedEvent) {
  242 + super.broadcast(event);
  243 + ScheduleDateRangeChangedEvent calendarAjaxEvent = (ScheduleDateRangeChangedEvent) event;
  244 + FacesContext facesContext = getFacesContext();
  245 + AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
  246 + MethodBinding expression = getDateRangeChangedListener();
  247 + if (expression != null) {
  248 + expression.invoke(facesContext, new Object[]{event});
  249 + }
  250 + try {
  251 + ajaxContext.getResponseDataMap().put("_ajax:scheduleData", getScheduleData(calendarAjaxEvent.getStartDate(), calendarAjaxEvent.getEndDate()));
  252 + } catch (IOException ex) {
  253 + getFacesContext().getExternalContext().log("Cannot get schedule data", ex);
  254 + }
  255 + } else if (event instanceof ScheduleItemMoveEvent) {
  256 + FacesContext facesContext = getFacesContext();
  257 + AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
  258 + MethodBinding expression = getItemMoveListener();
  259 + boolean allow = true;
  260 + if (expression != null) {
  261 + Object result = expression.invoke(facesContext, new Object[]{event});
  262 + allow = ((Boolean) result);
  263 + }
  264 + ajaxContext.setResponseData(allow);
  265 + super.broadcast(event);
  266 + } else if (event instanceof ScheduleItemResizeEvent) {
  267 + FacesContext facesContext = getFacesContext();
  268 + AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
  269 + MethodBinding expression = getItemResizeListener();
  270 + boolean allow = true;
  271 + if (expression != null) {
  272 + Object result = expression.invoke(facesContext, new Object[]{event});
  273 + allow = ((Boolean) result);
  274 + }
  275 + ajaxContext.setResponseData(allow);
  276 + super.broadcast(event);
  277 + } else if (event instanceof ScheduleItemSelectedEvent) {
  278 + super.broadcast(event);
  279 + FacesContext facesContext = getFacesContext();
  280 + MethodBinding expression = getItemSelectedListener();
  281 + if (expression != null) {
  282 + expression.invoke(facesContext, new Object[]{event});
  283 + }
  284 + } else if (event instanceof ScheduleViewChangedEvent) {
  285 + super.broadcast(event);
  286 + FacesContext facesContext = getFacesContext();
  287 + MethodBinding expression = getViewChangedListener();
  288 + if (expression != null) {
  289 + expression.invoke(facesContext, new Object[]{event});
  290 + }
  291 + } else if (event instanceof ScheduleDateSelectedEvent) {
  292 + super.broadcast(event);
  293 + FacesContext facesContext = getFacesContext();
  294 + MethodBinding expression = getDateSelectedListener();
  295 + if (expression != null) {
  296 + expression.invoke(facesContext, new Object[]{event});
  297 + }
  298 + }
  299 + }
  300 +
  301 + /**
  302 + * Range is [startDate;endDate), which means that start date is inclusive
  303 + * and end date is exclusive.
  304 + *
  305 + * @param startDate
  306 + * @param endDate
  307 + * @return
  308 + * @throws IOException
  309 + */
  310 + public List<Map<String, Object>> getScheduleData(Date startDate, Date endDate) throws IOException {
  311 + /**
  312 + * Locale must be US because this is the format the javascript widget supports
  313 + */
  314 + DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
  315 + format.setLenient(false);
  316 + DataModel dataModel = getDataModel();
  317 + if (dataModel instanceof ExtendedDataModel) {
  318 + DataVisitor visitor = new DataVisitor() {
  319 + //TODO Is this fine? or should we stack rowKeys and not use dataModel later on. I'don't know business rules of extendedDataModel, just used it to did once pagination with underlying EntityQuery from Seam
  320 +
  321 + public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
  322 + }
  323 + };
  324 + ((ExtendedDataModel) dataModel).walk(getFacesContext(), visitor, new DateRange(startDate, endDate), null);
  325 + }
  326 + ELContext elContext = getFacesContext().getELContext();
  327 + ValueExpression valueExpression = getFacesContext().getApplication().getExpressionFactory().createValueExpression(getFacesContext().getELContext(), "#{" + getVar() + "}", Object.class);
  328 + List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
  329 + for (int i = 0; i < dataModel.getRowCount(); i++) {
  330 + dataModel.setRowIndex(i);
  331 + valueExpression.setValue(elContext, dataModel.getRowData());
  332 + Map<String, Object> firstDataElement = new HashMap<String, Object>();
  333 +// TODO shouldn't we check earlier if there is at most one renderable UIScheduleItem child?
  334 + for (UIComponent child : getChildren()) {
  335 + if (child instanceof UIScheduleItem) {
  336 + UIScheduleItem item = (UIScheduleItem) child;
  337 + if (!item.isRendered()) {
  338 + continue;
  339 + }
  340 + firstDataElement.put("id", item.getEventId());
  341 + firstDataElement.put("title", item.getTitle());
  342 + if (item.getAllDay() != null) {
  343 + firstDataElement.put("allDay", item.getAllDay());
  344 + }
  345 + firstDataElement.put("start", format.format(item.getStartDate()));
  346 + if (item.getEndDate() != null) {
  347 + firstDataElement.put("end", format.format(item.getEndDate()));
  348 + }
  349 + if (item.getUrl() != null) {
  350 + firstDataElement.put("url", item.getUrl());
  351 + }
  352 + if (item.getStyleClass() != null) {
  353 + firstDataElement.put("className", item.getStyleClass());
  354 + }
  355 + if (item.getEditable() != null) {
  356 + firstDataElement.put("editable", item.getEditable());
  357 + }
  358 + if (item.getData() != null) {
  359 + firstDataElement.put("data", item.getData());
  360 + }
  361 + data.add(firstDataElement);
  362 + }
  363 + }
  364 + }
  365 + valueExpression.setValue(elContext, null);
  366 + return data;
  367 + }
  368 +
  369 + public static Date getFirstDisplayedDay(UISchedule schedule) {
  370 + Calendar calendar = Calendar.getInstance();
  371 + Date date = schedule.getDate();
  372 + if (date != null) {
  373 + calendar.setTime(date);
  374 + }
  375 + int firstDayOfWeek = getFirstDay(schedule);
  376 + calendar.setFirstDayOfWeek(firstDayOfWeek);
  377 + String view = getView(schedule);
  378 + boolean showWeekends = isShowWeekends(schedule);
  379 + if (VIEW_MONTH.equals(view)) {
  380 + calendar.set(Calendar.DATE, 1);
  381 + if (!showWeekends) {
  382 + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
  383 + if (dayOfWeek == Calendar.SUNDAY) {
  384 + calendar.add(Calendar.DATE, 1);
  385 + } else if (dayOfWeek == Calendar.SATURDAY) {
  386 + calendar.add(Calendar.DATE, 2);
  387 + }
  388 + }
  389 + if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
  390 + firstDayOfWeek++;
  391 + }
  392 + /**
  393 + * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
  394 + */
  395 + calendar.get(Calendar.DAY_OF_WEEK);
  396 + calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
  397 + return calendar.getTime();
  398 + } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
  399 + calendar.set(Calendar.DAY_OF_WEEK, firstDayOfWeek);
  400 + if (!showWeekends) {
  401 + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
  402 + if (dayOfWeek == Calendar.SUNDAY) {
  403 + calendar.add(Calendar.DATE, 1);
  404 + } else if (dayOfWeek == Calendar.SATURDAY) {
  405 + calendar.add(Calendar.DATE, 2);
  406 + }
  407 + }
  408 + return calendar.getTime();
  409 + } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
  410 + return calendar.getTime();
  411 + } else {
  412 + throw new IllegalStateException("Invalid view attribute: " + view);
  413 + }
  414 + }
  415 +
  416 + public static Date getLastDisplayedDate(UISchedule schedule) {
  417 + Calendar calendar = Calendar.getInstance();
  418 + int firstDayOfWeek = getFirstDay(schedule);
  419 + String view = getView(schedule);
  420 + boolean showWeekends = isShowWeekends(schedule);
  421 + if (VIEW_MONTH.equals(view)) {
  422 + if (WEEK_MODE_FIXED.equals(getWeekMode(schedule))) {
  423 + calendar.setTime(getFirstDisplayedDay(schedule));
  424 + calendar.add(Calendar.DAY_OF_YEAR, 7 * 6);
  425 + } else {
  426 + Date date = schedule.getDate();
  427 + if (date != null) {
  428 + calendar.setTime(date);
  429 + }
  430 +
  431 + if (!showWeekends && firstDayOfWeek == Calendar.SUNDAY) {
  432 + firstDayOfWeek++;
  433 + }
  434 + calendar.setFirstDayOfWeek(firstDayOfWeek);
  435 + calendar.set(Calendar.DATE, calendar.getActualMaximum(Calendar.DATE));
  436 + int dayOfWeek = firstDayOfWeek + 6;
  437 + if (dayOfWeek > Calendar.SATURDAY) {
  438 + dayOfWeek -= 7;
  439 + }
  440 + /**
  441 + * Following 1 line is a fix to what i believe is a bug of java.util.Calendar
  442 + */
  443 + calendar.get(Calendar.DAY_OF_WEEK);
  444 + calendar.set(Calendar.DAY_OF_WEEK, dayOfWeek);
  445 + calendar.add(Calendar.DATE, 1);
  446 + }
  447 + return calendar.getTime();
  448 + } else if (VIEW_AGENDA_WEEK.equals(view) || VIEW_BASIC_WEEK.equals(view)) {
  449 + calendar.setFirstDayOfWeek(firstDayOfWeek);
  450 + calendar.setTime(getFirstDisplayedDay(schedule));
  451 + calendar.add(Calendar.DATE, 7);
  452 + if (!showWeekends) {
  453 + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
  454 + if (dayOfWeek - 1 == Calendar.SUNDAY) {
  455 + calendar.add(Calendar.DATE, -2);
  456 + } else if (dayOfWeek - 1 == Calendar.SATURDAY) {
  457 + calendar.add(Calendar.DATE, -1);
  458 + }
  459 + }
  460 + return calendar.getTime();
  461 + } else if (VIEW_AGENDA_DAY.equals(view) || VIEW_BASIC_DAY.equals(view)) {
  462 + calendar.setTime(getFirstDisplayedDay(schedule));
  463 + calendar.add(Calendar.DATE, 1);
  464 + return calendar.getTime();
  465 + } else {
  466 + throw new IllegalStateException("Invalid view attribute: " + view);
  467 + }
  468 +
  469 + }
  470 +
  471 + /**
  472 + * Here go static methods for getting value or default value of attributes.
  473 + */
  474 + /**
  475 + * @param schedule
  476 + * @return
  477 + */
  478 + public static boolean isShowWeekends(UISchedule schedule) {
  479 + Boolean showWeekends = schedule.getShowWeekends();
  480 + return showWeekends == null || schedule.getShowWeekends();
  481 + }
  482 +
  483 + public static int getFirstDay(UISchedule schedule) {
  484 + Integer firstDay = schedule.getFirstDay();
  485 + if (firstDay == null) {
  486 + firstDay = Calendar.SUNDAY;
  487 + }
  488 + return firstDay;
  489 + }
  490 +
  491 + public static String getWeekMode(UISchedule schedule) {
  492 + String weekMode = schedule.getWeekMode();
  493 + if (weekMode == null) {
  494 + weekMode = WEEK_MODE_FIXED;
  495 + }
  496 + return weekMode;
  497 + }
  498 +
  499 + public static String getView(UISchedule schedule) {
  500 + String view = schedule.getView();
  501 + if (view == null) {
  502 + view = VIEW_MONTH;
  503 + }
  504 + return view;
  505 + }
  506 +
  507 + protected DataModel getDataModel() {
  508 + // Return any previously cached DataModel instance
  509 + if (this.model != null) {
  510 + return (model);
  511 + }
  512 +
  513 + // Synthesize a DataModel around our current value if possible
  514 + Object current = getValue();
  515 + if (current == null) {
  516 + setDataModel(new ListDataModel(Collections.EMPTY_LIST));
  517 + } else if (current instanceof DataModel) {
  518 + setDataModel((DataModel) current);
  519 + } else if (current instanceof List) {
  520 + setDataModel(new ListDataModel((List) current));
  521 + } else if (Object[].class.isAssignableFrom(current.getClass())) {
  522 + setDataModel(new ArrayDataModel((Object[]) current));
  523 + } else if (current instanceof ResultSet) {
  524 + setDataModel(new ResultSetDataModel((ResultSet) current));
  525 + } else if (current instanceof Result) {
  526 + setDataModel(new ResultDataModel((Result) current));
  527 + } else {
  528 + setDataModel(new ScalarDataModel(current));
  529 + }
  530 + return (model);
  531 +
  532 + }
  533 +
  534 + public void setDataModel(DataModel model) {
  535 + this.model = model;
  536 + }
  537 +
  538 + public void addItemSelectedListener(ScheduleItemSelectedListener listener) {
  539 + addFacesListener(listener);
  540 + }
  541 +
  542 + public void removeItemSelectedListener(ScheduleItemSelectedListener listener) {
  543 + removeFacesListener(listener);
  544 + }
  545 +
  546 + public ScheduleItemSelectedListener[] getItemSelectedListeners() {
  547 + return (ScheduleItemSelectedListener[]) getFacesListeners(ScheduleItemSelectedListener.class);
  548 + }
  549 +
  550 + public void addItemMoveListener(ScheduleItemMoveListener listener) {
  551 + addFacesListener(listener);
  552 + }
  553 +
  554 + public void removeItemMoveListener(ScheduleItemMoveListener listener) {
  555 + removeFacesListener(listener);
  556 + }
  557 +
  558 + public ScheduleItemMoveListener[] getItemMoveListeners() {
  559 + return (ScheduleItemMoveListener[]) getFacesListeners(ScheduleItemMoveListener.class);
  560 + }
  561 +
  562 + public void addItemResizeListener(ScheduleItemResizeListener listener) {
  563 + addFacesListener(listener);
  564 + }
  565 +
  566 + public void removeItemResizeListener(ScheduleItemResizeListener listener) {
  567 + removeFacesListener(listener);
  568 + }
  569 +
  570 + public ScheduleItemResizeListener[] getItemResizeListeners() {
  571 + return (ScheduleItemResizeListener[]) getFacesListeners(ScheduleItemResizeListener.class);
  572 + }
  573 +
  574 + public void addViewChangedListener(ScheduleViewChangedListener listener) {
  575 + addFacesListener(listener);
  576 + }
  577 +
  578 + public void removeViewChangedListener(ScheduleViewChangedListener listener) {
  579 + removeFacesListener(listener);
  580 + }
  581 +
  582 + public ScheduleViewChangedListener[] getViewChangedListeners() {
  583 + return (ScheduleViewChangedListener[]) getFacesListeners(ScheduleViewChangedListener.class);
  584 + }
  585 +
  586 + public void addDateRangeChangedListener(ScheduleDateRangeChangedListener listener) {
  587 + addFacesListener(listener);
  588 + }
  589 +
  590 + public void removeDateRangeChangedListener(ScheduleDateRangeChangedListener listener) {
  591 + removeFacesListener(listener);
  592 + }
  593 +
  594 + public ScheduleDateRangeChangedListener[] getDateRangeChangedListeners() {
  595 + return (ScheduleDateRangeChangedListener[]) getFacesListeners(ScheduleDateRangeChangedListener.class);
  596 + }
  597 +
  598 + public void addDateSelectedListener(ScheduleDateSelectedListener listener) {
  599 + addFacesListener(listener);
  600 + }
  601 +
  602 + public void removeDateSelectedListener(ScheduleDateSelectedListener listener) {
  603 + removeFacesListener(listener);
  604 + }
  605 +
  606 + public ScheduleDateSelectedListener[] getDateSelectedListeners() {
  607 + return (ScheduleDateSelectedListener[]) getFacesListeners(ScheduleDateSelectedListener.class);
  608 + }
  609 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +
  5 +public abstract class UIScheduleAgendaDayView extends UIComponentBase implements ScheduleCommonViewAttributes {
  6 +
  7 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleAgendaDayView";
  8 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  9 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +
  5 +public abstract class UIScheduleAgendaWeekView extends UIComponentBase implements ScheduleCommonViewAttributes {
  6 +
  7 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleAgendaWeekView";
  8 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  9 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +
  5 +public abstract class UIScheduleBasicDayView extends UIComponentBase implements ScheduleCommonViewAttributes{
  6 +
  7 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleBasicDayView";
  8 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  9 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +
  5 +public abstract class UIScheduleBasicWeekView extends UIComponentBase implements ScheduleCommonViewAttributes {
  6 +
  7 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleBasicWeekView";
  8 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  9 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + * JSF component class
  8 + */
  9 +public abstract class UIScheduleItem extends UIComponentBase {
  10 +
  11 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleItem";
  12 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  13 +
  14 + public abstract String getStyleClass();
  15 +
  16 + public abstract void setStyleClass(String styleClass);
  17 +
  18 + public abstract String getTitle();
  19 +
  20 + public abstract void setTitle(String title);
  21 +
  22 + public abstract Date getStartDate();
  23 +
  24 + public abstract void setStartDate(Date date);
  25 +
  26 + public abstract Date getEndDate();
  27 +
  28 + public abstract void setEndDate(Date date);
  29 +
  30 + public abstract String getEventId();
  31 +
  32 + public abstract void setEventId(String eventId);
  33 +
  34 + public abstract Boolean getAllDay();
  35 +
  36 + public abstract void setAllDay(Boolean isAllDay);
  37 +
  38 + public abstract String getUrl();
  39 +
  40 + public abstract void setUrl(String url);
  41 +
  42 + public abstract Boolean getEditable();
  43 +
  44 + public abstract void setEditable(Boolean editable);
  45 +
  46 + public abstract Object getData();
  47 +
  48 + public abstract void setData(Object data);
  49 +}
  1 +package org.richfaces.component;
  2 +
  3 +import javax.faces.component.UIComponentBase;
  4 +
  5 +public abstract class UIScheduleMonthView extends UIComponentBase implements ScheduleCommonViewAttributes {
  6 +
  7 + public static final String COMPONENT_TYPE = "org.richfaces.ScheduleMonthView";
  8 + public static final String COMPONENT_FAMILY = "org.richfaces.Schedule";
  9 +
  10 + public abstract String getWeekMode();
  11 +
  12 + public abstract void setWeekMode(String mode);
  13 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.faces.component.UIComponent;
  6 +
  7 +import javax.faces.event.FacesEvent;
  8 +import javax.faces.event.FacesListener;
  9 +
  10 +public class ScheduleDateRangeChangedEvent extends FacesEvent {
  11 +
  12 + private Date startDate;
  13 + private Date endDate;
  14 +
  15 + public ScheduleDateRangeChangedEvent(UIComponent component, Date startDate, Date endDate) {
  16 + super(component);
  17 + this.startDate = startDate;
  18 + this.endDate = endDate;
  19 + }
  20 +
  21 + public Date getStartDate() {
  22 + return startDate;
  23 + }
  24 +
  25 + public Date getEndDate() {
  26 + return endDate;
  27 + }
  28 +
  29 + @Override
  30 + public String toString() {
  31 + return getClass().getSimpleName() + "[startDate=" + startDate + ";endDate=" + endDate + "]";
  32 + }
  33 +
  34 + @Override
  35 + public boolean isAppropriateListener(FacesListener listener) {
  36 + return listener instanceof ScheduleDateRangeChangedListener;
  37 + }
  38 +
  39 + @Override
  40 + public void processListener(FacesListener listener) {
  41 + ((ScheduleDateRangeChangedListener) listener).dateRangeChanged(this);
  42 + }
  43 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleDateRangeChangedListener extends FacesListener {
  6 +
  7 + void dateRangeChanged(ScheduleDateRangeChangedEvent event);
  8 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import java.util.Date;
  4 +import javax.faces.component.UIComponent;
  5 +import javax.faces.event.FacesEvent;
  6 +import javax.faces.event.FacesListener;
  7 +
  8 +public class ScheduleDateSelectedEvent extends FacesEvent {
  9 +
  10 + private Date date;
  11 + private boolean allDay;
  12 +
  13 + public ScheduleDateSelectedEvent(UIComponent component, Date date, boolean allDay) {
  14 + super(component);
  15 + this.date = date;
  16 + this.allDay = allDay;
  17 + }
  18 +
  19 + public boolean isAppropriateListener(FacesListener facesListener) {
  20 + return facesListener instanceof ScheduleDateSelectedListener;
  21 + }
  22 +
  23 + public void processListener(FacesListener facesListener) {
  24 + ((ScheduleDateSelectedListener) facesListener).dateSelected(this);
  25 + }
  26 +
  27 + public Date getDate() {
  28 + return date;
  29 + }
  30 +
  31 + public boolean isAllDay() {
  32 + return allDay;
  33 + }
  34 +
  35 + @Override
  36 + public String toString() {
  37 + return getClass().getSimpleName() + "[date=" + date + ";allDay=" + allDay + "]";
  38 + }
  39 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleDateSelectedListener extends FacesListener {
  6 +
  7 + void dateSelected(ScheduleDateSelectedEvent event);
  8 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.component.UIComponent;
  4 +import javax.faces.event.FacesEvent;
  5 +import javax.faces.event.FacesListener;
  6 +
  7 +public class ScheduleItemMoveEvent extends FacesEvent {
  8 +
  9 + private String eventId;
  10 + private int dayDelta;
  11 + private int minuteDelta;
  12 + private boolean allDay;
  13 +
  14 + public ScheduleItemMoveEvent(UIComponent component, String eventId, int dayDelta, int minuteDelta, boolean allDay) {
  15 + super(component);
  16 + this.eventId = eventId;
  17 + this.dayDelta = dayDelta;
  18 + this.minuteDelta = minuteDelta;
  19 + this.allDay = allDay;
  20 + }
  21 +
  22 + public boolean isAppropriateListener(FacesListener facesListener) {
  23 + return facesListener instanceof ScheduleItemMoveListener;
  24 + }
  25 +
  26 + public void processListener(FacesListener facesListener) {
  27 + ((ScheduleItemMoveListener) facesListener).itemMove(this);
  28 + }
  29 +
  30 + public String getEventId() {
  31 + return eventId;
  32 + }
  33 +
  34 + public int getDayDelta() {
  35 + return dayDelta;
  36 + }
  37 +
  38 + public int getMinuteDelta() {
  39 + return minuteDelta;
  40 + }
  41 +
  42 + public boolean isAllDay() {
  43 + return allDay;
  44 + }
  45 +
  46 + @Override
  47 + public String toString() {
  48 + return getClass().getSimpleName() + "[eventId=" + eventId + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + ";allDay=" + allDay + "]";
  49 + }
  50 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleItemMoveListener extends FacesListener{
  6 +
  7 + void itemMove(ScheduleItemMoveEvent event);
  8 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.component.UIComponent;
  4 +import javax.faces.event.FacesEvent;
  5 +import javax.faces.event.FacesListener;
  6 +
  7 +public class ScheduleItemResizeEvent extends FacesEvent {
  8 +
  9 + private String eventId;
  10 + private int dayDelta;
  11 + private int minuteDelta;
  12 +
  13 + public ScheduleItemResizeEvent(UIComponent component, String eventId, int dayDelta, int minuteDelta) {
  14 + super(component);
  15 + this.eventId = eventId;
  16 + this.dayDelta = dayDelta;
  17 + this.minuteDelta = minuteDelta;
  18 + }
  19 +
  20 + public boolean isAppropriateListener(FacesListener facesListener) {
  21 + return facesListener instanceof ScheduleItemResizeListener;
  22 + }
  23 +
  24 + public void processListener(FacesListener facesListener) {
  25 + ((ScheduleItemResizeListener) facesListener).itemResize(this);
  26 + }
  27 +
  28 + public String getEventId() {
  29 + return eventId;
  30 + }
  31 +
  32 + public int getDayDelta() {
  33 + return dayDelta;
  34 + }
  35 +
  36 + public int getMinuteDelta() {
  37 + return minuteDelta;
  38 + }
  39 +
  40 + @Override
  41 + public String toString() {
  42 + return getClass().getSimpleName() + "[eventId=" + eventId + ";dayDelta=" + dayDelta + ";minuteDelta=" + minuteDelta + "]";
  43 + }
  44 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleItemResizeListener extends FacesListener{
  6 +
  7 + void itemResize(ScheduleItemResizeEvent event);
  8 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.component.UIComponent;
  4 +import javax.faces.event.FacesEvent;
  5 +import javax.faces.event.FacesListener;
  6 +
  7 +public class ScheduleItemSelectedEvent extends FacesEvent {
  8 +
  9 + private String eventId;
  10 +
  11 + public ScheduleItemSelectedEvent(UIComponent component, String eventId) {
  12 + super(component);
  13 + this.eventId = eventId;
  14 + }
  15 +
  16 + public boolean isAppropriateListener(FacesListener facesListener) {
  17 + return facesListener instanceof ScheduleItemSelectedListener;
  18 + }
  19 +
  20 + public void processListener(FacesListener facesListener) {
  21 + ((ScheduleItemSelectedListener) facesListener).itemSelected(this);
  22 + }
  23 +
  24 + public String getEventId() {
  25 + return eventId;
  26 + }
  27 +
  28 + @Override
  29 + public String toString() {
  30 + return getClass().getSimpleName() + "[eventId=" + eventId + "]";
  31 + }
  32 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleItemSelectedListener extends FacesListener {
  6 +
  7 + public void itemSelected(ScheduleItemSelectedEvent event);
  8 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +public interface ScheduleListenerEventsProducer {
  4 +
  5 + void addItemSelectedListener(ScheduleItemSelectedListener listener);
  6 + void removeItemSelectedListener(ScheduleItemSelectedListener listener);
  7 + ScheduleItemSelectedListener[] getItemSelectedListeners();
  8 +
  9 + void addItemMoveListener(ScheduleItemMoveListener listener);
  10 + void removeItemMoveListener(ScheduleItemMoveListener listener);
  11 + ScheduleItemMoveListener[] getItemMoveListeners();
  12 +
  13 + void addItemResizeListener(ScheduleItemResizeListener listener);
  14 + void removeItemResizeListener(ScheduleItemResizeListener listener);
  15 + ScheduleItemResizeListener[] getItemResizeListeners();
  16 +
  17 + void addViewChangedListener(ScheduleViewChangedListener listener);
  18 + void removeViewChangedListener(ScheduleViewChangedListener listener);
  19 + ScheduleViewChangedListener[] getViewChangedListeners();
  20 +
  21 + void addDateRangeChangedListener(ScheduleDateRangeChangedListener listener);
  22 + void removeDateRangeChangedListener(ScheduleDateRangeChangedListener listener);
  23 + ScheduleDateRangeChangedListener[] getDateRangeChangedListeners();
  24 +
  25 + void addDateSelectedListener(ScheduleDateSelectedListener listener);
  26 + void removeDateSelectedListener(ScheduleDateSelectedListener listener);
  27 + ScheduleDateSelectedListener[] getDateSelectedListeners();
  28 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.component.UIComponent;
  4 +import javax.faces.event.FacesEvent;
  5 +import javax.faces.event.FacesListener;
  6 +
  7 +public class ScheduleViewChangedEvent extends FacesEvent {
  8 +
  9 + private String view;
  10 +
  11 + public ScheduleViewChangedEvent(UIComponent component, String view) {
  12 + super(component);
  13 + this.view = view;
  14 + }
  15 +
  16 + public boolean isAppropriateListener(FacesListener facesListener) {
  17 + return facesListener instanceof ScheduleViewChangedListener;
  18 + }
  19 +
  20 + public void processListener(FacesListener facesListener) {
  21 + ((ScheduleViewChangedListener) facesListener).viewChanged(this);
  22 + }
  23 +
  24 + public String getView() {
  25 + return view;
  26 + }
  27 +
  28 + @Override
  29 + public String toString() {
  30 + return getClass().getSimpleName() + "[view=" + view + "]";
  31 + }
  32 +}
  1 +package org.richfaces.component.event;
  2 +
  3 +import javax.faces.event.FacesListener;
  4 +
  5 +public interface ScheduleViewChangedListener extends FacesListener{
  6 +
  7 + void viewChanged(ScheduleViewChangedEvent event);
  8 +}
  1 +package org.richfaces.component.model;
  2 +
  3 +import java.util.Date;
  4 +import org.ajax4jsf.model.Range;
  5 +
  6 +public class DateRange implements Range {
  7 +
  8 + private Date startDate;
  9 + private Date endDate;
  10 +
  11 + public DateRange() {
  12 + }
  13 +
  14 + public DateRange(Date startDate, Date endDate) {
  15 + setStartDate(startDate);
  16 + setEndDate(endDate);
  17 + }
  18 +
  19 + public Date getStartDate() {
  20 + return startDate;
  21 + }
  22 +
  23 + public void setStartDate(Date startDate) {
  24 + this.startDate = startDate;
  25 + }
  26 +
  27 + public Date getEndDate() {
  28 + return endDate;
  29 + }
  30 +
  31 + public void setEndDate(Date endDate) {
  32 + this.endDate = endDate;
  33 + }
  34 +}
  1 +package org.richfaces.renderkit;
  2 +
  3 +import java.util.Locale;
  4 +import org.richfaces.component.event.ScheduleViewChangedEvent;
  5 +import org.richfaces.component.event.ScheduleDateRangeChangedEvent;
  6 +import org.richfaces.component.event.ScheduleItemResizeEvent;
  7 +import org.richfaces.component.event.ScheduleItemSelectedEvent;
  8 +import org.ajax4jsf.javascript.JSFunction;
  9 +import org.ajax4jsf.javascript.JSFunctionDefinition;
  10 +import org.ajax4jsf.javascript.JSObject;
  11 +import org.ajax4jsf.javascript.JSReference;
  12 +import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
  13 +import org.ajax4jsf.renderkit.AjaxRendererUtils;
  14 +import org.richfaces.component.*;
  15 +
  16 +import javax.faces.component.NamingContainer;
  17 +import javax.faces.component.UIComponent;
  18 +import javax.faces.context.FacesContext;
  19 +import javax.faces.context.ResponseWriter;
  20 +import java.io.IOException;
  21 +import java.util.Calendar;
  22 +import java.util.Date;
  23 +import java.util.HashMap;
  24 +import java.util.Map;
  25 +
  26 +import javax.faces.FacesException;
  27 +
  28 +import org.richfaces.component.event.ScheduleDateSelectedEvent;
  29 +import org.richfaces.component.event.ScheduleItemMoveEvent;
  30 +
  31 +public abstract class ScheduleRendererBase extends AjaxComponentRendererBase {
  32 +
  33 + public static final String ITEM_MOVE_EVENT = "itemMove";
  34 + public static final String ITEM_RESIZE_EVENT = "itemResize";
  35 + public static final String ITEM_SELECTED_EVENT = "itemSelected";
  36 + public static final String DATE_RANGE_CHANGED_EVENT = "dateRangeChanged";
  37 + public static final String VIEW_CHANGED_EVENT = "viewChanged";
  38 + public static final String DATE_SELECTED_EVENT = "dateSelected";
  39 + public static final String AJAX_MODE = "ajax";
  40 + public static final String SERVER_MODE = "server";
  41 + public static final String CLIENT_MODE = "client";
  42 + private static final String CALLBACK = "callback";
  43 + private static final String END_DATE_PARAM = "endDate";
  44 + private static final String START_DATE_PARAM = "startDate";
  45 + private static final String ITEM_ID_PARAM = "itemId";
  46 + private static final String DAY_DELTA_PARAM = "dayDelta";
  47 + private static final String MINUTE_DELTA_PARAM = "minuteDelta";
  48 + private static final String ALL_DAY_PARAM = "allDay";
  49 + private static final String EVENT_TYPE_PARAM = "eventType";
  50 + private static final String VIEW_PARAM = "view";
  51 +
  52 + protected Object createSubmitEventFunction(FacesContext context, UISchedule component) {
  53 + JSFunction jsFunction = null;
  54 + Map<String, Object> params = new HashMap<String, Object>();
  55 + params.put(getFieldId(context, component, START_DATE_PARAM), new JSReference(START_DATE_PARAM));
  56 + params.put(getFieldId(context, component, END_DATE_PARAM), new JSReference(END_DATE_PARAM));
  57 + params.put(getFieldId(context, component, ITEM_ID_PARAM), new JSReference(ITEM_ID_PARAM));
  58 + params.put(getFieldId(context, component, DAY_DELTA_PARAM), new JSReference(DAY_DELTA_PARAM));
  59 + params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new JSReference(MINUTE_DELTA_PARAM));
  60 + params.put(getFieldId(context, component, ALL_DAY_PARAM), new JSReference(ALL_DAY_PARAM));
  61 + params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
  62 + params.put(getFieldId(context, component, VIEW_PARAM), new JSReference(VIEW_PARAM));
  63 + if (isAjaxMode(component)) {
  64 + jsFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
  65 + Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context, component, params);
  66 + eventOptions.put("oncomplete", new JSReference(CALLBACK));
  67 + jsFunction.addParameter(eventOptions);
  68 + } else if (SERVER_MODE.equals(component.getSwitchType())) {
  69 + jsFunction = new JSFunction("Richfaces.jsFormSubmit",
  70 + component.getClientId(context),
  71 + getUtils().getNestingForm(context, component).getClientId(context),
  72 + null,
  73 + params);
  74 + } else {
  75 + return null;
  76 + }
  77 + return new JSFunctionDefinition("event", VIEW_PARAM, EVENT_TYPE_PARAM, ITEM_ID_PARAM, START_DATE_PARAM, END_DATE_PARAM, DAY_DELTA_PARAM, MINUTE_DELTA_PARAM, ALL_DAY_PARAM, CALLBACK).addToBody(jsFunction);
  78 + }
  79 +
  80 + @Override
  81 + public void decode(FacesContext context, UIComponent component) {
  82 + if (!component.isRendered()) {
  83 + return;
  84 + }
  85 + Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
  86 + if (requestParameterMap.get(component.getClientId(context)) != null) {
  87 + String startDateParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, START_DATE_PARAM));
  88 + String endDateParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, END_DATE_PARAM));
  89 + String itemIdParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, ITEM_ID_PARAM));
  90 + String dayDeltaParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, DAY_DELTA_PARAM));
  91 + String minuteDeltaParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, MINUTE_DELTA_PARAM));
  92 + String allDayParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, ALL_DAY_PARAM));
  93 + String eventTypeParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, EVENT_TYPE_PARAM));
  94 + String viewParam = requestParameterMap.get(getFieldId(context, (UISchedule) component, VIEW_PARAM));
  95 +
  96 + try {
  97 + if (DATE_RANGE_CHANGED_EVENT.equals(eventTypeParam)) {
  98 + Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
  99 + Date endDate = new Date(Long.parseLong(endDateParam) * 1000);
  100 + new ScheduleDateRangeChangedEvent(component, startDate, endDate).queue();
  101 + } else if (ITEM_MOVE_EVENT.equals(eventTypeParam)) {
  102 + int dayDelta = Integer.parseInt(dayDeltaParam);
  103 + int minuteDelta = Integer.parseInt(minuteDeltaParam);
  104 + boolean allDay = Boolean.parseBoolean(allDayParam);
  105 + new ScheduleItemMoveEvent(component, itemIdParam, dayDelta, minuteDelta, allDay).queue();
  106 + } else if (ITEM_RESIZE_EVENT.equals(eventTypeParam)) {
  107 + int dayDelta = Integer.parseInt(dayDeltaParam);
  108 + int minuteDelta = Integer.parseInt(minuteDeltaParam);
  109 + new ScheduleItemResizeEvent(component, itemIdParam, dayDelta, minuteDelta).queue();
  110 + } else if (ITEM_SELECTED_EVENT.equals(eventTypeParam)) {
  111 + new ScheduleItemSelectedEvent(component, itemIdParam).queue();
  112 + } else if (VIEW_CHANGED_EVENT.equals(eventTypeParam)) {
  113 + new ScheduleViewChangedEvent(component, viewParam).queue();
  114 + } else if (DATE_SELECTED_EVENT.equals(eventTypeParam)) {
  115 + Date startDate = new Date(Long.parseLong(startDateParam) * 1000);
  116 + boolean allDay = Boolean.parseBoolean(allDayParam);
  117 + new ScheduleDateSelectedEvent(component, startDate, allDay).queue();
  118 + }
  119 + } catch (NumberFormatException ex) {
  120 + throw new FacesException("Cannot convert request parmeters", ex);
  121 + }
  122 + }
  123 + }
  124 +
  125 + public void writeInitFunction(FacesContext context, UISchedule component) throws IOException {
  126 + ResponseWriter writer = context.getResponseWriter();
  127 + String clientId = component.getClientId(context);
  128 + Locale locale = context.getViewRoot().getLocale();
  129 + writer.writeText(new JSObject("RichFaces.Schedule", clientId, locale.getLanguage(),
  130 + getOptions(component),
  131 + DATE_RANGE_CHANGED_EVENT,
  132 + ITEM_SELECTED_EVENT,
  133 + ITEM_MOVE_EVENT,
  134 + ITEM_RESIZE_EVENT,
  135 + VIEW_CHANGED_EVENT,
  136 + DATE_SELECTED_EVENT,
  137 + createSubmitEventFunction(context, component)).toScript(),
  138 + null);
  139 + }
  140 +
  141 + public Map<String, Object> getOptions(UISchedule schedule) throws IOException {
  142 + /**
  143 + * Copy attributes from child view components
  144 + */
  145 + for (UIComponent child : schedule.getChildren()) {
  146 + if (!child.isRendered()) {
  147 + continue;
  148 + }
  149 + String suffix = "";
  150 + if (child instanceof UIScheduleMonthView) {
  151 + copyAttribute("weekMode", "", child, schedule);
  152 + suffix = "Month";
  153 + } else if (child instanceof UIScheduleAgendaDayView) {
  154 + suffix = "AgendaDay";
  155 + } else if (child instanceof UIScheduleAgendaWeekView) {
  156 + suffix = "AgendaWeek";
  157 + } else if (child instanceof UIScheduleBasicDayView) {
  158 + suffix = "BasicDay";
  159 + } else if (child instanceof UIScheduleBasicWeekView) {
  160 + suffix = "BasicWeek";
  161 + }
  162 + if (child instanceof ScheduleCommonViewAttributes) {
  163 + copyAttribute("timeFormat", suffix, child, schedule);
  164 + copyAttribute("columnFormat", suffix, child, schedule);
  165 + copyAttribute("titleFormat", suffix, child, schedule);
  166 + copyAttribute("dragOpacity", suffix, child, schedule);
  167 + }
  168 + }
  169 + /**
  170 + * Include only attributes that are actually set.
  171 + */
  172 + Map<String, Object> options = new HashMap<String, Object>();
  173 + addOptionIfSet("defaultView", schedule.getView(), options);
  174 +// TODO shall we numerate firstDayOfWeek as in Calendar (sunday=1,monday=2,etc.) or like in widget(sunday=0,monday=1,etc.)?
  175 + if (schedule.getFirstDay() != null) {
  176 + options.put("firstDay", schedule.getFirstDay() - 1);
  177 + }
  178 + addOptionIfSet("isRTL", schedule.getIsRTL(), options);
  179 + addOptionIfSet("weekends", schedule.getShowWeekends(), options);
  180 + addOptionIfSet("weekMode", schedule.getWeekMode(), options);
  181 + addOptionIfSet("height", schedule.getHeight(), options);
  182 + addOptionIfSet("contentHeight", schedule.getContentHeight(), options);
  183 + addOptionIfSet("aspectRatio", schedule.getAspectRatio(), options);
  184 + addOptionIfSet("allDaySlot", schedule.getAllDaySlot(), options);
  185 + addOptionIfSet("allDayText", schedule.getAllDayText(), options);
  186 + addOptionIfSet("axisFormat", schedule.getAxisFormat(), options);
  187 + addOptionIfSet("slotMinutes", schedule.getSlotMinutes(), options);
  188 + addOptionIfSet("defaultEventMinutes", schedule.getDefaultEventMinutes(), options);
  189 + addOptionIfSet("firstHour", schedule.getFirstHour(), options);
  190 + addOptionIfSet("minTime", schedule.getMinTime(), options);
  191 + addOptionIfSet("maxTime", schedule.getMaxTime(), options);
  192 + addOptionIfSet("editable", schedule.getEditable(), options);
  193 + addOptionIfSet("disableDragging", schedule.getDisableDragging(), options);
  194 + addOptionIfSet("disableResizing", schedule.getDisableResizing(), options);
  195 + addOptionIfSet("dragRevertDuration", schedule.getDragRevertDuration(), options);
  196 + addOptionHash("dragOpacity", schedule, options);
  197 + addOptionHash("titleFormat", schedule, options);
  198 + addOptionHash("timeFormat", schedule, options);
  199 + addOptionHash("columnFormat", schedule, options);
  200 + Map<String, Object> headerOptions = new HashMap<String, Object>(3);
  201 + addOptionIfSet("left", schedule.getHeaderLeft(), headerOptions);
  202 + addOptionIfSet("center", schedule.getHeaderCenter(), headerOptions);
  203 + addOptionIfSet("right", schedule.getHeaderRight(), headerOptions);
  204 + if (headerOptions.size() > 0) {
  205 + options.put("header", headerOptions);
  206 + }
  207 + addOptionIfSet("allDayDefault", schedule.getAllDayByDefault(), options);
  208 + addOptionIfSet("onItemSelected", schedule.getOnItemSelected(), options);
  209 + addOptionIfSet("onItemDrop", schedule.getOnItemDrop(), options);
  210 + addOptionIfSet("onItemResized", schedule.getOnItemResized(), options);
  211 + addOptionIfSet("onItemResizeStart", schedule.getOnItemResizeStart(), options);
  212 + addOptionIfSet("onItemResizeStop", schedule.getOnItemResizeStop(), options);
  213 + addOptionIfSet("onItemDragStart", schedule.getOnItemDragStart(), options);
  214 + addOptionIfSet("onItemDragStop", schedule.getOnItemDragStop(), options);
  215 + addOptionIfSet("onItemMouseover", schedule.getOnItemMouseover(), options);
  216 + addOptionIfSet("onItemMouseout", schedule.getOnItemMouseout(), options);
  217 + addOptionIfSet("onViewDisplay", schedule.getOnViewDisplay(), options);
  218 + addOptionIfSet("onDateSelected", schedule.getOnDateSelected(), options);
  219 + if (schedule.getDate() != null) {
  220 + Calendar calendar = Calendar.getInstance();
  221 + calendar.setTime(schedule.getDate());
  222 + options.put("year", calendar.get(Calendar.YEAR));
  223 + options.put("month", calendar.get(Calendar.MONTH));
  224 + options.put("date", calendar.get(Calendar.DATE));
  225 + }
  226 + if (!isClientMode(schedule)) {
  227 + Map<String, Object> initialItems = new HashMap<String, Object>();
  228 + Date startDate = UISchedule.getFirstDisplayedDay(schedule);
  229 + Date endDate = UISchedule.getLastDisplayedDate(schedule);
  230 + initialItems.put("items", schedule.getScheduleData(startDate, endDate));
  231 + Map<String, Object> date = new HashMap<String, Object>();
  232 + Calendar calendar = Calendar.getInstance();
  233 + calendar.setTime(startDate);
  234 + date.put("year", calendar.get(Calendar.YEAR));
  235 + date.put("month", calendar.get(Calendar.MONTH));
  236 + date.put("date", calendar.get(Calendar.DATE));
  237 + initialItems.put("startDate", date);
  238 + date = new HashMap<String, Object>();
  239 + calendar.setTime(endDate);
  240 + date.put("year", calendar.get(Calendar.YEAR));
  241 + date.put("month", calendar.get(Calendar.MONTH));
  242 + date.put("date", calendar.get(Calendar.DATE));
  243 + initialItems.put("endDate", date);
  244 + options.put("initialItems", initialItems);
  245 + } else {
  246 + options.put("events", schedule.getScheduleData(null, null));
  247 + }
  248 + return options;
  249 + }
  250 +
  251 + protected void addOptionIfSet(String optionName, Object value, Map<String, Object> options) {
  252 + if (value != null && value != "") {
  253 + options.put(optionName, value);
  254 + }
  255 + }
  256 +
  257 + public String getFieldId(FacesContext context, UISchedule component, String attribute) {
  258 + return getUtils().clientId(context, component) + NamingContainer.SEPARATOR_CHAR + attribute;
  259 + }
  260 +
  261 + private void addOptionHash(String attribute, UIComponent source, Map<String, Object> options) {
  262 + Map<String, Object> hash = new HashMap<String, Object>(3);
  263 + Map<String, Object> attributes = source.getAttributes();
  264 + addOptionIfSet("month", attributes.get(attribute + "Month"), hash);
  265 + addOptionIfSet("basicWeek", attributes.get(attribute + "BasicWeek"), hash);
  266 + addOptionIfSet("agendaWeek", attributes.get(attribute + "AgendaWeek"), hash);
  267 + addOptionIfSet("basicDay", attributes.get(attribute + "BasicDay"), hash);
  268 + addOptionIfSet("agendaDay", attributes.get(attribute + "AgendaDay"), hash);
  269 + addOptionIfSet("", attributes.get(attribute), hash);
  270 + if (hash.size() > 0) {
  271 + options.put(attribute, hash);
  272 + }
  273 + }
  274 +
  275 + private boolean isAjaxMode(UISchedule component) {
  276 + String mode = component.getSwitchType();
  277 + return AJAX_MODE.equals(mode) || "".equals(mode) || null == mode;
  278 + }
  279 +
  280 + private boolean isClientMode(UISchedule component) {
  281 + String mode = component.getSwitchType();
  282 + return CLIENT_MODE.equals(mode);
  283 + }
  284 +
  285 + private static void copyAttribute(String attribute, String suffix, UIComponent source, UIComponent target) {
  286 + Object value = source.getAttributes().get(attribute);
  287 + if (value != null) {
  288 + target.getAttributes().put(attribute + suffix, value);
  289 + }
  290 + }
  291 +}
  1 +package org.richfaces.renderkit.html.scripts;
  2 +
  3 +import java.io.ByteArrayInputStream;
  4 +import java.io.InputStream;
  5 +import java.util.Locale;
  6 +import java.util.MissingResourceException;
  7 +import java.util.ResourceBundle;
  8 +import javax.faces.FactoryFinder;
  9 +import javax.faces.context.ExternalContext;
  10 +import javax.faces.context.FacesContext;
  11 +import javax.faces.context.FacesContextFactory;
  12 +import org.ajax4jsf.resource.InternetResourceBase;
  13 +import org.ajax4jsf.resource.ResourceContext;
  14 +
  15 +public class ScheduleMessages extends InternetResourceBase {
  16 +
  17 + @Override
  18 + public InputStream getResourceAsStream(ResourceContext context) {
  19 +//TODO how to access messages from here if user keeps them somewhere else?
  20 + String language = "pl";
  21 + Locale locale = new Locale(language);
  22 + ClassLoader loader = Thread.currentThread().getContextClassLoader();
  23 +//TODO load default locale if specific is null
  24 + ResourceBundle bundle = ResourceBundle.getBundle("org.richfaces.component.scheduleMessages", locale, loader);
  25 + StringBuilder out = new StringBuilder();
  26 + out.append("RichFaces.Schedule.prototype.messages=jQuery.extend(RichFaces.Schedule.prototype.messages,{").append("'").append(locale).append("':{").append("monthNames:[");
  27 + String[] months = new String[]{"JANUARY","FEBRUARY"};
  28 + for (int i = 0; i < months.length; i++) {
  29 + out.append("'");
  30 +//TODO Handle MissingResourceException
  31 +//TODO Escape message strings
  32 + try {
  33 + out.append(escape(bundle.getString("org.richfaces.component.UISchedule.monthNames." + months[i])));
  34 + } catch (MissingResourceException e) {
  35 + out.append(escape(months[i]));
  36 + }
  37 + out.append("'");
  38 + if (i + 1 < months.length) {
  39 + out.append(",");
  40 + }
  41 + }
  42 + out.append("]").append("}").append("})");
  43 + return new ByteArrayInputStream(out.toString().getBytes());
  44 + }
  45 +
  46 + private String escape(String message) {
  47 + return message.replaceAll("'", "\\'");
  48 + }
  49 +}
  1 +package org.richfaces.taglib;
  2 +
  3 +import com.sun.facelets.FaceletContext;
  4 +import com.sun.facelets.tag.MetaRule;
  5 +import com.sun.facelets.tag.MetaRuleset;
  6 +import com.sun.facelets.tag.Metadata;
  7 +import com.sun.facelets.tag.MetadataTarget;
  8 +import com.sun.facelets.tag.TagAttribute;
  9 +import com.sun.facelets.tag.jsf.ComponentConfig;
  10 +import com.sun.facelets.tag.jsf.ComponentHandler;
  11 +import javax.faces.component.UIComponent;
  12 +import javax.faces.el.MethodBinding;
  13 +import org.richfaces.event.NodeExpandedEvent;
  14 +import org.richfaces.event.NodeSelectedEvent;
  15 +
  16 +public class ScheduleTagHandlerBase extends ComponentHandler {
  17 +
  18 + private final static String DATE_RANGE_CHANGED_LISTENER = "dateRangeChangedListener";
  19 + private final static String DATE_SELECTED_LISTENER = "dateSelectedListener";
  20 + private final static String ITEM_RESIZE_LISTENER = "itemResizeListener";
  21 + private final static String ITEM_MOVE_LISTENER = "itemMoveListener";
  22 + private final static String ITEM_SELECTED_LISTENER = "itemSelectedListener";
  23 + private final static String VIEW_CHANGED_LISTENER = "viewChangedListener";
  24 +
  25 + public ScheduleTagHandlerBase(ComponentConfig config) {
  26 + super(config);
  27 + }
  28 +
  29 + @Override
  30 + protected MetaRuleset createMetaRuleset(Class clazz) {
  31 + MetaRuleset ruleset = super.createMetaRuleset(clazz);
  32 +
  33 + ruleset.addRule(new MetaRule() {
  34 +
  35 + public Metadata applyRule(String name, final TagAttribute attribute, MetadataTarget metadataTarget) {
  36 + if (DATE_RANGE_CHANGED_LISTENER.equals(name)) {
  37 + return new Metadata() {
  38 +
  39 + public void applyMetadata(FaceletContext context, Object object) {
  40 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeExpandedEvent.class});
  41 + ((UIComponent) object).getAttributes().put(DATE_RANGE_CHANGED_LISTENER, binding);
  42 + }
  43 + };
  44 + } else if (DATE_SELECTED_LISTENER.equals(name)) {
  45 + return new Metadata() {
  46 +
  47 + public void applyMetadata(FaceletContext context, Object object) {
  48 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeSelectedEvent.class});
  49 + ((UIComponent) object).getAttributes().put(DATE_SELECTED_LISTENER, binding);
  50 + }
  51 + };
  52 + } else if (ITEM_RESIZE_LISTENER.equals(name)) {
  53 + return new Metadata() {
  54 +
  55 + public void applyMetadata(FaceletContext context, Object object) {
  56 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeSelectedEvent.class});
  57 + ((UIComponent) object).getAttributes().put(ITEM_RESIZE_LISTENER, binding);
  58 + }
  59 + };
  60 + } else if (ITEM_MOVE_LISTENER.equals(name)) {
  61 + return new Metadata() {
  62 +
  63 + public void applyMetadata(FaceletContext context, Object object) {
  64 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeSelectedEvent.class});
  65 + ((UIComponent) object).getAttributes().put(ITEM_MOVE_LISTENER, binding);
  66 + }
  67 + };
  68 + } else if (ITEM_SELECTED_LISTENER.equals(name)) {
  69 + return new Metadata() {
  70 +
  71 + public void applyMetadata(FaceletContext context, Object object) {
  72 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeSelectedEvent.class});
  73 + ((UIComponent) object).getAttributes().put(ITEM_SELECTED_LISTENER, binding);
  74 + }
  75 + };
  76 + } else if (VIEW_CHANGED_LISTENER.equals(name)) {
  77 + return new Metadata() {
  78 +
  79 + public void applyMetadata(FaceletContext context, Object object) {
  80 + MethodBinding binding = context.getFacesContext().getApplication().createMethodBinding(attribute.getValue(), new Class[]{NodeSelectedEvent.class});
  81 + ((UIComponent) object).getAttributes().put(VIEW_CHANGED_LISTENER, binding);
  82 + }
  83 + };
  84 + }
  85 +
  86 + return null;
  87 + }
  88 + });
  89 +
  90 + return ruleset;
  91 + }
  92 +}
  1 +org.richfaces.component.UISchedule.monthNames.JANUARY=January
  1 +/*
  2 + * FullCalendar v1.4.5 Stylesheet
  3 + *
  4 + * Feel free to edit this file to customize the look of FullCalendar.
  5 + * When upgrading to newer versions, please upgrade this file as well,
  6 + * porting over any customizations afterwards.
  7 + *
  8 + * Date: Sun Feb 21 20:30:11 2010 -0800
  9 + *
  10 + * TODO adjust class names to richfaces naming conventions
  11 + */
  12 +
  13 +
  14 +.fc,
  15 +.fc .fc-header,
  16 +.fc .fc-content {
  17 + font-size: 1em;
  18 + }
  19 +
  20 +.fc {
  21 + direction: ltr;
  22 + text-align: left;
  23 + }
  24 +
  25 +.fc table {
  26 + border-collapse: collapse;
  27 + border-spacing: 0;
  28 + }
  29 +
  30 +.fc td, .fc th {
  31 + padding: 0;
  32 + vertical-align: top;
  33 + }
  34 +
  35 +
  36 +
  37 +/* Header
  38 +------------------------------------------------------------------------*/
  39 +
  40 +table.fc-header {
  41 + width: 100%;
  42 + }
  43 +
  44 +.fc-header-left {
  45 + width: 25%;
  46 + }
  47 +
  48 +.fc-header-left table {
  49 + float: left;
  50 + }
  51 +
  52 +.fc-header-center {
  53 + width: 50%;
  54 + text-align: center;
  55 + }
  56 +
  57 +.fc-header-center table {
  58 + margin: 0 auto;
  59 + }
  60 +
  61 +.fc-header-right {
  62 + width: 25%;
  63 + }
  64 +
  65 +.fc-header-right table {
  66 + float: right;
  67 + }
  68 +
  69 +.fc-header-title {
  70 + margin-top: 0;
  71 + white-space: nowrap;
  72 + }
  73 +
  74 +.fc-header-space {
  75 + padding-left: 10px;
  76 + }
  77 +
  78 +/* right-to-left */
  79 +
  80 +.fc-rtl .fc-header-title {
  81 + direction: rtl;
  82 + }
  83 +
  84 +
  85 +
  86 +/* Buttons
  87 +------------------------------------------------------------------------*/
  88 +
  89 +.fc-header .fc-state-default,
  90 +.fc-header .ui-state-default {
  91 + margin-bottom: 1em;
  92 + cursor: pointer;
  93 + }
  94 +
  95 +.fc-header .fc-state-default {
  96 + border-width: 1px 0;
  97 + padding: 0 1px;
  98 + }
  99 +
  100 +.fc-header .fc-state-default,
  101 +.fc-header .fc-state-default a {
  102 + border-style: solid;
  103 + }
  104 +
  105 +.fc-header .fc-state-default a {
  106 + display: block;
  107 + border-width: 0 1px;
  108 + margin: 0 -1px;
  109 + width: 100%;
  110 + text-decoration: none;
  111 + }
  112 +
  113 +.fc-header .fc-state-default span {
  114 + display: block;
  115 + border-style: solid;
  116 + border-width: 1px 0 1px 1px;
  117 + padding: 3px 5px;
  118 + }
  119 +
  120 +.fc-header .ui-state-default {
  121 + padding: 4px 6px;
  122 + }
  123 +
  124 +.fc-header .fc-state-default span,
  125 +.fc-header .ui-state-default span {
  126 + white-space: nowrap;
  127 + }
  128 +
  129 +/* for adjacent buttons */
  130 +
  131 +.fc-header .fc-no-right {
  132 + padding-right: 0;
  133 + }
  134 +
  135 +.fc-header .fc-no-right a {
  136 + margin-right: 0;
  137 + border-right: 0;
  138 + }
  139 +
  140 +.fc-header .ui-no-right {
  141 + border-right: 0;
  142 + }
  143 +
  144 +/* for fake rounded corners */
  145 +
  146 +.fc-header .fc-corner-left {
  147 + margin-left: 1px;
  148 + padding-left: 0;
  149 + }
  150 +
  151 +.fc-header .fc-corner-right {
  152 + margin-right: 1px;
  153 + padding-right: 0;
  154 + }
  155 +
  156 +/* DEFAULT button COLORS */
  157 +
  158 +.fc-header .fc-state-default,
  159 +.fc-header .fc-state-default a {
  160 + border-color: #777; /* outer border */
  161 + color: #333;
  162 + }
  163 +
  164 +.fc-header .fc-state-default span {
  165 + border-color: #fff #fff #d1d1d1; /* inner border */
  166 + background: #e8e8e8;
  167 + }
  168 +
  169 +/* PRESSED button COLORS (down and active) */
  170 +
  171 +.fc-header .fc-state-active a {
  172 + color: #fff;
  173 + }
  174 +
  175 +.fc-header .fc-state-down span,
  176 +.fc-header .fc-state-active span {
  177 + background: #888;
  178 + border-color: #808080 #808080 #909090; /* inner border */
  179 + }
  180 +
  181 +/* DISABLED button COLORS */
  182 +
  183 +.fc-header .fc-state-disabled a {
  184 + color: #999;
  185 + }
  186 +
  187 +.fc-header .fc-state-disabled,
  188 +.fc-header .fc-state-disabled a {
  189 + border-color: #ccc; /* outer border */
  190 + }
  191 +
  192 +.fc-header .fc-state-disabled span {
  193 + border-color: #fff #fff #f0f0f0; /* inner border */
  194 + background: #f0f0f0;
  195 + }
  196 +
  197 +
  198 +
  199 +/* Content Area & Global Cell Styles
  200 +------------------------------------------------------------------------*/
  201 +
  202 +.fc-widget-content {
  203 + border: 1px solid #ccc; /* outer border color */
  204 + }
  205 +
  206 +.fc-content {
  207 + clear: both;
  208 + }
  209 +
  210 +.fc-content .fc-state-default {
  211 + border-style: solid;
  212 + border-color: #ccc; /* inner border color */
  213 + }
  214 +
  215 +.fc-content .fc-state-highlight { /* today */
  216 + background: #ffc;
  217 + }
  218 +
  219 +.fc-content .fc-not-today {
  220 + background: none;
  221 + }
  222 +
  223 +.fc-cell-overlay { /* semi-transparent rectangle while dragging */
  224 + background: #9cf;
  225 + opacity: .2;
  226 + filter: alpha(opacity=20); /* for IE */
  227 + }
  228 +
  229 +.fc-view { /* prevents dragging outside of widget */
  230 + width: 100%;
  231 + overflow: hidden;
  232 + }
  233 +
  234 +
  235 +
  236 +/* Global Event Styles
  237 +------------------------------------------------------------------------*/
  238 +
  239 +.fc-event,
  240 +.fc-agenda .fc-event-time,
  241 +.fc-event a {
  242 + border-style: solid;
  243 + border-color: #36c; /* default BORDER color (probably the same as background-color) */
  244 + background-color: #36c; /* default BACKGROUND color */
  245 + color: #fff; /* default TEXT color */
  246 + }
  247 +
  248 + /* Use the 'className' CalEvent property and the following
  249 + * example CSS to change event color on a per-event basis:
  250 + *
  251 + * .myclass,
  252 + * .fc-agenda .myclass .fc-event-time,
  253 + * .myclass a {
  254 + * background-color: black;
  255 + * border-color: black;
  256 + * color: red;
  257 + * }
  258 + */
  259 +
  260 +.fc-event {
  261 + text-align: left;
  262 + }
  263 +
  264 +.fc-event a {
  265 + overflow: hidden;
  266 + font-size: .85em;
  267 + text-decoration: none;
  268 + cursor: pointer;
  269 + }
  270 +
  271 +.fc-event-editable {
  272 + cursor: pointer;
  273 + }
  274 +
  275 +.fc-event-time,
  276 +.fc-event-title {
  277 + padding: 0 1px;
  278 + }
  279 +
  280 +/* for fake rounded corners */
  281 +
  282 +.fc-event a {
  283 + display: block;
  284 + position: relative;
  285 + width: 100%;
  286 + height: 100%;
  287 + }
  288 +
  289 +/* right-to-left */
  290 +
  291 +.fc-rtl .fc-event a {
  292 + text-align: right;
  293 + }
  294 +
  295 +/* resizable */
  296 +
  297 +.fc .ui-resizable-handle {
  298 + display: block;
  299 + position: absolute;
  300 + z-index: 99999;
  301 + border: 0 !important; /* important overrides pre jquery ui 1.7 styles */
  302 + background: url(data:image/gif;base64,AAAA) !important; /* hover fix for IE */
  303 + }
  304 +
  305 +
  306 +
  307 +/* Horizontal Events
  308 +------------------------------------------------------------------------*/
  309 +
  310 +.fc-event-hori {
  311 + border-width: 1px 0;
  312 + margin-bottom: 1px;
  313 + }
  314 +
  315 +.fc-event-hori a {
  316 + border-width: 0;
  317 + }
  318 +
  319 +/* for fake rounded corners */
  320 +
  321 +.fc-content .fc-corner-left {
  322 + margin-left: 1px;
  323 + }
  324 +
  325 +.fc-content .fc-corner-left a {
  326 + margin-left: -1px;
  327 + border-left-width: 1px;
  328 + }
  329 +
  330 +.fc-content .fc-corner-right {
  331 + margin-right: 1px;
  332 + }
  333 +
  334 +.fc-content .fc-corner-right a {
  335 + margin-right: -1px;
  336 + border-right-width: 1px;
  337 + }
  338 +
  339 +/* resizable */
  340 +
  341 +.fc-event-hori .ui-resizable-e {
  342 + top: 0 !important; /* importants override pre jquery ui 1.7 styles */
  343 + right: -3px !important;
  344 + width: 7px !important;
  345 + height: 100% !important;
  346 + cursor: e-resize;
  347 + }
  348 +
  349 +.fc-event-hori .ui-resizable-w {
  350 + top: 0 !important;
  351 + left: -3px !important;
  352 + width: 7px !important;
  353 + height: 100% !important;
  354 + cursor: w-resize;
  355 + }
  356 +
  357 +.fc-event-hori .ui-resizable-handle {
  358 + _padding-bottom: 14px; /* IE6 had 0 height */
  359 + }
  360 +
  361 +
  362 +
  363 +/* Month View, Basic Week View, Basic Day View
  364 +------------------------------------------------------------------------*/
  365 +
  366 +.fc-grid table {
  367 + width: 100%;
  368 + }
  369 +
  370 +.fc .fc-grid th {
  371 + border-width: 0 0 0 1px;
  372 + text-align: center;
  373 + }
  374 +
  375 +.fc .fc-grid td {
  376 + border-width: 1px 0 0 1px;
  377 + }
  378 +
  379 +.fc-grid th.fc-leftmost,
  380 +.fc-grid td.fc-leftmost {
  381 + border-left: 0;
  382 + }
  383 +
  384 +.fc-grid .fc-day-number {
  385 + float: right;
  386 + padding: 0 2px;
  387 + }
  388 +
  389 +.fc-grid .fc-other-month .fc-day-number {
  390 + opacity: 0.3;
  391 + filter: alpha(opacity=30); /* for IE */
  392 + /* opacity with small font can sometimes look too faded
  393 + might want to set the 'color' property instead
  394 + making day-numbers bold also fixes the problem */
  395 + }
  396 +
  397 +.fc-grid .fc-day-content {
  398 + clear: both;
  399 + padding: 2px 2px 0; /* distance between events and day edges */
  400 + }
  401 +
  402 +/* event styles */
  403 +
  404 +.fc-grid .fc-event-time {
  405 + font-weight: bold;
  406 + }
  407 +
  408 +/* right-to-left */
  409 +
  410 +.fc-rtl .fc-grid {
  411 + direction: rtl;
  412 + }
  413 +
  414 +.fc-rtl .fc-grid .fc-day-number {
  415 + float: left;
  416 + }
  417 +
  418 +.fc-rtl .fc-grid .fc-event-time {
  419 + float: right;
  420 + }
  421 +
  422 +/* Agenda Week View, Agenda Day View
  423 +------------------------------------------------------------------------*/
  424 +
  425 +.fc .fc-agenda th,
  426 +.fc .fc-agenda td {
  427 + border-width: 1px 0 0 1px;
  428 + }
  429 +
  430 +.fc .fc-agenda .fc-leftmost {
  431 + border-left: 0;
  432 + }
  433 +
  434 +.fc-agenda tr.fc-first th,
  435 +.fc-agenda tr.fc-first td {
  436 + border-top: 0;
  437 + }
  438 +
  439 +.fc-agenda-head tr.fc-last th {
  440 + border-bottom-width: 1px;
  441 + }
  442 +
  443 +.fc .fc-agenda-head td,
  444 +.fc .fc-agenda-body td {
  445 + background: none;
  446 + }
  447 +
  448 +.fc-agenda-head th {
  449 + text-align: center;
  450 + }
  451 +
  452 +/* the time axis running down the left side */
  453 +
  454 +.fc-agenda .fc-axis {
  455 + width: 50px;
  456 + padding: 0 4px;
  457 + vertical-align: middle;
  458 + white-space: nowrap;
  459 + text-align: right;
  460 + font-weight: normal;
  461 + }
  462 +
  463 +/* all-day event cells at top */
  464 +
  465 +.fc-agenda-head tr.fc-all-day th {
  466 + height: 35px;
  467 + }
  468 +
  469 +.fc-agenda-head td {
  470 + padding-bottom: 10px;
  471 + }
  472 +
  473 +.fc .fc-divider div {
  474 + font-size: 1px; /* for IE6/7 */
  475 + height: 2px;
  476 + }
  477 +
  478 +.fc .fc-divider .fc-state-default {
  479 + background: #eee; /* color for divider between all-day and time-slot events */
  480 + }
  481 +
  482 +/* body styles */
  483 +
  484 +.fc .fc-agenda-body td div {
  485 + height: 20px; /* slot height */
  486 + }
  487 +
  488 +.fc .fc-agenda-body tr.fc-minor th,
  489 +.fc .fc-agenda-body tr.fc-minor td {
  490 + border-top-style: dotted;
  491 + }
  492 +
  493 +.fc-agenda .fc-day-content {
  494 + padding: 2px 2px 0; /* distance between events and day edges */
  495 + }
  496 +
  497 +
  498 +
  499 +/* Vertical Events
  500 +------------------------------------------------------------------------*/
  501 +
  502 +.fc-event-vert {
  503 + border-width: 0 1px;
  504 + }
  505 +
  506 +.fc-event-vert a {
  507 + border-width: 0;
  508 + }
  509 +
  510 +/* for fake rounded corners */
  511 +
  512 +.fc-content .fc-corner-top {
  513 + margin-top: 1px;
  514 + }
  515 +
  516 +.fc-content .fc-corner-top a {
  517 + margin-top: -1px;
  518 + border-top-width: 1px;
  519 + }
  520 +
  521 +.fc-content .fc-corner-bottom {
  522 + margin-bottom: 1px;
  523 + }
  524 +
  525 +.fc-content .fc-corner-bottom a {
  526 + margin-bottom: -1px;
  527 + border-bottom-width: 1px;
  528 + }
  529 +
  530 +/* event content */
  531 +
  532 +.fc-event-vert span {
  533 + display: block;
  534 + position: relative;
  535 + z-index: 2;
  536 + }
  537 +
  538 +.fc-event-vert span.fc-event-time {
  539 + white-space: nowrap;
  540 + _white-space: normal;
  541 + overflow: hidden;
  542 + border: 0;
  543 + font-size: 10px;
  544 + }
  545 +
  546 +.fc-event-vert span.fc-event-title {
  547 + line-height: 13px;
  548 + }
  549 +
  550 +.fc-event-vert span.fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
  551 + position: absolute;
  552 + z-index: 1;
  553 + top: 0;
  554 + left: 0;
  555 + width: 100%;
  556 + height: 100%;
  557 + background: #fff;
  558 + opacity: .3;
  559 + filter: alpha(opacity=30); /* for IE */
  560 + }
  561 +
  562 +/* resizable */
  563 +
  564 +.fc-event-vert .ui-resizable-s {
  565 + bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
  566 + width: 100% !important;
  567 + height: 8px !important;
  568 + line-height: 8px !important;
  569 + font-size: 11px !important;
  570 + font-family: monospace;
  571 + text-align: center;
  572 + cursor: s-resize;
  573 + }
  574 +
  575 +
Please register or login to post a comment