Oracle Forms Community - Pluggable Java Components & Java Beans' library

To content | To menu | To search

Friday, March 27 2015

A "Flashing Status Bar" Java Bean

Here is a Java Bean to attrack the attention of the end-user when a message is displayed in the status bar.

It "flashes" the status bar using different colors, depending on the message severity.

 

Get This Java Bean created by Andreas Weiden.

Forms 11g : PJCs sending back custom events to Forms

Purpose

Here is a Forms 11g Pluggable Java Component that allows sending back to the Forms application each key pressed in a Text Item (single or multi-line).

The single-line PJC extends the VTextField class.
The multi-line PJC extends the VTextArea class.



Key Pressed 11g


This PJC can only work with the Forms 11g version. It won't work with any older version like 10g or 9i.


The implementation class of the single-Line Text Item


     oracle.forms.fd.KeyPressedTextItem



The implementation class of the multi-Line Text Item

     oracle.forms.fd.KeyPressedTextArea




The methods you can call



Set the Java Console logging mode (true/false)

Set_Custom_Property('BLOCK.ITEM',1,'LOG','true|false');

By default, the logging mode is set to false.

e.g.:
-- set the logging on --
Set_Custom_Property( 'BL.TEXTITEM', 1, 'LOG', 'true' ) ;
 

 



The event fired by the PJCs


KEY_PRESSED


It is constituted by 3 parameters to get the key code, the key char and the key modifier.

To know what text item has just fired the event, ask the :SYSTEM.CURSOR_ITEM variable.

When-Custom-Item-Event:

DECLARE
  
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    LC$Code   varchar2(25); -- code
    LC$Char   varchar2(25); -- char
    LC$Modif  varchar2(25); -- modifier

  
BEGIN
  
   IF (eventName='KEY_PRESSED') THEN
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'KEY_CODE',eventValueType, LC$Code);
      get_parameter_attr(eventValues,'KEY_CHAR',eventValueType, LC$Char);
      get_parameter_attr(eventValues,'KEY_MODIFIER',eventValueType,  LC$Modif);
     
      :BL.RESULT := :System.cursor_item || ' Key pressed:'|| LC$Code || ' (' || LC$Char||') '||' modif:'||LC$Modif ;
      Synchronize ;

   END IF; 
  
END;






The sample dialog


     . Download the KeyPressed.zip file
     . Unzip the file
     . copy the keypressed.jar file in the <ORACLE_HOME>\Middleware\as_1\forms\java directory
     . Edit your formsweb.cfg file to add the keypressed.jar to the archive tag.
      
<WEBLOGIC_HOME>\Middleware\user_projects\domains\ClassicDomain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg
     . Open the KEYPRESSED11g.fmb module (Oracle Forms 11g)
     . Compile all and run the module

A "Menu" Text Item PJC

Purpose

Here is a PJC that includes a menu in a Text Item.



Text Filed Menu



The implementation class of the PJC

     oracle.forms.fd.ComboMenuPJC


The methods you can call



  • Set the menu

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_MENU', 'menu_description');

menu_desription contains the menu definition in a XML format:

Declare
 LC$Menu  Varchar2(32000);
Begin
 LC$Menu := '<main>
    <label>Machines</label>
    <menu>
    <label>Cars</label>
    <smenu><label>Japaneese</label><item>Toyota Prius</item></smenu>
    <smenu><label>Europeen</label><item>Mercedes</item><item>BMW</item><smenu><label>French</label><item>Peugeot 207</item></smenu></smenu>
    </menu>
    <menu>
    <label>Planes</label>
    <smenu><label>Airbus</label><item>A350</item><item>A380</item></smenu>
    <item>Boeing 777</item>
    </menu>
    </main>' ;
    Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_MENU', LC$Menu);
End;


The content of a complete sub-menu must be written on the same single line between <smenu> and </smenu> tags.

e.g. :
<smenu><label>Japaneese</label><item>Toyota Prius</item></smenu>

Only values included between <item> and </item> tags are real values you can use to populate the Text Item.


 

  • Set the border style

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_BORDER', 'border');

  border can be one of the following:

   - line  (défault)
   - raised
   - lowered
   - etched
   - null

 

  • Set the trace to the Java Console

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_LOG', 'true');





The sample dialog

     . Download the combomenupjc.zip file
     .  Unzip the combomenupjc.zip file
     .  Copy the JAR files in your /forms/java/ folder
     .  Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the combomenupjc.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar file must be signed
     The jar file provided with the .zip file is already signed

A PDF Viewer Java Bean

Mark Striekwold has just released a new Java Bean allowing the developer to show a PDF document inside the Forms application.


Get it from here

Forms Rich Text Editor Java Bean

Hafed Benteftifa has just released his FRITE - Forms Rich Text Editor - alowing the Oracle Forms application to edit HTML content.

Frite
This is just the kind of Java Bean, developers and end-users were waiting for years !
Don't waste any more time, run and get it !


- page 3 of 13 -