1 32 33 package com.nqadmin.swingSet.datasources; 34 35 import java.beans.*; 36 import java.beans.IntrospectionException ; 37 38 48 public class SSConnectionBeanInfo extends SimpleBeanInfo { 49 50 57 public java.awt.Image getIcon(int _iconKind) { 58 59 if (_iconKind == BeanInfo.ICON_MONO_16x16 || 60 _iconKind == BeanInfo.ICON_COLOR_16x16 ) 61 { 62 java.awt.Image img = loadImage("/images/icons/ssconnection.gif"); 63 return img; 64 } 65 if (_iconKind == BeanInfo.ICON_MONO_32x32 || 66 _iconKind == BeanInfo.ICON_COLOR_32x32 ) 67 { 68 java.awt.Image img = loadImage("/images/icons/ssconnection32.gif"); 69 return img; 70 } 71 72 return null; 73 74 } 76 public PropertyDescriptor[] getPropertyDescriptors(){ 77 try{ 78 79 PropertyDescriptor urlDescriptor = new PropertyDescriptor("url", SSConnection.class, "getUrl", "setUrl"); 80 urlDescriptor.setBound(true); 81 PropertyDescriptor usernameDescriptor = new PropertyDescriptor("username", SSConnection.class, "getUsername", "setUsername"); 82 usernameDescriptor.setBound(true); 83 PropertyDescriptor passwordDescriptor = new PropertyDescriptor("password", SSConnection.class, "getPassword", "setPassword"); 84 passwordDescriptor.setBound(true); 85 PropertyDescriptor driverNameDescriptor = new PropertyDescriptor("driverName", SSConnection.class, "getDriverName", "setDriverName"); 86 driverNameDescriptor.setBound(true); 87 88 PropertyDescriptor[] propertyDescriptors = new PropertyDescriptor[]{urlDescriptor, usernameDescriptor, passwordDescriptor, driverNameDescriptor}; 89 return propertyDescriptors; 90 }catch(IntrospectionException ie){ 91 ie.printStackTrace(); 92 } 93 return null; 94 } 95 96 } 97 98 113 | Popular Tags |