This topic illustrates the structure of code generated by the Device Application Designer, and describes the contents of folders.
The BlackBerry application is built into two parts: the client application and the options library. The application package contains all client code, while the options package contains options code. The custom package accommodates all screen classes as well as any tab folder packages. The tab panel classes are contained in the tab folder packages.
You can enable custom code generation by assigning a value of true to the platform-specific property Generate a custom coding subclass for the Device, Screens, Tab Folder, and Tab panels. You can specify this property for all elements from the preference page.
The default generated code location is <%current_workspace%>\<%current_project%>\DAD Generated Code\<%current_dad_file_name%>\Blackberry. In that location, the application client code is in the generated/application folder. The options module code is in the generated/options folder. The image files are in the generated/images folder. The JavaDoc files are in the generated/doc folder.
The custom code is generated into the custom folder in the same package structure as the generated folder. The applicationandoption folders, contain the custom code for the main application and the option application, respectively. For each element that enables custom coding, a subclass is generated into the application folder. Once generated, the custom subclass is not overwritten in subsequent code generation unless you select Remove custom folder in the generation wizard.
All object API code is generated into a separate folder named object_api. This folder contains subfolders for the main application and option application.
You can customize subclasses to insert your own code in your development environment.
For elements that support widget events, you can specify what events are supported for a particular element. When you select events, those events take effect in the application. An event delegate is generated in the custom folder for all events (whether selected or not). This allows the delegation of all the selected events for an element. The event delegate class is in same package as its element’s containing class (that is, the event delegate class for a button is located in the same package as the subclass for the parent screen).
You can customize the event delegate to apply your own code.
Similar to the custom subclasses, the event delegate is not overwritten during subsequent code generation, unless you select Remove custom folder.