home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 3.4 KB | 123 lines |
- /*
- * @(#MediatorDSBeanInfo.java
- *
- * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
- *
- */
-
- package symantec.itools.db.beans.binding;
-
- import java.beans.*;
- import symantec.itools.beans.*;
-
-
- /**
- * BeanInfo for MediatorDS
- *
- */
-
- public class MediatorDSBeanInfo 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 output = new PropertyDescriptor("output", beanClass);
- output.setBound(false);
- output.setConstrained(false);
- output.setDisplayName("Output");
- output.setPropertyEditorClass(OutputEditor.class);
-
- PropertyDescriptor setMethods = new PropertyDescriptor("setMethods", beanClass);
- setMethods.setBound(false);
- setMethods.setConstrained(false);
- setMethods.setDisplayName("Setter Method");
- setMethods.setHidden(true);
-
- PropertyDescriptor getMethods = new PropertyDescriptor("getMethods", beanClass);
- getMethods.setBound(false);
- getMethods.setConstrained(false);
- getMethods.setDisplayName("Getter Method");
- getMethods.setHidden(true);
-
- /* PropertyDescriptor booleanTrueValue = new PropertyDescriptor("booleanTrueValue", beanClass);
- booleanTrueValue.setBound(true);
- booleanTrueValue.setConstrained(true);
- booleanTrueValue.setDisplayName("Boolean True Value ");
- booleanTrueValue.setHidden(true);
-
- PropertyDescriptor booleanFalseValue = new PropertyDescriptor("booleanFalseValue", beanClass);
- booleanFalseValue.setBound(true);
- booleanFalseValue.setConstrained(true);
- booleanFalseValue.setDisplayName("Boolean False Value ");
- booleanFalseValue.setHidden(true);*/
-
- PropertyDescriptor dataBinding = new PropertyDescriptor("dataBinding", beanClass);
- dataBinding.setBound(false);
- dataBinding.setConstrained(false);
- dataBinding.setDisplayName("Data Binding");
- dataBinding.setPropertyEditorClass(NameEditor.class);
- dataBinding.setHidden(true);
-
- PropertyDescriptor[] rv = {
- output,
- dataBinding,
- setMethods,
- getMethods,
- // booleanFalseValue,
- // booleanTrueValue
- };
-
- 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 = MediatorDS.class;
-
- } // end of class MediatorDSBeanInfo