home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / MediatorDSBeanInfo.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  3.4 KB  |  123 lines

  1. /*
  2.  * @(#MediatorDSBeanInfo.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. package symantec.itools.db.beans.binding;
  9.  
  10. import java.beans.*;
  11. import symantec.itools.beans.*;
  12.  
  13.  
  14. /**
  15.  * BeanInfo for MediatorDS
  16.  *
  17.  */
  18.  
  19. public class MediatorDSBeanInfo extends SimpleBeanInfo {
  20.  
  21.     public BeanInfo[] getAdditionalBeanInfo() {
  22.         try {
  23.             java.util.Vector v = new java.util.Vector();
  24.             BeanInfo[] rv;
  25.             BeanInfo b;
  26.             Class c = beanClass.getSuperclass();
  27.  
  28.             while (c.isAssignableFrom(Object.class) != true) {
  29.                 b = Introspector.getBeanInfo(c);
  30.                 v.addElement(b);
  31.                 c = c.getSuperclass();
  32.             }
  33.             rv = new BeanInfo[v.size()];
  34.             v.copyInto(rv);
  35.  
  36.             return rv;
  37.         }
  38.         catch (IntrospectionException e) { throw new Error(e.toString());}
  39.     }
  40.  
  41.     public BeanDescriptor getBeanDescriptor() {
  42.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  43.         bd.setFolder("JDBC");
  44.         bd.setWinHelp("0x123CE");
  45.  
  46.         return (BeanDescriptor) bd;
  47.     }
  48.  
  49.     public java.awt.Image getIcon(int iconKind) {
  50.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  51.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  52.             java.awt.Image img = loadImage("MediatorDSIconColor16.gif");
  53.             return img;
  54.         }
  55.  
  56.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  57.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  58.             java.awt.Image img = loadImage("MediatorDSIconColor32.gif");
  59.             return img;
  60.         }
  61.  
  62.         return null;
  63.     }
  64.  
  65.     public PropertyDescriptor[] getPropertyDescriptors() {
  66.         try{
  67.         PropertyDescriptor output = new PropertyDescriptor("output", beanClass);
  68.         output.setBound(false);
  69.         output.setConstrained(false);
  70.         output.setDisplayName("Output");
  71.         output.setPropertyEditorClass(OutputEditor.class);
  72.  
  73.         PropertyDescriptor setMethods = new PropertyDescriptor("setMethods", beanClass);
  74.         setMethods.setBound(false);
  75.         setMethods.setConstrained(false);
  76.         setMethods.setDisplayName("Setter Method");
  77.         setMethods.setHidden(true);
  78.  
  79.         PropertyDescriptor getMethods = new PropertyDescriptor("getMethods", beanClass);
  80.         getMethods.setBound(false);
  81.         getMethods.setConstrained(false);
  82.         getMethods.setDisplayName("Getter Method");
  83.         getMethods.setHidden(true);
  84.  
  85.        /* PropertyDescriptor booleanTrueValue = new PropertyDescriptor("booleanTrueValue", beanClass);
  86.         booleanTrueValue.setBound(true);
  87.         booleanTrueValue.setConstrained(true);
  88.         booleanTrueValue.setDisplayName("Boolean True Value ");
  89.         booleanTrueValue.setHidden(true);
  90.  
  91.         PropertyDescriptor booleanFalseValue = new PropertyDescriptor("booleanFalseValue", beanClass);
  92.         booleanFalseValue.setBound(true);
  93.         booleanFalseValue.setConstrained(true);
  94.         booleanFalseValue.setDisplayName("Boolean False Value ");
  95.         booleanFalseValue.setHidden(true);*/
  96.  
  97.         PropertyDescriptor dataBinding = new PropertyDescriptor("dataBinding", beanClass);
  98.         dataBinding.setBound(false);
  99.         dataBinding.setConstrained(false);
  100.         dataBinding.setDisplayName("Data Binding");
  101.         dataBinding.setPropertyEditorClass(NameEditor.class);
  102.         dataBinding.setHidden(true);
  103.  
  104.         PropertyDescriptor[] rv = {
  105.             output,
  106.             dataBinding,
  107.             setMethods,
  108.             getMethods,
  109.          //   booleanFalseValue,
  110.          //   booleanTrueValue
  111.             };
  112.  
  113.         return rv;
  114.         } catch (IntrospectionException e) { throw new Error(e.toString()); }
  115.     }
  116.  
  117.     public int getDefaultPropertyIndex() {
  118.         return 0;    //  the index for our default property is always 0
  119.     }
  120.  
  121.     private final static Class beanClass = MediatorDS.class;
  122.  
  123. }    //  end of class MediatorDSBeanInfo