home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.8 KB | 95 lines |
-
- package symantec.itools.db.beans.binding;
-
- import java.beans.*;
- import symantec.itools.beans.*;
-
- public class JFCBinderModelBeanInfo extends SimpleBeanInfo {
-
- public BeanInfo[] getAdditionalBeanInfo() {
- try {
- java.util.Vector v = new java.util.Vector();
- BeanInfo[] rv;
- BeanInfo b;
- Class c = beanClass.getSuperclass();
-
- while (c.isAssignableFrom(Object.class) != true) {
- b = Introspector.getBeanInfo(c);
- v.addElement(b);
- c = c.getSuperclass();
- }
- rv = new BeanInfo[v.size()];
- v.copyInto(rv);
-
- return rv;
- }
- catch (IntrospectionException e) { throw new Error(e.toString());}
- }
-
- public BeanDescriptor getBeanDescriptor() {
- SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
- bd.setFolder("JDBC");
- bd.setWinHelp("0x123CE");
-
- return (BeanDescriptor) bd;
- }
-
- public java.awt.Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_MONO_16x16 ||
- iconKind == BeanInfo.ICON_COLOR_16x16) {
- java.awt.Image img = loadImage("MediatorDSIconColor16.gif");
- return img;
- }
-
- if (iconKind == BeanInfo.ICON_MONO_32x32 ||
- iconKind == BeanInfo.ICON_COLOR_32x32) {
- java.awt.Image img = loadImage("MediatorDSIconColor32.gif");
- return img;
- }
-
- return null;
- }
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- try{
- PropertyDescriptor dataBinding = new PropertyDescriptor("dataBinding", beanClass);
- dataBinding.setBound(false);
- dataBinding.setConstrained(false);
- dataBinding.setDisplayName("Data Binding");
- dataBinding.setPropertyEditorClass(NameEditor.class);
-
- PropertyDescriptor lookupBinding = new PropertyDescriptor("lookupBinding", beanClass);
- lookupBinding.setBound(false);
- lookupBinding.setConstrained(false);
- lookupBinding.setDisplayName("Lookup Binding");
- lookupBinding.setPropertyEditorClass(NameEditorMultiRow.class);
-
- PropertyDescriptor booleanFalseString = new PropertyDescriptor("booleanFalseString", beanClass);
- booleanFalseString.setBound(false);
- booleanFalseString.setConstrained(false);
- booleanFalseString.setDisplayName("Boolean False String");
-
- PropertyDescriptor booleanTrueString = new PropertyDescriptor("booleanTrueString", beanClass);
- booleanTrueString.setBound(false);
- booleanTrueString.setConstrained(false);
- booleanTrueString.setDisplayName("Boolean True String");
-
-
- PropertyDescriptor[] rv = {
- booleanFalseString,
- booleanTrueString,
- dataBinding,
- lookupBinding
- };
-
- return rv;
- } catch (IntrospectionException e) { throw new Error(e.toString()); }
- }
-
- public int getDefaultPropertyIndex() {
- return 0; // the index for our default property is always 0
- }
-
- private final static Class beanClass = JFCBinderModel.class;
-
- } // end of class MediatorDSBeanInfo