Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
20 mars 2006 1 20 /03 /mars /2006 10:18


This JavaBean allows to find and handle the form windows (current window and MDI window).
With this handle, you can set some particular properties like the following:

   . setMovable()*
   . setClosable()*
   . setMaximizable()*
   . setMinimizable()*
   . setModal()*
   . setResizable()
   . setVisible()
   . enable()*
   . disable()*
   . setToolTipValue()*
   . setIcon()
   . setExtendedState() (only with SE 4.0)
   . setAlwaysOnTop() (only with SE 5.0)

    * You cannot apply this function on the MDI frame.


How to find the frames ?

You can recursively find the different layers with the getParent() function.

      Container container = this.getParent();
      while (container!=null)
        // output the object hierarchy
        System.out.println("--> "+container.getName()+" ["+container.getClass()+"]") ;
        container = container.getParent() ;

The FORMSFRAMES.fmb sample module shows, in the Java console, the list of all the layers.

The application Forms window class name is oracle.forms.ui.ExtendedFrame      
The application Forms MDI window class name is oracle.ewt.swing.JBufferedFrame

Notice that in future version, this class names may change.

The Java code


     The JAR file must be signed

The properties you can set

set the frame structure info
Set_Custom_Property('BL.BEAN',1, 'INFO','' ) ;

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

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

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

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

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

Set_Custom_Property( 'BL.BEAN', 1, 'SET','DISABLE' ) ;  

set icon for standar or MDI frame
Set_Custom_Property( 'BL.BEAN', 1, 'SETICON','target,icon_name' ) ;

    -- Set the MDI icon --
  Set_Custom_Property('BL.BEAN',1, 'SETICON','MDI,/indxicon.gif' ) ;
  -- Set the internal window icon --
  Set_Custom_Property('BL.BEAN',1, 'SETICON','WIN,/oracle.gif' ) ;

maximize the MDI frame (works only with the Sun Java Plug-in JRE 1.4)
Set_Custom_Property( 'BL.BEAN', 1, 'SETMAXSIZE','true|false' ) ;

Set the window always on top (works only with the Sun Java Plug-in JRE 1.5)
Set_Custom_Property( 'BL.BEAN', 1, 'SETONTOP','true|false' ) ;

(if you want to use this property, use the formsframes5.jar file instead of the formsframes.jar)

In this demo, 2 icon files are stored in the root of the jar file (indxicon.gif and oracle.gif)

The sample dialog

     . Download the formsframes.zip file
     . Unzip the file
     . copy the formsframes.jar file in the <ORACLE_HOME>/forms/java directory
       (or the formsframes5.jar if you use the 1.5 JRE)
         the jar file must be signed
     . Edit your /forms/server/formsweb.cfg file
     . Open the FORMSFRAMES.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

     Open the Java console to see the whole frame structure of the Forms module

Partager cet article

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


Maciej Myrcha 03/03/2016 15:10

I tried to use that bean and it works pefectly, except one thing. It is mentioned that it allows to use also setModal() method. Although it is not implemented here. I've tried to add it with no success - I got IllegalStateException error. When I checked the LWWindow class and its method setModal, I've noticed that the window has to be invisible in order to setModal work. But when I tried to set the window visible after setting its modality, the application hung. My questions are: am I doing something wrong? And is it possible at all to set the window modal programatically? I would need such functionality.
best regards