The ModCursor Pluggable Java Component (PJC) allows you to define a specialized mouse cursor for an item. Although you can set the mouse cursor using the Set_Application_Property() built-in within Forms, this needs a suitable event to work off. Mouse Enter and Mouse Leave events are not supported by Forms on the web so it is not possible to change the cursor shape when the mouse is over a particular field. The ModCursor provides a way of doing this by handling the mouse focus events in the client and changing the cursor shape without a call from Forms Services on the middle tier.
The simple java code supplied, only supports single line text items and a limited number of cursor styles:
However, the code is intended to act as a template should you want to apply similar functionality to other item types. The code demonstrates how to set up your own mouse listener on an item which can be used to carry out tasks - in this case changing the cursor style.
The ModCursor demo consists of the following files (relative directories shown in brackets):
The doc directory and the classes directory contain the JavaDoc for the code and the compiled class respectively
In order for an application to be able to use the ModCursor PJC the relevant configuration in the formsweb.cfg file has to ensure that the supplied modcursor.jar (or another jar file containing the compiled ModCursor class) is included in the relevant archive setting.
An entry in the formsweb.cfg file for an application that used the ModCursor PJC would look like this:
[ModCursor] pageTitle=OracleAS Forms Services - ModCursor Demo IE=jinitiator baseHTMLJInitiator=demobasejini.html archive_jini=frmall_jinit.jar,modcursor.jar form=modcursorforms/java width=675 height=480 separateFrame=false splashScreen=no lookAndFeel=oracle colorScheme=blue background=/formsdemo/images/blue.gif
You must first create a normal Forms text item (single line), then set the Implementation Class property for this button to oracle.forms.demos.ModCursor. Note that this property is case sensitive and must be entered exactly as shown.
To define the mouse cursor displayed by the PJC you need to set the custom property DOCURSOR to one of the following values.
e.g.
SET_CUSTOM_PROPERTY('PJC.LINK_FIELD',1,'DOCURSOR','HAND');
The first argument to Set_Custom_Property() is the name or id of the PJC enabled item. The second parameter defines the instance of the control that you wish to set the property on. This index number is one based and represents the physical control in the user interface (rather than the record number in the underlying block). You can use the constant ALL_ROWS to set the property on all instances of the PJC for this field. The third argument is the custom property that is being set on the PJC and the forth the value.
Once the mouse cursor shape is defined through this interface the cursor shape will be used whenever the mouse moves over the PJC. To reset the cursor set the custom property again - this time to DEFAULT
Property | Get | Set | Valid Values / Return Value | Purpose |
---|---|---|---|---|
DOCURSOR | Yes | Yes | HAND | CROSSHAIR | WAIT | MOVE | DEFAULT | The mouse cursor style to adopt. |