Mardi 13 février 2007
This Bean contains a 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.


Formatting


This bean is proposed by Tom Cleymans from Belgium.

Read the article
par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (0)    recommander
Mercredi 7 février 2007
Purpose

Here is a package that allows the dispatching of events from Java Beans to Forms on Beans that extend VBean, beans that use the FBean package and also PJCs !
No, you are not dreaming and there is no mist on your glasses, a PJC that dispatch event to the form module !

            Dispatching events


You know that a Bean that extends VButton or VTextField for example cannot use the dispatchCustomEvent() method to send message to Forms, so how could this be possible ?

Tom Cleymans from Belgium brings here the solution.

He decided to attach a class that extends VBean to each PJC, so that it can use the included dispatchCustomEvent() method to send messages to the corresponding Forms' module Bean Area.

As brilliant as simple !

Read the Tom's article then do what you are searching for years.

par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (1)    recommander
Mardi 30 janvier 2007
Purpose

Here is a Java Bean that allows to paint the current canevas with a Java gradient.
It needs the JRE 1.4 (Sun Java Plug-in)

     Gradient Canevas



The Java code

     PaintCanevas.java



The implementation class of the B
ean

     oracle.forms.fd.PaintCanevas


The methods you can call

 

  • Set the gradient parameters

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_GRADIENT_COLORS', '255,255,0,255,0,0');

    It takes two RGB colors, the starting color then the ending color.


  • Set the Horizontal cycle

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', 'cycle_info' ) ;

    Set the Horizontal cycle when you want to have a repetitive gradient.

    You can provide a value exprimed in pixel or a fraction

    e.g.: 

    - repeat the gradient 2 times horizontally:

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', '/2' ) ;





    - repeat the gradient each 50 horizontal and vertical pixels

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_H_CYCLE', '50' ) ;
    Set_Custom_Property( 'BL.BEAN', 1, 'SET_V_CYCLE', '50' ) ;






  • Set the Vertical cycle

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_V_CYCLE', 'cycle_info' ) ;

    See the Horizontal cycle explanation.


  • Set the gradient direction

    Set_Custom_Property( 'BL.BEAN', 1, 'SET_GRADIENT_DIRECTION', 'direction' ) ;

    Where direction can take one of the following values:

      LeftToRight : Left to Right
      UpToDown : Up to Down
      LeftUpToRightDown : Left Up to Right Down
      LeftDownToRightUp : Left Down to Right Up

Of course, you can have one Bean per canevas, so you can have some nice mixed compositions with multiple canevases !




The sample dialog

   . Download the gradientcanevas.zip file
   . Unzip the files
   . copy the paintcanevas.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the GRADIENT_CANEVAS.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module
 

 
par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (0)    recommander
Vendredi 26 janvier 2007
 Purpose

Here is a Swing JButton that overloads a standard PJC's button.
It needs the JRE 1.4 (Sun Java Plug-in)

     Swing button

It allows to have a standard Forms button with some nice decoration features.

You can apply a gradient color, set rounded borders, justify the label and also have a shadow behind the label.
Because it is firstly a PJC, you can set most of the common properties with the Set_Item_Property() built-in (label, position, foreground color, background color, etc...).

The gradient feature is part of the JRE 1.4 so this bean need the Sun Java plug-in to run.



The Java code

     SwingButton.java      CButton.java



The implementation class of the Button item

     oracle.forms.fd.SwingButton


The methods you can call

 

  • Set the gradient parameter

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_GRADIENT_COLOR', '255,255,0,255,0,0');

    It takes two RGB colors, the starting color then the ending color.


  • Set the label's shadow color

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_SHADOW_COLOR', 'r,g,b');

    On the screenshot, you can see a white shadow behind the label.


  • Set the buttons's border color

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_BORDER_COLOR', 'r,g,b');


  • Set the gradient direction

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_GRADIENT_DIR', 'direction');

    Where direction can take one of the following value:

      1 : left to right
      2 : right to left
      3 : up to down (like the screen-shot)
      4 : down to up


  • Set the text position

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_TEXT_POSITION', 'left | center | right' ) ;


  • Set the image position

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE_POSITION', 'HV' );

    Where H can be:
    Left, Center, Right

    and V can be:
    Top, Middle, Bottom


        
    LT CT RT
    LM CM RM
    LB CB RB


  • Set the current image name

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE', 'image_name[,position]');

    position is facultative and by default CM (Center Middle)


    image_name can be a url (http://...) a client machine file (d:/...) or a JAR file.



  • Set the mouse ON image (that appears when the mouse enters the button)

    Set_Custom_Property('BL.SWINGBUTTON', 1, 'SET_IMAGE_ON', 'image_name' ) ;


  • Set the rounded setting

    Set_Custom_Property( 'BL.SWINGBUTTON', 1, 'SET_ROUNDED', 'horizontal diameter,vertical diameter' ) ;





The sample dialog

   . Download the swingbutton.zip file
   . Unzip the files
   . copy the swingbutton.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the SWINGBUTTON.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module

   The swingbutton.jar file have to be signed.
   The swingbutton.jar file provided with the article is already signed.

par Oracle Forms community publié dans : PJC - Buttons
ajouter un commentaire commentaires (2)    recommander
Mercredi 10 janvier 2007
 Purpose

Here is a text item's PJC that can be used in multi-records Forms tables.

     Multi-record PJC textfield

It allows to have a coherent behaviour in a multi-record table for items that record number are greater than the number of records displayed.

In the standard way, you can set an Implementation Class to a PJC that extends the corresponding Forms item type (VTextField in this example), but you cannot use the Set_Custom_Property() built-in on a record number greater than the number of records displayed block's property.
For instance, it this property is set to 10 (ten records displayed by the block), the following instruction will raise an error:

Set_Custom_Property( 'BL.TEXT_ITEM', 11, 'SET_PROPERTY', '...' );

This is a problem because you cannot use a PJC on a multi-record block if the number of records fetched or created is greater than then number of records displayed.

This PJC can be used in this case because it holds a table of objects for each PJC's instance.
You can use it to give each record  a special color (without having to use the Set_Item_Instance_Property() built-in with tens of visual attributes), or also have one different hint and tooltip for each record (which is not possible in standard).

How it works:

Within the PJC:

each PJC's instance (10 in this example) can handle 0 to n physical records.
You can see, on the screenshot above that the first line displays the record #9. If you scroll the block, it would display the 10th, then the 11th, and so on.
So, each PJC instance hold a table of objects. Each physical record must have a corresponding object in this table.

In this sample, each object contains the following values:


   . tooltip
   . hint
   . background color
   . foreground color
   . int value
   . float value
   . string value



Within the Forms module:

The trick is to re-draw all the displayed items (the page set) with their corresponding values.
This job is done in the When-New-Item-Instance block-level trigger:

Declare
  LN$Pos pls_integer ;
  LN$Max pls_integer := Get_Block_Property( :system.current_block, RECORDS_DISPLAYED) ;
  LN$Top pls_integer := get_block_property( :system.current_block, TOP_RECORD) ;
Begin 

---------------------------------------------------
-- Calculate the cursor position in the page set --
-- cannot be greater than the number             --
-- of records displayed                          --
---------------------------------------------------

If LN$Top > 1 Then 
  LN$Pos := :system.cursor_record - LN$Top + 1 ;
Else
  LN$Pos := :system.cursor_record ;
End if;

--------------------------------
-- Handle the graphic aspects --
-- for the entire page set    --
--------------------------------

For i In 0 .. LN$Max-1 Loop
  Set_Custom_Property('BL.TXT', i+1, 'PAINT_RECORD', to_char(LN$Top+i) );
End loop ;

End;




The Java code

     MultiTextField.java      MultiProps.java



The implementation class of the Text Item

     oracle.forms.fd.MultiTextField


The methods you can call

 

  • Add a new record object

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_NEW_REC', 'num_record' ) ;


  • Set the Foreground color

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_FGCOLOR', 'num_rec,r,g,b' ) ; 


  • Set the Background color

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_BGCOLOR', 'num_rec,r,g,b' ) ; 


  • Set the hint

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_HINT', 'num_rec,hint_text' ) ; 


  • Set the tooltip

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_TOOLTIP', 'num_rec,tooltip_text' ) ; 


  • Set a int value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_INT_VALUE', 'num_rec,int_value' ) ;


  • Set a float value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_FLOAT_VALUE', 'num_rec,float_value' ) ;


  • Set a char value

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_CHAR_VALUE', 'num_rec,char_value' ) ;


  • Set the curent record indice

    Set_Custom_Property( 'BL.TEXTITEM', disp_rec, 'SET_INDICE', 'physical_record_number' ) ;



The methods you can get

 

  • every property set

 

   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp_rec, 'GET_HINT' ) ;
      Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_TOOLTIP' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_INT_VALUE' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_FLOAT' ) ;
   Varchar2 := Get_Custom_Property( 'BL.TEXTITEM', disp
_rec, 'GET_CHAR' ) ;

The property is read for the physical record number indicated by the SET_INDICE property, so you have to set this property before.

e.g. : 

-------------------------------------------------
-- Get the hint of the current physical record --
-------------------------------------------------

Set_Custom_Property('BL.TXT', LN$Pos, 'SET_INDICE', to_char(:system.cursor_record) );
Message(Get_Custom_Property('BL.TXT', LN$Pos, 'GET_HINT' ));




The sample dialog

   . Download the pjcmultirec.zip file
   . Unzip the files
   . copy the multirecord.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the PJCMULTIREC.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module

par Oracle Forms community publié dans : PJC - Text items
ajouter un commentaire commentaires (0)    recommander
Mardi 9 janvier 2007
Purpose

Here is a Java bean that allows to Drag 'n Drop between Forms items.

Drag 'n Drop

You can Drag 'n Drop between mono and multi-line text fields and between images.

Because the "real Java" Drag 'n Drop is not implemented in the Forms application, This one is "hand made".
So when you release the mouse button to drop the object, you have to move the mouse about one pixel to
really drop the object.

Press the Ctrl keybord key if you want to keep the original object (COPY).

This demo load the image from the c:/wile.jpg image file, so copy this file from the zip file to your c:/ directory.


The Java code

     DnD.java



The implementation class of the Bean Item

     oracle.forms.fd.DnD




The sample dialog

     . Download the DnD.zip file

     . Unzip the file
     . copy the DnD.jar file in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add this jar file
     . Open the DnD.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (3)    recommander
Lundi 8 janvier 2007
 Purpose

Here is a PJC for textfields that allows to have a blinking behaviour.

Blinking textfield

This behaviour could be easily applied to other kind of items, like Command buttons for instance.


The Java code

     BlinkTextField.java



The implementation class of the Text Item

     oracle.forms.fd.BlinkTextField


The methods you can call



  • Set the blinking rate

Set_Custom_Property( 'BL.BEAN', 1, 'SETBLINKRATE', 'milliseconds' ) ;

  • Set the Foreground color

Set_Custom_Property( 'BL.BEAN', 1, 'SETFGCOLOR', 'r,g,b' ) ;


  • Set the Background color

Set_Custom_Property( 'BL.BEAN', 1, 'SETBGCOLOR', 'r,g,b' ) ;

  • Start blinking

Set_Custom_Property( 'BL.BEAN', 1, 'START', '' ) ;

  • Stop blinking

Set_Custom_Property( 'BL.BEAN', 1, 'STOP', '' ) ;




The sample dialog

   . Download the blink.zip file
   . Unzip the files
   . copy the blink.jar file in the /forms/java directory
   . Edit your /forms/server/formsweb.cfg file to add the jar file
   . Open the BLINK.fmb module (Oracle Forms 9.0.2)
   . Compile all and run the module

par Oracle Forms community publié dans : PJC - Text items
ajouter un commentaire commentaires (0)    recommander
Vendredi 5 janvier 2007
Purpose

Here is a collection of PJCs that allow to have multiline labels and tooltips.
The tooltips can have a nice decoration like Java gradients, and be displayed anywhere on the screen.

It needs, at least, the Sun Java plugin 1.4 to run. It won't run against the JInitiator.


        Multiline

All the properties can be set within the Tooltip item property.
So it is convenient for modules generated by Oracle Designer for instance
(no need to use the Set_Custom_Property built-in)


The character that simulates the carriage return is the | (alt+124)
You can place it in both label and tooltip properties.

On the image above, you can see the multi-line CheckBox label.

Here are its particular properties:

   Implementation Class : oracle.forms.fd.JCheckBoxMLline
   Label : Check|box
   Tooltip : CheckBox tooltip<params>fg=255,255,255 bg=120,120,255</params>


The parameters set in the tooltip property must be entered between the <params> and </params> tags.
The properties you can set are:

   the tooltip text color : fg=r,g,b
   the tooltip background color : bg=r,g,b[,r,g,b]
   the tooltip position : pos=x,y





The Java code

     src.zip



The implementation classes of the Bean Item

   There are as many classes as Forms item types:

Forms item Implementation Class property
Check Box item oracle.forms.fd.JCheckBoxMLline
Combo list oracle.forms.fd.JComboBoxMLline
T list oracle.forms.fd.JTListMLline
Pop list oracle.forms.fd.JPopListMLline
Radio button oracle.forms.fd.JRadioButtonMLline
Text item oracle.forms.fd.JTextFieldTooltip
Command button oracle.forms.fd.JVButtonMLline



The methods you can call


  • Set the tooltip text color

Set_Custom_Property( 'BL.BEAN', 1, 'SET_TEXT_COLOR', 'r,g,b' ) ;

  • Set the backgtound tooltip color

Set_Custom_Property( 'BL.BEAN', 1, 'SET_COLORS', 'r,g,b[,r,g,b]' ) ;

If you set two colors, the tooltip background will be colorized with a gradient from the first color to the second one.
e.g. :

// set background tooltip color gradient from red to yellow
Set_Custom_Property('BL.BEAN', 1, 'SET
_COLORS', '255,120,120,255,255,128' ) ;         


// set background tooltip color to light blue
Set_Custom_Property('BL.BEAN', 1, 'SET
_COLORS', '120,120,255' ) ;         

  • Set the tooltip absolute position

You can enforce the tooltip to be displayed on a particular position relative to the parent window (default) or the MDI window.
The X,Y coordinates are in pixel.

Set_Custom_Property( 'BL.BEAN', 1, 'SET_POSITION', '10,250' ) ;

  • Set the window attachment for absolute tooltip position

Set_Custom_Property( 'BL.BEAN', 1, 'SET_ATTACH', 'MDI | anything_else' ) ;

If you decide to use the absolute tooltip positionning (SET_POSITION) you can define if the tooltip is attached to its parent window (default) or to the MDI window



The sample dialog

     .
Download the multiline.zip file
     . Unzip the files
     . copy the
Multiline.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file to add these 2 jar files
     . Open the
MULTILINE.fmb module (Oracle Forms 10.1.2)
   . Compile all and run the module

par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (0)    recommander
Mardi 26 décembre 2006
Purpose

Here is a Java bean that allows to have an enhanced Web Browser.
It is a full Web browser that can handle Javascript and display Flash animations.

The material comes from a sourceforge project:
http://sourceforge.net/project/showfiles.php?group_id=170904


Enhanced Web Browser

It can accept both http url and local machine html file names.


The Java code

     EnhancedHTMLBrowser.java



The implementation class of the Bean Item

     oracle.forms.fd.EnhancedHTMLBrowser


The methods you can call



  • Get the Forms Window

Set_Custom_Property( 'BL.BEAN', 1, 'INFOBEAN', '' ) ;

This must be used to retrieve the Forms window that handles the webBrowser, then synchronize its position when the windows is moved. This must be the first property set (in the When-New-Form-Instance trigger).

 

 

 

 

 

  • Set the URL/File

Set_Custom_Property( 'BL.BEAN', 1, 'SET_URL', 'url | file_name' ) ;


e.g. :

Set_Custom_Property('BL.BEAN', 1, 'SET_URL', 'http://www.developpez.com/' ) ;         


Set_Custom_Property('BL.BEAN', 1, 'SET_URL', 'd:/mypage.htm' ) ;


  • Set the border of the bean

Set_Custom_Property( 'BL.BEAN', 1, 'SET_BORDER', 'true | false' ) ;


When you want to use this bean to display a Flash image (*.swf), you would probably prefer not to have any border bounding the image.
In this case, set the border to false.


  • Basic navigation

Set_Custom_Property( 'BL.BEAN', 1, 'SET_NAVIGATION', 'back | forward | refresh' ) ;



The sample dialog

     .
Download the eHTMLBrowser.zip file
     . Download the sourceforge project zip file

     . Unzip the files
     . copy the jdic.jar and eHTMLBrowser.jar files in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add these 2 jar files
     . Add the 2 .dll files and IeEmbed.exe (from the javaflashbridge-v1.zip file) to your Windows/system32 directory
     . Open the EHTMLBROWSER.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

     The .jar files must be signed
     The eHTMLBrowser.jar and jdic.jar files provided with the .zip file are already signed


 

 

 

 

 

par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (7)    recommander
Vendredi 22 décembre 2006
Purpose

Here is a Java bean that allows to start programmes on the client machine, then capture the standard/error output.
It could be used if you don't want to install or use the Webutil library.


Java Host

If you target to use parameters that contain blanks, separate them by a comma.
The output lines are sent by the external programme (and received by Forms) asynchronously.



The Java code

     JavaHost.java



The implementation class of the Bean Item

     oracle.forms.fd.JavaHost


The methods you can call


  • Set the command

Set_Custom_Property( 'BL.BEAN', 1, 'SET_PROG', 'command' ) ;


e.g. :

Set_Custom_Property('BL.BEAN', 1, 'SET_PROG', 'cmd /c dir /b d:/*.jpg' ) ;         

If you intend to use parameters that contains blanks, use a comma to seperate them:

Set_Custom_Property('BL.BEAN', 1, 'SET_PROG', 'cmd,/c,findstr,"width height", d:/oracle9i/forms90/server/formsweb.cfg' ) ;


The event raised by the bean



  • MSGSTND

This event is raised by the bean to inform Forms that a line has been sent by the external process on the standard output.

  • MSGERROR

This event is raised by the bean to inform Forms that a line has been sent by the external process on the error output.


Here is the code of the When-Custom-Item-Event trigger of the sample dialog:

DECLARE
   
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    LC$Msg     Varchar2(32000);
    LC$Item    varchar2(256);
    LC$Event   varchar2(256);  
   
BEGIN
   
   IF (eventName='MSGSTND') THEN
      -- get the standard output --
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'MSGTEXT',eventValueType, LC$Msg);
      If Length(:BL.RESULT) + Length(LC$Msg) > 32000 Then
       :BL.RESULT := '' ;
      End if ;
      :BL.RESULT := :BL.RESULT || LC$Msg || CHR(10) ;
      Synchronize;
   ELSIF (eventName='MSGERROR') THEN
      -- get the component properties --    
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'MSGTEXT',eventValueType, LC$Msg);
      If Length(:BL.RESULT) + Length(LC$Msg) > 32000 Then
       :BL.RESULT := '' ;
      End if ;
      :BL.RESULT := :BL.RESULT || ' *** ERROR ***' || CHR(10) || LC$Msg || CHR(10) ;
      Synchronize;
   END IF;
   
END;


The sample dialog

     . Download the javahost.zip file

     . Unzip the file
     . copy the javahost.jar file in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add this jar file
     . Open the JAVA_HOST.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

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


par Oracle Forms community publié dans : Bean - general
ajouter un commentaire commentaires (0)    recommander
Créer un blog sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur avec TF1 Network - Signaler un abus