|
8.21. Frequently Asked Questions
The frequently asked questions in Bean Builder are listed here.
1. When I drop screens/classes as beans using the “ProjectClasses” tab, some of the dropped screens get displayed as a NonUIBean whereas I am able to see all the components of some screens. What could be the possible reason?
It is not possible to add a Top Level container like Frame into another Top Level container. You can add other components like panels into these Top Level containers. If the screen you drop is a Top Level Container (Build Types are Frame, Application (extension of Frame),dialog or NMSFrame) then it will be dropped as a invisible bean. However if the screen is of a type that can be added into a Top Level container (Build Types Panel, NMSPanel) then all the components will be visible.
2. What is the order in which the classpath will be set for a project/screen that is getting compiled?
The order of CLASSPATH for compilation is taken from the “Classpath Settings” tab of the “Project property Form”. It is as follows :
Values corresponding to ClassPath will be first. (You can change this order and it will be maintained).
Values corresponding to Containing Jars are second. (You can add jars to this entry but the order will be changed as the tool automatically updates the jars required by the project in this field only).
If “Append Builder Classpath” is selected then this is added finally (third in order) to the CLASSPATH.
3. A couple of questions on the “Override old class” option in the “Load Jar” dialog.
3.a. Does the option override the same class if it is found in a jar with a different name?
No. Only if the class is found in another jar with the same name the new class will have effect.
3.b. If I have used the option and now I drop a bean from the old jar (whose classes have been overridden) will the bean reflect the old jar’s class or the class from the latest jar that was used to override the old class?
It is the latest jar’s class that will take effect.
4. What does the “Append Builder Classpath” option in the “Project Property Form” do?
This adds all the classes that are present in the Classpath of the Bean Builder tool at startup to the Classpath of the project.
5. Can the applications created using the AdventNet Bean Builder be integrated with the AdventNet Web NMS?
Yes. Applications of Build Type a NMSPanel, NMSFrame and Applet can be created into a NAR. The Package Wizard can be used for the same. The created NAR can then be integrated into the WebNMS using the “Nar Installer” packaged along with the WebNMS.
6. Can I run/use the applet I developed using the AdventNet BeanBuilder exclusive of the BeanBuilder or WebNMS?
Yes. The applet can be directly run using JDK’s “appletviewer” or a standard Browser. The html file required to run the applet will be found under <YourProject>/html directory. You can achieve the same after deploying the project. The usage for the same is a appletviewer <html file>.
7. Can I use Bean components developed by someone else?
Yes. The Bean Builder accepts beans that conform to the standards of a Java's BDK. If the Beans are available in the form of a jar then you can use the “Load jar” option and load the jar to make the beans available in the Beans palette.
8. Can I modify the generated code or add some functions and recompile it?
Yes. You can add your own code and functions to the already generated code and compile the same. However the following point must be kept in mind while doing so.
You can add your own code either between //<UserCode_Begin_...> and //<UserCode_End_...> tags or outside the //<Begin_...> and the //<End_...> Tags. Otherwise it will get lost when you regenerate the source (This also implies that you should not modify the Bean Builder generated code that is found within the //<Begin_..> and //<End_...> tags).
9. How to generate debug message for my Application built with AdventNet Bean Builder?
As of now builder does not support application debugging. But you can debug the application using java's jdb. jdb debugging support from builder is available at the location ProjectProperties --> debug --> jdb. You can enable this and run the application. The status window will enable the command prompt for jdb debug. You can use the jdb commands in the status window for debugging.
10. When I tried to compile my project, I got this error message "You would need java compiler for this operation" -- What should I do?
You might have running the builder using JRE. You need JDK to compile the files generated using builder. Please check whether you are running the tool with JDK in path and tools.jar of JDK is in classpath.
11. In replace bean some beans get replaced and some does not. Why?
If the bean that is present there has a layout (like JPanel) and if the bean that is replaced does not a have layout (like JButton). Then you cannot replace the JPanel with JButton due to incompatibility in their layouts.
12. In Layouts the slight shaking of component changes the component position completely, how to overcome this?
Use the Cascade Lock Option, to lock the containers that you have already positioned. This will lock all the components in the container.
13. How do I resize a component in layout?
Resizing of components is allowed only in Flow Layout and in Border Layout. For more details regarding this refer documentation.
14. Is it possible to merge the projects together?
As of now there is no tool to merge two project into a single project. But Builder supports CVS versioning system. So two users can work on the same project simultaneously and check in the source to the same CVS repository to be in sync.
If you have two project that are independent and if you want to merge those two projects into a single project, then you can manually do that. Fist copy all the screens,source and classes of the first project to the second project (Note: Please make sure there is no duplication of the same screen name in both the projects while copying). Then update the containing jars entry of the project. Also take care of updating other project related entries into the merged project.
15. How to Internationalize your Application in Bean Builder?
Invoke the Project Property form --> Source Generation --> Internationalize the source. Check on this option (Note :By default it is un checked). Then if needed change the locale properties to get the properties file with your locale extension. Then regenerate the project.
16. How to Dynamically pass Parameters to sub screens or how I can dynamically change parameters in my project?
For Application type you can pass arguments. But this arguments will take effect only for the first time initialization. If you want to change the parameters dynamically across subscreen that are invoked from main screen, then you can do that by selecting the option available in Project Properties.
To achieve this
Step 1: Invoke the Project Property form --> Source Generation --> Dynamic Parameter Change Needed and check this Option (Note :By default it is checked)
Step 2: Make all properties that need to be dynamically updated as getParameter(). For example if you want the HOST to be set in a text field dynamically then in the setText property of the text field change the property to getParameter("HOST")
Step 3: Go to the Main Screen.
Step 4: Create a properties Object and put the property value for the HOST parameter in that property object.
Step 5: pass the property object to the setProperties() method.... The code will be like given below
Properties p = new Properties();
p.put("HOST",JTextField1.getText());
setProperties(p);
This will help you to see all the properties dynamically changing at run time.
17. How to specify your own constructor for a bean instead of default constructor at runTime?
By default for all beans the source generation will be invoking its null constructor or its applet constructor.
If a bean named ListPanel is dropped in builder it will have the source to be instantiated like
ListPanel = new ListPanel() or new ListPanel(applet)
If you have a constructor like new ListPanel(Obj) then you can change the source to be generated with the constructor you want.
To achieve it:
Step 1: Invoke the bean property form.
Step 2: find the property name called initializer in the property sheet.
Step 3: specify the initializer here as new ListPanel(Obj) (Note: By default it will be empty constructor or applet constructor).
Step 4: Now close the property sheet and go to the source tab.
Step 5: you can find the source in the source tab as given below.
ListPanel1= new ListPanel(obj);
18. How to specify the access modifier to Beans?
By default the beans that are dropped in Draw Area will have package level access i.e.., If a JButton bean is dropped in builder it will have package level access as given below.
javax.swing.JButton JButton1 = null;
You can change this package level access modified to private, public or protected as you need. To achieve it:
Step 1: Invoke the bean property form.
Step 2: find the property name called modifiers in the property sheet.
Step 3: specify the modifier here as private or public as you need (Note: By default it will be empty).
Step 4: Now close the property sheet and go to the source tab.
Step 5: you can find the source in the source tab as given below.
public javax.swing.JButton JButton1 = null;
19. How can I configure the various Look & Feel standards for the applications developed in Bean Builder?
The UI that are built using Bean Builder can be made ALF compliant by selecting the Look And Feel as "AdventNet Look and Feel" in the Project Property Form. i.e. in "Properties menu --> Project Properties --> General --> Look and Feel Standards". The components dropped thereafter will follow the ALF standard.
Alternatively the Look and Feel can also be defined by the user. For example assume that a user is developing an UI in which he wants to have some default properties set on the components, so that whenever he drops it from the palette the properties will be set by default.
If the user wants to have his/her own standards for a particular component, say a JButton, first he has to select the "User Defined Look & Feel" in the Project Property Form . i.e. in "Properties menu --> Project Properties --> General --> Look and Feel Standards".
Then if he wants to have all the buttons with foreground color red, he has to drop a JButton and set the foreground property as "Red" in the Bean Property Form (which can be opened by double-clicking on the bean or by navigating through "Properties menu --> Bean Properties"). Now, right clicking on the Jbutton and clicking the "AddToStandards" pop up menu will save the standards in a file specified in the Project Property Form. After doing this, whenever the user drops a JButton from the palette, it will have the foreground property (red) set on it. Thus the user needs to set the properties once and saving it to the standards will set the properties on the further dropping beans.
If the user does not want any Look and Feel to be set, he should choose "None" in the Project Property Form. ("Properties menu -->Project Properties -->Look and Feel Standards").
20. Can i invoke other tools from bean builder?
Yes, other tools can be invoked from bean builder.
step 1: In the tools Menu select Configure tools (Tools --> Configure Tools). Tool Configuration dialog is invoked.
step 2: In the Tool Configuration dialog
a) In the Menu text field enter the tool name (it can be any text. This text will be set for the menu item that will be added in the Tools menu) e.g. : SmartJar
b) In the Command text field enter the command which will invoke the tool.
Example:
for windows C:\AdventNet\BeanBuilder\bin\startSmartJarWizard.bat
for Linux sh /home/guest/AdventNet/BeanBuilder/bin/startSmartJarWizard.sh
step 3: press OK. A menu item of the name given in the Menu text field of Tool Configuration dialog is added in the Tools Menu.
step 4: Select the new menu item added in the Tools Menu. Smart Jar wizard will be invoked.
Any number of tools can be configured to start from Bean Builder , by clicking the new button in the Tools Configuration dialog.
21. Can i override the statements inside the begin end tags in a method generated by bean builder ?
Yes, the statements inside the begin end tags in a method can be over ridden as explained in the code snippet below .
public void setUpProperties()
{
JButton2.setText("OK");
if(false)
{
//<Begin_setUpProperties()>
try
{
JButton2.setFont(new Font("SansSerif",0,12));
JButton2.setHorizontalTextPosition(4);
JButton2.setText("test");
}
catch(Exception ex)
{
showStatus("Exception while setting properties for bean "+JButton2,ex);
}
//<End_setUpProperties()>
}
22. How can i set a project parameter which can be accessed across all the screens of the project?
The project parameters can be declared as follows
Open the project properties form
In the General tab, click the button next to Project Parameters Combo box. Project Parameter dialog list appears.
In the Project Parameter dialog the project parameters can be given.
example: name_param=john
The variable host can be accessed any where in the project using the getParameter(String) method as follows
example: String name = getParameter("name_param");
23. Can i set the values received from project parameters as values for bean properties in Bean Property Form
Yes, the project parameters can be set as values for bean properties in the Bean Property Form as explained in the example below
Drop a JTextField on to the screen.
In the Bean Property Form of the JTextField select the text property.
Invoke the Advanced Property Editor by clicking the button the text property.
In the Advanced Property Editor, type the parameter name in the textfield.
Select Project Parameter in the combo box .
Now press OK. close the property form. Compile and run the screen .
The value of the given project parameter will be set in the text field during run time.
24. Is it possible to start Bean Builder loading some projects by default ?
Yes. Follow the steps below.
Invoke Global properties (F2 / Properties -> Global Properties)
Browse the list of projects to load (.proj file's) and give it in "Projects to Load".
Exit the BeanBuilder and start again.
The given projects will be loaded by default.
25. Is it possible to get warning, verbose deprecated messages in Bean Builder while compiling?
Yes. Follow the steps below.
Invoke the Project Propertyform(F12 / Properties -> Project Properties)
Go to the Compilation tab.
Check the check boxes given for various options.
Compile a screen.
Output can be seen according to the selected options.
26. How to get javadoc help in the Bean Builder editor?
Go to the editor part of Bean Builder.
Right click on it and invoke the preferences.
Go to the Help Setup tab and give the javadoc location path.
Click ok.
Type JButton in the editor and select it.
Then right click on it and click Help.
Help for JButton will be invoked in the browser.
27. How to change the look and feel for my screen in BeanBuilder ?
In Screen properties form (F4 / Properties - > Screen properties). Select your look and feel from Look and Feel combo box and click ok.
28. How to change default size of a Bean dropped from the Beans Pallete ?
Go to Properties menu >> Global Properties, change the properties Bean Height and Bean Width to the size say 100x100 then this default size will be set to all the beans you dropped as the minimum size.
29. Does the application, which is developed using Beanbuilder, run in the same JVM as that of the Beanbuilder?
No, Bean Builder uses different JVM .You can change the JVM for running your application through the Properties menu --> Project Properties menu --> Run Setup tab change the default jdk path in the Java Home text field .
|
|
Note: Bean Builder uses same JVM for compile the application, But this is not configurable. |
30. Is it possible to make the Bean Builder toolbar as floatable ?
Yes, Set the property "floatable" as true (by default it will be false) in the file <Web NMS Home>/builderconf/menu/BB_MenuFrame.xml.
|
|
Warning: Please take a backup of the file before editing the same. |
|
|
Note: You have to restart BeanBuilder to the property to take effect. |
31. How to change the default properties set to a bean ?
Go to Properties menu --> Project Properties --> General tab, in the " LookandFeel Standards" combobox select " UserdefinedStandards" close the dialog. Now drop some beans and modify the properties then select "Add to Standards" from the right click popup menu for each bean that you have been dropped.
32. How to save the error messages and log messages generated by Bean Builder ?
Go to Properties menu --> Global Properties. In "Error Log File" and "Output Log File" fields the give file path where you want to save those messages and check the check boxes along with the text fields.
33. Is it possible to change the shortcuts for menu items in Bean Builder?
Yes. You can change the shortcuts by changing the entries specified in <Web NMS Home>/builderconf/menu/BB_MenuFrame.xml file.
|
|
Warning: Please take a backup of the file before editing the same. for example , <MENU-ITEM name="Status Window" shortcut_key = "S" accelerator_key = "F8"> //Here the short cut changed as F8 by default it will be F7 |
|
|
Note: You have to restart Bean Builder for the property to take effect. |
34. How can I pass Arguments for An Application?
Invoke Project Properties Form & Go to the RunSetup tab.
In the Application Arguments text field, enter your Arguments to be passed.
35. Is there anyway to change the package structure of my project?
Yes. You can change your project package structure in the following way.
Invoke Project Properties form & goto the source generation tab.
In the Package Name text field, change the package name as per your wish.
If you want to create package structure for an already existing project also, you can follow these steps.
36. Can I associate a popup menu for a bean and screen in the run time?
Yes, you can. To achieve it follow the step below.
Right click on the screen & select Menus -> Create Menu in the screen popup menu
Screen Menu Configuration UI will be invoked.
Create a Popup menu & close the UI
Now select the screen and right click on it.
Go to Menus -> Popup Menus and select the popup menu you have created.
For a Bean, invoke the bean popup menu. select Popup Menus and choose your own popup menu.
While running the screen, if you right click on the bean or screen, then the selected popup menu will be present.
37. How to get the line number in the exception thrown in status window while running a screen or project in BeanBuilder ?
Go to Properties -> Project Properties (F12)
In the ProjectProperties dialog go to the compilation tab and check the "Include Debug info" check box.
Compile and run the screen.
Now, if any exception is thrown, it contains the line number at which the exception is thrown.
38. How can I customize the properties displayed for a bean in its Property Sheet?
You can categorize the bean's properties under different user defined groups. For this, you can create your own group and add the properties which are all to be listed under the group. The changes in any one of the groups will take effect in All Properties group also.
Example:
Create a XML file with the name of the bean for which the properties are going to be grouped. (For e.g. HCellularGauge bean create a xml file with name HCellularGaugeBeanGroup.xml).
Now put the entries for group name & its values i.e., properties which are going to be present under the group.
Now update the corresponding BeanInfo.Jar file with the XML file (In this case update the AdventNetUIBeanInfo.jar).
In the Jar, the XML file should be present with the proper package structure. (AdventNetUIBeanInfo.jar/com/adventnet/beans/gauges/HCellularGaugeBeanGroup.xml).
Load the JAR in BeanBuilder and invoke the HCellularGauge Beans Property form to see the customized Property sheet. (Refer documentation for further knowledge).
39. Can I take a printout of source files which are opened in the Bean Builder?
If your system is printer configured, then you can directly take a printout of the source files by invoking the "File --> Print File" option.
The Bean Builder invokes the System properties for printing.
40. Can I customize the source generation process for screens of a particular project ?
The source for dropped screens are generated from the pre-defined template files present under <Web NMS Home>/builder_template directory. If you want to have specific methods or comments for screens of a particular project to be generated automatically, you can place a copy of the template file inside the project's template directory and customize it to your needs.
Whenever the particular screen is dropped for the project, source will be generated according to the
customized template present in the projects template directory. If there are no files present under the project's template directory, the source will be generated from the default templates.
|