Customizing Gantt Chart Context Menus

Using ADF Gantt Chart Components 28-19 var=task doubleClickListener={projectGanttDoubleClick.handleDoubleClick} dvt:projectGantt Implement the handleDoubleClick method in a backing bean, for example: public void handleDoubleClickDoubleClick event

28.8 Specifying Nonworking Days, Read-Only Features, and Time Axes

You can customize a Gantt chart to display nonworking days of the week, turn off user interaction features, and specify the time axes.

28.8.1 Identifying Nonworking Days in a Gantt Chart

You can specify nonworking days in a Gantt chart. By default, nonworking days are shaded gray, but you can select a custom color to be used for nonworking days.

28.8.1.1 How to Specify Weekdays as Nonworking Days

If certain weekdays are always nonworking days, then you can indicate the days of the week that fall in this category. To identify weekdays as nonworking days: 1. In the Structure window, right-click a Gantt chart node and choose Go to Properties. 2. In the Appearance category of the Property Inspector, in the NonWorkingDaysOfWeek field, enter the string of days that you want to identify as nonworking days for each week. For example, to specify that Saturday and Sunday are nonworking days, enter the following string: sat sun. Alternatively, you can create a method in a backing bean to programmatically identify the nonworking days. For example, if you put the code in a backing bean in a method called getNonWorkingDaysOfWeek, then the setting for the nonWorkingDaysOfWeek attribute becomes: {myBackingBean.nonWorkingDays}. Example 28–14 shows sample code in a backing bean. Example 28–14 Backing Bean to Identify Nonworking Days public int[] getNonWorkingDaysOfWeek { if locale == Locale.EN_US return new int[] {Calendar.SATURDAY, Calendar.SUNDAY}; else ....... } 3. Optionally, specify a custom color in the NonWorkingDaysColor field. The value you enter for this attribute must be a hexadecimal color string.

28.8.1.2 How to Identify Specific Dates as Nonworking Days

You can enter specific dates as nonworking days in a Gantt chart when individual weekdays are not sufficient. 28-20 Web User Interface Developers Guide for Oracle Application Development Framework To identify specific dates as nonworking days: 1. In the Structure Window, right-click a Gantt chart and choose Go to Properties. 2. In the Property Inspector, select the Appearance attributes category. 3. In the nonWorkingDays field, enter the string of dates that you want to identify as nonworking days. For example: 2008-07-04 2008-11-28 2008-12-25. Alternatively, for more flexibility, you can create a method in a backing bean to programmatically identify the nonworking days. For example, if you put the code in a backing bean in a method called getNonWorkingDays, then the setting for the nonWorkingDays attribute becomes: {myBackingBean.nonWorkingDays}. 4. Optionally, specify a custom color in the nonWorkingDaysColor field. The value you enter for this attribute must be a hexadecimal color string.

28.8.2 How to Apply Read-Only Values to Gantt Chart Features

User interactions with a Gantt chart can be customized to disable features by setting the featuresOff property to specify read-only values. Table 28–5 shows the valid values and the disabled feature for the Gantt chart types. To set read-only values on Gantt chart features: 1. In the Structure window, right-click the Gantt chart node and choose Go to Properties .

2. In the Behavior attributes category of the Property Inspector, for the

featuresOff attribute, enter one or more String values to specify the Gantt chart features to disable. For example, to disable user interactions for editing the data model, printing, or changing the zoom level of a Gantt chart, use the following setting for the featuresOff attribute: edit print zoom Alternatively, you can create a method in a backing bean to programmatically identify the features to be disabled. For example, if you put the code in a backing Table 28–5 Valid Values for Read-Only Attributes Value Feature Disabled clipboard Cut, copy, and paste tasks for all Gantt charts. edit Changes to the data model for all Gantt charts. indenting Indent and outdent tasks for project and scheduling Gantts charts. legend Hide and show legend and task information for all Gantt charts. linking Link and unlink tasks for scheduling Gantt charts. print Print task for all Gantt charts. properties Show property dialogs for all Gantt charts. split Split task for project Gantt. undo Undo and redo tasks for all Gantt charts. view Show as list, Show as hierarchy, Columns, Expand and Collapse tasks for all Gantt charts. zoom Changes to the zoom level for all Gantt charts.