How to Specify Custom Data Filters

Using ADF Gantt Chart Components 28-21 bean in a method called whatToTurnOff that returns a String array of the values, then the setting for the featuresOff attribute becomes: {BackingBean.whatToTurnOff}.

28.8.3 Customizing the Time Axis of a Gantt Chart

Every Gantt chart is created with a major time axis and a minor time axis. Each time axis has a facet that identifies the level of the axis as major or minor. The default time axis settings for all Gantt charts are: ■ Major time axis: Weeks ■ Minor time axis: Days You can customize the settings of a time axis. However, the setting of a major axis must be a higher time level than the setting of a minor axis. The following values for setting the scale on a dvt:timeAxis component are listed from highest to lowest: ■ twoyears ■ year ■ halfyears ■ quarters ■ twomonths ■ months ■ twoweeks ■ weeks ■ days ■ sixhours ■ threehours ■ hours ■ halfhours ■ quarterhours Example 28–18 shows sample code to set the time axis of a Gantt chart to use months as a major time axis and weeks as the minor time axis. Example 28–15 Gantt Chart Time Axis Set to Months and Weeks f:facet name=major dvt:timeAxis scale=months f:facet f:facet name=minor dvt:timeAxis scale=weeks f:facet The time units you specify for the major and minor axes apply only to the initial display of the Gantt chart. At runtime, the user can zoom in or out on a time axis to display the time unit level at a different level. 28-22 Web User Interface Developers Guide for Oracle Application Development Framework

28.8.3.1 How to Create and Use a Custom Time Axis

You can create a custom time axis for the Gantt chart and specify that axis in the scale attribute of dvt:timeAxis. The custom time axis will be added to the Time Scale dialog at runtime. To create and use a custom time axis: 1. Implement the CustomTimescale.java interface to call the method getNextDateDate currentDate in a loop to build the time axis. Example 28–16 show sample code for the interface. Example 28–16 Interface to Build Custom Dates public interface CustomTimescale { public String getScaleName; public Date getPreviousDateDate ganttStartDate; public Date getNextDateDate currentDate; public String getLabelDate date; }

2. In the Structure window, right-click a Gantt chart node and choose Go to

Properties.

3. In the Other attributes category of the Property Inspector, for the

CustomTimeScales attribute, register the implementation of the interface for the custom time axis. The customTimeScales attributes value is a java.util.Map object. The specified map object contains pairs of keyvalues. The key is the time scale name fiveyears, and the value is the implementation of the CustomTimeScale.java interface. For example: customTimesScales={project.customTimescales}

4. Also in the Property Inspector, set the Scale attribute for major and minor time

axis, and specify the ZoomOrder attribute to zoom to the custom times scales. Example 28–17 shows sample code for setting a threeyears minor time axis and a fiveyears major time axis. Example 28–17 Custom Time Axis f:facet name=major dvt:timeAxis scale=fiveyears id=ta1 zoomOrder=fiveyears threeyears years halfyears quarters months weeks days hours f:facet f:facet name=minor dvt:timeAxis scale=threeyears id=ta2 f:facet

28.9 Printing a Gantt Chart

The ADF Gantt chart provides a helper class GanttPrinter that can generate a Formatted Object FO for use with XML Publisher to produce PDF files.