home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 3.1 KB | 118 lines |
- /*
- * @(#ConnectionManagerBeanInfo.java
- *
- * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
- *
- */
-
- package symantec.itools.db.beans.jdbc;
-
- import java.beans.*;
- import symantec.itools.beans.SymantecBeanDescriptor;
-
-
- /**
- * BeanInfo for ConnectionManager
- *
- */
-
- public class ConnectionManagerBeanInfo 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.setToolbar("JDBC");
- bd.setValue("VPO_Object", new Boolean(true));
- bd.setRootTemplate(getTemplate());
- bd.setWinHelp("0x123D0");
-
- return (BeanDescriptor) bd;
- }
-
-
- public static String getTemplate()
- {
- String template = "";
- // System.out.println("getTemplate() nono pppp \n");
- String EOL = "\n";
- String TAB="\t";
-
- template += EOL + "import symantec.itools.db.beans.jdbc.*;";
- template += EOL + "import java.sql.*;";
- template += EOL;
- template += EOL + "public class ConnectionManager1 extends ConnectionManager";
- template += EOL + "{";
- template += EOL;
- template += EOL + " public ConnectionManager1()";
- template += EOL + " {";
- template += EOL + " super();";
- template += EOL + " init();";
- template += EOL + " }";
- template += EOL;
- template += EOL + " public void init()";
- template += EOL + " {";
- template += EOL + " //{{INIT_CONTROLS";
- template += EOL + " //}}";
- template += EOL + " }";
- template += EOL;
- template += EOL + "//{{DECLARE_CONTROLS";
- template += EOL + "//}}";
- template += EOL;
- template += EOL + "}";
- template += EOL;
- template += EOL;
-
- return template;
- }
-
- public java.awt.Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_MONO_16x16 ||
- iconKind == BeanInfo.ICON_COLOR_16x16) {
- java.awt.Image img = loadImage("ConnectionManagerIconColor16.gif");
- return img;
- }
-
- if (iconKind == BeanInfo.ICON_MONO_32x32 ||
- iconKind == BeanInfo.ICON_COLOR_32x32) {
- java.awt.Image img = loadImage("ConnectionManagerIconColor32.gif");
- return img;
- }
-
- return null;
- }
-
- public MethodDescriptor[] getMethodDescriptors() {
- return null;
- }
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- return new PropertyDescriptor[0];
- }
-
- public int getDefaultPropertyIndex() {
- return 0; // the index for our default property is always 0
- }
-
- private final static Class beanClass = ConnectionManager.class;
-
- } // end of class ConnectionManagerBeanInfo