Note:
If you have downloaded this example, check your project properties and adjust
the OUTPATH, etc. as necessary to match your current installation.
Once you have made these changes do Build | Make "BeanCustomizer.jpr". You can then add the bean to the palette if you like, or simply launch the designer on TestFrame.java.
Customizers
This sample contains two customizers. A "live mode" customizer and a "batch mode"
customizer. Each has its pros and cons. Switch between customizers by changing
the livemode var in the BeanInfo file and recompiling. By default, the live mode
customizer is in use. To activate the customizer, select the bean on the design
surface or structure pane (tree), rt-click and select Customizer. The customizer
allows for "one stop" access to some or all of the properties surfaced by the Bean.
Bean reloading
Check out the live customizer, change the BeanInfo to use the batch mode customizer,
recompile and go right back into TestFrame to see the changes. Bean reloading allows
you to "twiddle" with a Bean and check the changes in the designer by recompiling
the bean. No more exiting and reloading JBuilder to check a change!
enumerationValues
Both the "style" and "Use Month String" properties are examples of this new-with-Swing
BeanInfo addition. It's an extension of PropertyDescriptors accessed via setValue.
See commets in DateBeanBeanInfo.java for more info. enumerationValues really helps
a RAD tool in generating readable code. No more setFoo(1); in the code. Now
you can get setFoo(bean.My_Really_Helpful_Constant); instead
Default Editors
Same as 1.0. JBuilder surfaces "stock" editors based on data-type. The font and
color related properties in DateBean have these editors.
Property Hiding
BeanInfo is the official mechanism for controling what properties "show" in a
RAD tool. This allows you to hide properties that you may have received from
parent objects but which may not make sense for your bean.
Property renaming
Sometimes a property name doesn't really convey its meaning or use. If it's a
property from a parent object, use BeanInfo to adjust its meaning. The fontColor
property of DateBean does that. fontColor is really a redirect for the foreground
color property found in java.awt.Component.
Project Folders
Project folders are an organizational aid in JBuilder. In this project, they
contain the images used by the bean and keep them "out of the way" of your source
files. On the first compile, these images are automaticly copied to the outpath
so that they are in the correct location relative to the classes that they serve.