home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1999 February / CDW0299.iso / Demos / Cafe / Source.bin / LabelHTMLLinkBeanInfo.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.7 KB  |  91 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.beans.*;
  4. import symantec.itools.beans.*;
  5. import java.util.ResourceBundle;
  6.  
  7. //  09/13/97    LAB    Removed extranious getPropertyDescriptors method and
  8. //                    removed getMethodDescriptors method.
  9. //  11/17/97    CAR Added getMethodDescriptors in order to "hide" methods from introspection.
  10.  
  11.  
  12. /**
  13.  * BeanInfo for LabelHTMLLink.
  14.  *
  15.  */
  16. public class LabelHTMLLinkBeanInfo extends SimpleBeanInfo {
  17.  
  18.     /**
  19.      * Constructs a LabelHTMLLinkBeanInfo object.
  20.      */
  21.     public LabelHTMLLinkBeanInfo() {
  22.     }
  23.  
  24.     /**
  25.      * Gets a BeanInfo for the superclass of this bean.
  26.      * @return BeanInfo[] containing this bean's superclass BeanInfo
  27.      */
  28.     public BeanInfo[] getAdditionalBeanInfo() {
  29.         try {
  30.             BeanInfo[] bi = new BeanInfo[1];
  31.             bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
  32.             return bi;
  33.         }
  34.         catch (IntrospectionException e) { throw new Error(e.toString());}
  35.     }
  36.  
  37.     /**
  38.      * Gets the SymantecBeanDescriptor for this bean.
  39.      * @return an object of type SymantecBeanDescriptor
  40.      * @see symantec.itools.beans.SymantecBeanDescriptor
  41.      */
  42.     public BeanDescriptor getBeanDescriptor() {
  43.         ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
  44.         String s=group.getString("GroupAdditional");
  45.  
  46.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  47.         bd.setFolder(s);
  48.         bd.setWinHelp("0x123A5");
  49.  
  50.         bd.addAdditionalConnections(getAdditionalBeanInfo());
  51.  
  52.         return (BeanDescriptor) bd;
  53.     }
  54.  
  55.     /**
  56.      * Gets an image that may be used to visually represent this bean
  57.      * (in the toolbar, on a form, etc).
  58.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  59.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  60.      * @return an image for this bean, always color even if requested monochrome
  61.      * @see BeanInfo#ICON_MONO_16x16
  62.      * @see BeanInfo#ICON_COLOR_16x16
  63.      * @see BeanInfo#ICON_MONO_32x32
  64.      * @see BeanInfo#ICON_COLOR_32x32
  65.      */
  66.     public java.awt.Image getIcon(int iconKind) {
  67.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  68.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  69.             java.awt.Image img = loadImage("LabelHTMLLinkC16.gif");
  70.             return img;
  71.         }
  72.  
  73.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  74.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  75.             java.awt.Image img = loadImage("LabelHTMLLinkC32.gif");
  76.             return img;
  77.         }
  78.  
  79.         return null;
  80.     }
  81.  
  82.     public MethodDescriptor[] getMethodDescriptors() {
  83.         return new MethodDescriptor[0];
  84.     }
  85.  
  86.     public PropertyDescriptor[] getPropertyDescriptors() {
  87.         return new PropertyDescriptor[0];
  88.     }
  89.     private final static Class beanClass = LabelHTMLLink.class;
  90.  
  91.     }    //  end of class LabelHTMLLinkBeanInfo