8.7.4 Adding Beans to Palette

The Bean Builder does not restrict you to use its components alone. If you feel the need to load other jars and use the beans in them to create applications and applets, the Bean Builder lets you do that. Beans can be loaded or unloaded by using the "Load Jar" and "Unload Jar" option of the 'File' Menu.

 

The Component Palette is the visual interface for the user to select and use a bean, be it user defined or pre-defined. Click here to view the Component Palette and its details.

 

Different file formats (*.jar, *.list,*.bxml) are allowed for loading. Once a file has been loaded, it is visible in the Component Palette. The below picture shows the dialog invoked, when "File-->Load Jar" option is chosen.

 

 

 

Note: Even though the "Override old class" option is selected by default , it is preferable to uncheck it. It is mostly useful when the user wants to see the difference between the different versions of the same bean or when developing/testing a bean.

 

 

Note: The jar files loaded automatically by default will be present in <Web NMS Home>/classes  directory.

 

A Short Description of the different file formats

 

Jar File

 

This is the Java archive format. More information about jar files can be found in any JDK documentation. One important feature of the Bean Builder is that for a jar named abc.jar, another jar named abcBeanInfo.jar is also present in the same directory. On loading the jar abc.jar, the abcBeanInfo.jar is also loaded. This feature is to allow packaging of the classes necessary for design time such as BeanInfo classes, its icons,property editors etc. as a separate jar. This helps in reducing to a great extent the size of the jar needed for runtime.

 

List

 

This file provides an easy way of adding beans to the Component Palette. The beans can be specified as <bean names> in separate lines. If needed, the corresponding image icons for the beans can be specified using the construct <bean names>= <icon file name>. Note that the class files and icon files should be present in the already loaded jars or needs to be in the ClassPath. (e.g. SwingBeans.list present in the <Web NMS Home>/classes directory).

 

BXML files

 

This file provides an easy way of saving modified properties of beans (ie, customizing the beans to have some properties set to some default values without the need to create a new bean). Any Screen file <ScreenName>.config can be converted into a .bxml file by just renaming the file to <ScreenName>.bxml. Now load the bxml file using 'Load Jar' option and use the file.



Copyright © 2011 ZOHO Corp. All Rights Reserved.