A JavaBean to read the Window Forms menu
By francois degrelle on Friday, March 27 2015, 15:15 - PJC - Javabean - Permalink
Purpose
Here is a Java Bean to read the Window Forms menu option.
You have access to every window opened in the Forms application to minimize or restore them.
The Java code
WindowMenu.java
The implementation class of the Bean Item
oracle.forms.fd.WindowMenu
The methods you can call
Scan the application to find every opened window
Set_Custom_Property('BLOCK.ITEM',1,'FIND_WINDOWS');
e.g. :
Set_Custom_Property( 'BL.BEAN', 1, 'FIND_WINDOWS', '' ) ;
Minimize all windows
Set_Custom_Property('BLOCK.ITEM',1MINIMIZE_ALL','');
Minimize a single window
Set_Custom_Property('BLOCK.ITEM',1MINIMIZE_WINDOW','window_title');
Restore all windows
Set_Custom_Property('BLOCK.ITEM',1RESTORE_ALL','');
Restore a single window
Set_Custom_Property('BLOCK.ITEM',1RESTORE_WINDOW','window_title');
Set the window(s) bounds
Set_Custom_Property('BLOCK.ITEM',1,'SET_BOUNDS','param');
Where param is: WINDOW_NAME|ALL,x|-[,y|-[,width|-[,height|-]]]
Use the ALL keyword to move all the windows.
Use a - instead a value to skip its definition:
-- set all windows new X position to 30 pixels
Set_Custom_Property( 'BL.BEAN', 1, 'SET_BOUNDS', 'ALL,30,-' ) ;
-- set all windows X position to 10 and width to 100
Set_Custom_Property( 'BL.BEAN', 1, 'SET_BOUNDS', 'ALL,10,-,100,-' ) ;
The properties you can get from the JavaBean
Get the list of opened windows
Varchar2 := Get_Custom_Property( 'BL.BEAN', 1, 'GET_WINDOWS' ) ;
Returns a comma separated list like the following : Window 1,Window 2[,...]
The sample dialog
. Download the windowmenu.zip file
. Unzip the file
. copy the windowmenu.jar file in the <ORACLE_HOME>/forms/java directory
. Edit your /forms/server/formsweb.cfg file to add windowmenu.jar .
. Open and compile both the windowmenu.fmb and windowmenu2.fmb modules (Oracle Forms 9.0.2)
. Compile all and run the windowmenu module