facet name=customToolbarAlign atoolbar

Creating a Calendar Application 15-17 3. In the Structure window, select the calendar component, and in the Property Inspector, bind the activityStyles attribute to the map.

15.6.2 What Happens at Runtime: Activity Styling

During calendar rendering for each activity, the renderer calls the CalendarActivity.getTags method to get a string set. The string set is then passed to the map bound to the activityStyles attribute, and an InstanceStyles object is returned which may be a CalendarActivityRamp. Using the example: ■ If the string set {Me} is passed in, the red CalendarActivityRamp is returned. ■ If the string set {LE} is passed in, the orange CalendarActivityRamp is returned. ■ If the string set {TF} is passed in, the blue CalendarActivityRamp is returned.

15.6.3 How to Customize Dates

If you want to display something other than the date number string in the day header of the monthly view, you can bind the dateCustomizer attribute to an implementation of a DateCustomizer class that determines what should be displayed for the date. To customize the date string: 1. Create a subclass of the oracle.adf.view.rich.util.DateCustomizer class. This subclass should determine what to display using the following skinning keys: ■ af|calendar::month-grid-cell-header-misc: Determines what to display in the left side of the header for a day in the month view. ■ af|calendar::month-grid-cell-header-day-link: Determines the string to display for the date. Example 15–4 shows the DemoDateCustomizer class that displays the week number in the first day of the week, and instead of the day of the month, a countdown number to a specific date, as shown in Figure 15–10 . Table 15–2 Map for activityStyles Attribute Key String Set Value InstanceStyles Object {Me} CalendarActivityRamp.getActivityRamp CalendarActivityRamp.RampKey.RED {LE} CalendarActivityRamp.getActivityRamp CalendarActivityRamp.RampKey.ORANGE {TF} CalendarActivityRamp.getActivityRamp CalendarActivityRamp.RampKey.BLUE 15-18 Web User Interface Developers Guide for Oracle Application Development Framework Example 15–4 Date Customizer Class public class MyDateCustomizer extends DateCustomizer { public String formatDate date, String key, Locale locale, TimeZone tz { if af|calendar::month-grid-cell-header-misc.equalskey { return appropriate string } else if af|calendar::month-grid-cell-header-day-link.equalskey { return appropriate string } return null; } } 2. In a managed bean, create an instance of the DateCustomizer class, for example: private DateCustomizer _dateCustomizer = new DemoDateCustomizer; 3. In the calendar component, bind the dateCustomizer attribute to the DateCustomizer instance created in the managed bean.