home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
PostalCodeBeanInfo.java
< prev
next >
Wrap
Text File
|
1998-08-21
|
3KB
|
102 lines
package symantec.itools.awt.util.edit;
import java.beans.*;
import symantec.itools.beans.*;
import java.util.ResourceBundle;
// 09/07/97 LAB Fixed misspelling of descriptions.
// 09/13/97 LAB Removed extranious getMethodDescriptors method.
/**
* BeanInfo for PostalCode.
*
*/
public class PostalCodeBeanInfo extends SimpleBeanInfo {
/**
* Constructs a PostalCodeBeanInfo object.
*/
public PostalCodeBeanInfo() {
}
/**
* Gets a BeanInfo for the superclass of this bean.
* @return BeanInfo[] containing this bean's superclass BeanInfo
*/
public BeanInfo[] getAdditionalBeanInfo() {
try {
BeanInfo[] bi = new BeanInfo[1];
bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
return bi;
}
catch (IntrospectionException e) { throw new Error(e.toString());}
}
/**
* Gets the SymantecBeanDescriptor for this bean.
* @return an object of type SymantecBeanDescriptor
* @see symantec.itools.beans.SymantecBeanDescriptor
*/
public BeanDescriptor getBeanDescriptor() {
ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
String s=group.getString("GroupPreDefinedTF");
SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
bd.setFolder(s);
bd.setWinHelp("0x123C5");
return (BeanDescriptor) bd;
}
/**
* Gets an image that may be used to visually represent this bean
* (in the toolbar, on a form, etc).
* @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
* BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
* @return an image for this bean, always color even if requested monochrome
* @see BeanInfo#ICON_MONO_16x16
* @see BeanInfo#ICON_COLOR_16x16
* @see BeanInfo#ICON_MONO_32x32
* @see BeanInfo#ICON_COLOR_32x32
*/
public java.awt.Image getIcon(int iconKind) {
if (iconKind == BeanInfo.ICON_MONO_16x16 ||
iconKind == BeanInfo.ICON_COLOR_16x16) {
java.awt.Image img = loadImage("PostalCodeC16.gif");
return img;
}
if (iconKind == BeanInfo.ICON_MONO_32x32 ||
iconKind == BeanInfo.ICON_COLOR_32x32) {
java.awt.Image img = loadImage("PostalCodeC32.gif");
return img;
}
return null;
}
public MethodDescriptor[] getMethodDescriptors() { return new MethodDescriptor[0]; }
/**
* Returns descriptions of this bean's properties.
*/
public PropertyDescriptor[] getPropertyDescriptors() {
ResourceBundle prop = ResourceBundle.getBundle("symantec.itools.resources.PropBundle");
try{
PropertyDescriptor mask = new PropertyDescriptor("mask", beanClass);
mask.setHidden(true);
PropertyDescriptor roMask = new PropertyDescriptor("roMask", beanClass, "getMask", null);
roMask.setDisplayName(prop.getString("roMask"));
PropertyDescriptor[] rv = {
mask,
roMask};
return rv;
} catch (IntrospectionException e) { throw new Error(e.toString()); }
}
private final static Class beanClass = PostalCode.class;
} // end of class PostalCodeBeanInfo