Source Code Cross Referenced for SimpleBeanInfo.java in  » 6.0-JDK-Core » beans » java » beans » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » beans » java.beans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1996-1998 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.beans;
027
028        /**
029         * This is a support class to make it easier for people to provide
030         * BeanInfo classes.
031         * <p>
032         * It defaults to providing "noop" information, and can be selectively
033         * overriden to provide more explicit information on chosen topics.
034         * When the introspector sees the "noop" values, it will apply low
035         * level introspection and design patterns to automatically analyze
036         * the target bean.
037         */
038
039        public class SimpleBeanInfo implements  BeanInfo {
040
041            /**
042             * Deny knowledge about the class and customizer of the bean.
043             * You can override this if you wish to provide explicit info.
044             */
045            public BeanDescriptor getBeanDescriptor() {
046                return null;
047            }
048
049            /**
050             * Deny knowledge of properties. You can override this
051             * if you wish to provide explicit property info.
052             */
053            public PropertyDescriptor[] getPropertyDescriptors() {
054                return null;
055            }
056
057            /**
058             * Deny knowledge of a default property. You can override this
059             * if you wish to define a default property for the bean.
060             */
061            public int getDefaultPropertyIndex() {
062                return -1;
063            }
064
065            /**
066             * Deny knowledge of event sets. You can override this
067             * if you wish to provide explicit event set info.
068             */
069            public EventSetDescriptor[] getEventSetDescriptors() {
070                return null;
071            }
072
073            /**
074             * Deny knowledge of a default event. You can override this
075             * if you wish to define a default event for the bean.
076             */
077            public int getDefaultEventIndex() {
078                return -1;
079            }
080
081            /**
082             * Deny knowledge of methods. You can override this
083             * if you wish to provide explicit method info.
084             */
085            public MethodDescriptor[] getMethodDescriptors() {
086                return null;
087            }
088
089            /**
090             * Claim there are no other relevant BeanInfo objects.  You
091             * may override this if you want to (for example) return a
092             * BeanInfo for a base class.
093             */
094            public BeanInfo[] getAdditionalBeanInfo() {
095                return null;
096            }
097
098            /**
099             * Claim there are no icons available.  You can override
100             * this if you want to provide icons for your bean.
101             */
102            public java.awt.Image getIcon(int iconKind) {
103                return null;
104            }
105
106            /**
107             * This is a utility method to help in loading icon images.
108             * It takes the name of a resource file associated with the
109             * current object's class file and loads an image object
110             * from that file.  Typically images will be GIFs.
111             * <p>
112             * @param resourceName  A pathname relative to the directory
113             *		holding the class file of the current class.  For example,
114             *		"wombat.gif".
115             * @return  an image object.  May be null if the load failed.
116             */
117            public java.awt.Image loadImage(final String resourceName) {
118                try {
119                    final Class c = getClass();
120                    java.awt.image.ImageProducer ip = (java.awt.image.ImageProducer) java.security.AccessController
121                            .doPrivileged(new java.security.PrivilegedAction() {
122                                public Object run() {
123                                    java.net.URL url;
124                                    if ((url = c.getResource(resourceName)) == null) {
125                                        return null;
126                                    } else {
127                                        try {
128                                            return url.getContent();
129                                        } catch (java.io.IOException ioe) {
130                                            return null;
131                                        }
132                                    }
133                                }
134                            });
135
136                    if (ip == null)
137                        return null;
138                    java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
139                    return tk.createImage(ip);
140                } catch (Exception ex) {
141                    return null;
142                }
143            }
144
145        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.