Progress Bar PJC Information

The ProgressBar Pluggable Java Component (PJC) provides a simple progress bar widget.  The bar supports the setting of the background and foreground colors of the bar to a limited range of colors, and displays the percentage completed in the center of the bar.

Modules In This Demo

The ProgressBar demo consists of the following files (relative directories shown in brackets):

  1. ProgressBar.fmb/fmx [forms]- The demo form
  2. ProgressBar.java [src/oracle/forms/demos] - source code for the Bean that draws the bar
  3. ProgressBarPJC.java [src/oracle/forms/demos] - A PJC thta creates and uses an instance of the ProgressBar Bean
  4. progressbar.jar [classes]- the compiled and jarred java class.

The doc directory and the classes directory contain the JavaDoc for the code and the compiled classes respectively

Reusing the code

Setting up Forms Services

In order for an application to be able to use the ProgressBar PJC the relevant configuration in the formsweb.cfg file has to ensure that the supplied progressbar.jar (or another jar file containing the compiled classes) is included in the relevant archive setting.

An entry in the formsweb.cfg file for an application that used the ProgressBar  would look like this:

[ProgressBar]
pageTitle=OracleAS Forms Services - ProgressBar Demo
IE=jinitiator
baseHTMLJInitiator=demobasejini.html
archive_jini=frmall_jinit.jar,progressbar.jar
form=progressbarforms/java
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue
background=/formsdemo/images/blue.gif

Using the PJC in your Form

To use the ProgressBar PJC you must first create a normal Forms bean area. 

Then set the Implementation Class property for this list item to oracle.forms.demos.ProgressBarPJC.  Note that this property is case sensitive and must be entered exactly as shown.

Setting Properties on the PJC

The Progress Bar is incremented using the custom property PROGRESS_PERCENT_VALUE. this can be set to any value between 0 and 100.  The Bar will then be rendered with the correct size of fill and with the percentage number written in the bar.  For instance to set the bar to reflect a value of 45% the call would be 

 SET_CUSTOM_PROPERTY('PJC.PROGRESSBAR',1,'PROGRESS_PERCENT_VALUE',45);

The first argument to Set_Custom_Property() is the name or id of the PJC enabled item.  The second parameter defines the instance of the control that you wish to set the property on.  This index number is one based and represents the physical control in the user interface (rather than the record number in the underlying block). You can use the constant ALL_ROWS to set the property on all instances of the PJC for this field.  The third argument is the custom property that is being set on the PJC and the forth the value.

As well as setting the percentage value of the bar you can also set the color value for the background and foreground.  The control only supports a limited number of string representations of colors as it stands but t could be enhanced to support more colors or RGB codes to increase the color range.  The supported colors are (not case sensitive):

 

Custom Property Summary

Property Get Set Valid Values / Return Value Purpose
PROGRESS_PERCENT_VALUE Yes Yes Number between 0 and 100 /String The percentage represented on the bar
PROGRESS_BACKGROUND_COLOR No Yes String (see above for valid values) Background color for the bar
PROGRESS_FILL_COLOR No Yes String (see above for valid values) Foreground (fill) color for the bar