Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
5 janvier 2007 5 05 /01 /janvier /2007 13:22


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.


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


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

Partager cet article

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article