UniVista Programmer's Guide

UniVista.beaninfo

VariableDisplayBeanInfo


Intent | Structure | Participants | Sample Code | Known Uses

Intent

All of the display beans for UniVista Variables use this as their BeanInfo base class.  It is not abstract, since it extends java.beans.SimpleBeanInfo, but it should never be used directly.  The display beans implemented in UniVista use a more specific subclass to describe their properties.  Following this model commits the subclass to use its associated methods and properties which are thought to be helpful on behalf of the Variable display beans.

Structure

Participants

Sample Code

The following code shows how one of the methods are implemented and how the beanClass is related.
public class VariableDisplayBeanInfo extends
                            SimpleBeanInfo {

private final static Class beanClass =
                            VariableDisplay.class;

/**
 * VariableDisplayBeanInfo constructor.
 */
public VariableDisplayBeanInfo() {
    super();
}
public BeanDescriptor getBeanDescriptor() {
    BeanDescriptor bd = new BeanDescriptor(beanClass,
                    VariableDisplayCustomizer.class);
    bd.setDisplayName("Variable Display Bean");
    return bd;
}
//...

The simplest way to use the class is by calling its methods within a subclass, such as the following excerpt shows.
public class BooleanVariableDisplayBeanInfo extends
                            VariableDisplayBeanInfo {

private final static Class beanClass =
                        BooleanVariableDisplay.class;

/**
 * BooleanVariableDisplayBeanInfo constructor.
 */
public BooleanVariableDisplayBeanInfo() {
    super();
}
//...
public MethodDescriptor[] getMethodDescriptors() {
    return super.getMethodDescriptors();
}
//...

Known Uses

This class is not intended to be instanciated directly.  Any invocation on the methods, including the constructor, should be done from a subclass.  This makes sense since any inheriter would also have the same properties, etc. and thus reimplementation isn't necessary.

The methods are only called from the subclasses ArrayVariableDisplayBeanInfo, BooleanVariableDisplayBeanInfo, and SimpleVariableDisplayBeanInfo.



Contact the UniVista Team | Main Page | Table of Contents