FormattingBeans Information

The FormattingBeans contain functionality to change Font information on Form Items. The current Font properties of the Item choosen in the ComboBox will also be reflected in the Beans. Available Functions: Bold, Italic, Strikethrough (only on TextItems), Underline (only on TextItems), Size, Change Font
Additional you can Save and Open the formatting of a Form & do an automatic Open of this file at Form startup.

The FormattingBeans can be integrated into your Form by copying from the Formatter Object Library. Next to this you will need to specify the Implementation Class on every Item that you want to format. At runtime the FormattingBeans will loop through all Items in the Form where the Implementation Class is set and will populate the ComboBox with these components. The Combobox will be populated here with a combination of a Contextname and Component name. This combination is used because for some items the Contextname is null.

Here an image of the FormattingBeans in action:

Formatting

Modules In This Demo

The Formatting Demo consists of the following files

1. tomsdemos.jar - contains all Beans and Pjcs (signed file)
2. FORMATTER.olb - Object library containing WNFI trigger, block, canvas & window
3. FORMATTER.fmb - Sample Form
4. tomsdemos_unsigned.jar - contains all Beans and Pjcs (unsigned file)

Reusing the code

Setting up Forms Services

1. In order for an application to be able to use the FormattingBeans, the relevant configuration in the formsweb.cfg file has to ensure that the supplied tomsdemos.jar is included in the relevant archive setting.

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

[formatterDemo]
pageTitle=OracleAS Forms Services - Client Info Demo
IE=jinitiator
baseHTMLJInitiator=demobasejini.html
archive_jini=f90all_jinit.jar,tomsdemos.jar
form=FORMATTER.fmx
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue
background=/formsdemo/images/blue.gif
2. The FORMATTER.fmx needs to be in a directory available in FORMS_PATH
3. The tomsdemos.jar needs to be signed and placed in the $ORACLE_HOME/forms/java directory

Using the Utility as a JavaBean in your Form

1. Create a Form
2. copy the objects from the FORMATTER.olb to the form
3. Ensure the block FORMATTINGBEANS is the last in the form
4. Create a button on a canvas that will show the FormattingBeans:
SHOW_VIEW('FORMATTERCANVAS');
GO_BLOCK('FORMATTINGBEANS');

5. On every Item where you want to use the formatting, specify the PJC on the Item:
tom.oracle.demos.FormatterVButton - on Button
tom.oracle.demos.FormatterVTextField - on TextItem
tom.oracle.demos.FormatterVTextArea - on Multiline TextItems
tom.oracle.demos.FormatterVCheckBox - on Checkbox
tom.oracle.demos.FormatterVCombo - on ComboBox
tom.oracle.demos.FormatterVTList - on TList
tom.oracle.demos.FormatterVRadioButton - on RadioButton
tom.oracle.demos.FormatterVPopList - on PopList

Automatic Opening

This feature will open the Formatting file at startup of the Form. The following line has to be enabled in the WNFI trigger:

SET_CUSTOM_PROPERTY('FORMATTINGBEANS.FORMATTINGCONTROLBEAN',1,'FILENAME','c:\temp\FormatterDemo.ser');
This will store/open the formatting for this form in the c:\temp\FormatterDemo.ser on client side. For every form you will need to choose another filename. In order for this feature to work the file should first be saved on clientside with the Automatic open checkbox enabled. Also if you are deploying .ser files to clients, be sure these clients have the fonts that are saved in this file.

Multirecord Blocks

With multirecord blocks every component will have an entry in the Combobox. This is due to the nature components are drawn on the screen and is normal behaviour

Debugging Fonts

Next to this the following Settable Properties are available for debugging on any PJC Item: (output in java console)

DEBUG_APPLET - Some applet information
DEBUG_CLASS - Debug Class for the PJC component
DEBUG_COMPONENT - Debug Component information
DEBUG_CONTAINER - Debug Component-Container information
DEBUG_FONT - Debug Current Font

A sample to debug the Font on the DEPT.DNAME item:
SET_CUSTOM_PROPERTY('DEPT.DNAME',1,'DEBUG_FONT','dummyinformation');
 

Get the zipped file


Download the formatter.zip file