1 package org.compiere.db; 2 3 import java.beans.*; 4 5 8 9 public class CConnectionBeanInfo extends SimpleBeanInfo 10 { 11 private Class beanClass = CConnection.class; 12 private String iconColor16x16Filename; 13 private String iconColor32x32Filename; 14 private String iconMono16x16Filename; 15 private String iconMono32x32Filename; 16 17 public CConnectionBeanInfo() 18 { 19 } 20 public PropertyDescriptor[] getPropertyDescriptors() 21 { 22 try 23 { 24 PropertyDescriptor _apps_host = new PropertyDescriptor("apps_host", beanClass, "getApps_host", "setApps_host"); 25 PropertyDescriptor _apps_port = new PropertyDescriptor("apps_port", beanClass, "getApps_port", "setApps_port"); 26 PropertyDescriptor _appsServer = new PropertyDescriptor("appsServer", beanClass, "getAppsServer", null); 27 PropertyDescriptor _appsServerException = new PropertyDescriptor("appsServerException", beanClass, "getAppsServerException", null); 28 PropertyDescriptor _appsServerOK = new PropertyDescriptor("appsServerOK", beanClass, "isAppsServerOK", null); 29 PropertyDescriptor _attributes = new PropertyDescriptor("attributes", beanClass, null, "setAttributes"); 30 PropertyDescriptor _bequeath = new PropertyDescriptor("bequeath", beanClass, "isBequeath", "setBequeath"); 31 PropertyDescriptor _connectionString = new PropertyDescriptor("connectionString", beanClass, "getConnectionString", null); 32 PropertyDescriptor _database = new PropertyDescriptor("database", beanClass, "getDatabase", null); 33 PropertyDescriptor _databaseException = new PropertyDescriptor("databaseException", beanClass, "getDatabaseException", null); 34 PropertyDescriptor _databaseOK = new PropertyDescriptor("databaseOK", beanClass, "isDatabaseOK", null); 35 PropertyDescriptor _db_host = new PropertyDescriptor("db_host", beanClass, "getDb_host", "setDb_host"); 36 PropertyDescriptor _db_name = new PropertyDescriptor("db_name", beanClass, "getDb_name", "setDb_name"); 37 PropertyDescriptor _db_port = new PropertyDescriptor("db_port", beanClass, "getDb_port", "setDb_port"); 38 PropertyDescriptor _db_pwd = new PropertyDescriptor("db_pwd", beanClass, "getDb_pwd", "setDb_pwd"); 39 PropertyDescriptor _db_uid = new PropertyDescriptor("db_uid", beanClass, "getDb_uid", "setDb_uid"); 40 PropertyDescriptor _fw_host = new PropertyDescriptor("fw_host", beanClass, "getFw_host", "setFw_host"); 41 PropertyDescriptor _fw_port = new PropertyDescriptor("fw_port", beanClass, "getFw_port", "setFw_port"); 42 PropertyDescriptor _name = new PropertyDescriptor("name", beanClass, "getName", "setName"); 43 PropertyDescriptor _rmiUri = new PropertyDescriptor("rmiUri", beanClass, "getRmiUri", null); 44 PropertyDescriptor _type = new PropertyDescriptor("type", beanClass, "getType", "setType"); 45 PropertyDescriptor _viaFirewall = new PropertyDescriptor("viaFirewall", beanClass, "isViaFirewall", "setViaFirewall"); 46 PropertyDescriptor[] pds = new PropertyDescriptor[] { 47 _apps_host, 48 _apps_port, 49 _appsServer, 50 _appsServerException, 51 _appsServerOK, 52 _attributes, 53 _bequeath, 54 _connectionString, 55 _database, 56 _databaseException, 57 _databaseOK, 58 _db_host, 59 _db_name, 60 _db_port, 61 _db_pwd, 62 _db_uid, 63 _fw_host, 64 _fw_port, 65 _name, 66 _rmiUri, 67 _type, 68 _viaFirewall}; 69 return pds; 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 } 93 catch(IntrospectionException ex) 94 { 95 ex.printStackTrace(); 96 return null; 97 } 98 } 99 public java.awt.Image getIcon(int iconKind) 100 { 101 switch (iconKind) { 102 case BeanInfo.ICON_COLOR_16x16: 103 return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null; 104 case BeanInfo.ICON_COLOR_32x32: 105 return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null; 106 case BeanInfo.ICON_MONO_16x16: 107 return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null; 108 case BeanInfo.ICON_MONO_32x32: 109 return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null; 110 } 111 return null; 112 } 113 } | Popular Tags |