Open topic with navigation
After having performed the lesson Learning to Support a Simple Control, you are familiar with the basic elements that the wizard creates in a new custom support class. Examine the contents of the new AllLightsCS.java file, and locate the following methods and declarations:
The declaration of the AllLightsCS support class, which indicates that it extends the AppletCS support class and implements the MouseListener interface.
The declaration of the DEBUG_ALLLIGHTSCS flag, which can be used to control printing log messages.
The AllLightsCS constructor method, which calls addSimpleListener to add MouseListener to the list of listeners that need to be registered on the AllLights control.
The to_class_attr method, which returns the new test object class name: AllLights.
A method stub for label_attr returning super.label_attr, which you can replace with a more specific label.
Method stubs for the oncount_attr, onlist_attr, and gameover_attr methods, which you must implement to support the identification properties you added. Until you do so, these methods return null, because these are new methods that you added and they are not implemented in the superclasses that AllLightsCS extends.
Note: You can use uppercase letters in the identification property names that you provide in the wizard screen. These names are written as is in the test object configuration file. However, in the names of the support methods for these identification properties, the wizard replaces uppercase letters with lowercase ones. In UFT, the identification property names are displayed in lowercase letters only.
Method stubs for the Restart_replayMethod and ClickLight_replayMethod methods, which you must implement to support the test object methods you added. Until you do so, these methods return the error code NOT_IMPLEMENTED.
The mouseRecordTarget method, which returns null to override recording of low-level mouse events.
Method stubs for the event handler methods defined by the MouseListener interface: mouseClicked, mouseEntered, mouseExited, mousePressed, and mouseReleased. These method stubs contain comments reminding you to implement them as necessary, calling MicAPI.record to send record messages to UFT.
The isWindow method, returning true, was added to the AllLightsCS support class because you selected the Controls of this class represent top-level objects check box, on the Custom Class Selection screen. When learning the test object, UFT calls the isWindow method to determine whether to look for a parent object or view this object as the highest Java object in the hierarchy.