KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nqadmin > swingSet > datasources > SSJdbcRowSetImplBeanInfo


1 /* $Id: SSJdbcRowSetImplBeanInfo.java,v 1.5 2005/02/09 06:41:22 prasanth Exp $
2  *
3  * Tab Spacing = 4
4  *
5  * Copyright (c) 2005, The Pangburn Company and Prasanth R. Pasala.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer. Redistributions in binary
13  * form must reproduce the above copyright notice, this list of conditions and
14  * the following disclaimer in the documentation and/or other materials
15  * provided with the distribution. The names of its contributors may not be
16  * used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */

32  
33 package com.nqadmin.swingSet.datasources;
34
35 import java.beans.*;
36 import java.beans.PropertyDescriptor JavaDoc;
37 import java.beans.IntrospectionException JavaDoc;
38
39 /**
40  * SSJdbcRowSetImplBeanInfo.java
41  *<p>
42  * SwingSet - Open Toolkit For Making Swing Controls Database-Aware
43  *<p><pre>
44  * Contains & controls various bean properties for SSJdbcRowSetImpl.
45  *</pre><p>
46  * @author $Author: prasanth $
47  * @version $Revision: 1.5 $
48  */

49  public class SSJdbcRowSetImplBeanInfo extends SimpleBeanInfo {
50
51     /**
52      * Provides the icon representation for the related bean.
53      *
54      * @param _iconKind The kind of icon requested. This should be one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, or ICON_MONO_32x32.
55      *
56      * @return An image object representing the requested icon. May return null if no suitable icon is available.
57      */

58     public java.awt.Image JavaDoc getIcon(int _iconKind) {
59         
60         if (_iconKind == BeanInfo.ICON_MONO_16x16 ||
61             _iconKind == BeanInfo.ICON_COLOR_16x16 )
62         {
63             java.awt.Image JavaDoc img = loadImage("/images/icons/ssrowset.gif");
64             return img;
65         }
66         if (_iconKind == BeanInfo.ICON_MONO_32x32 ||
67             _iconKind == BeanInfo.ICON_COLOR_32x32 )
68         {
69             java.awt.Image JavaDoc img = loadImage("/images/icons/ssrowset32.gif");
70             return img;
71         }
72         
73         return null;
74         
75     } // end public java.awt.Image getIcon(int _iconKind) {
76

77     
78     public PropertyDescriptor JavaDoc[] getPropertyDescriptors(){
79         try{
80             PropertyDescriptor JavaDoc connDescriptor = new PropertyDescriptor JavaDoc("sSConnection", SSJdbcRowSetImpl.class, "getSSConnection", "setSSConnection");
81             connDescriptor.setBound(true);
82             connDescriptor.setPropertyEditorClass(SSConnectionEditor.class);
83             PropertyDescriptor JavaDoc queryDescriptor = new PropertyDescriptor JavaDoc("query", SSJdbcRowSetImpl.class, "getCommand", "setCommand");
84             queryDescriptor.setBound(true);
85             return new PropertyDescriptor JavaDoc[]{connDescriptor, queryDescriptor};
86         }catch(IntrospectionException JavaDoc ie){
87             ie.printStackTrace();
88         }
89         return null;
90     }
91
92 }
93
94 /*
95  * $Log: SSJdbcRowSetImplBeanInfo.java,v $
96  * Revision 1.5 2005/02/09 06:41:22 prasanth
97  * added getPropertyDescriptors method.
98  *
99  * Revision 1.4 2005/02/07 19:56:17 yoda2
100  * Fixing JavaDoc errors with _iconKind parameter name.
101  *
102  * Revision 1.3 2005/02/04 22:41:35 yoda2
103  * Updated Copyright info.
104  *
105  * Revision 1.2 2005/02/02 23:19:04 yoda2
106  * Fixed log tag.
107  *
108  */

109
Popular Tags