OSDN Git Service

Jumbo patch:
[pf3gnuchains/gcc-fork.git] / libjava / java / beans / SimpleBeanInfo.java
1 /* java.beans.SimpleBeanInfo
2    Copyright (C) 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.beans;
29
30 import java.awt.*;
31
32 /**
33  ** SimpleBeanInfo is a class you may extend to more easily
34  ** provide select information to the Introspector.  It
35  ** implements all of the methods in BeanInfo by returning
36  ** null and forces the Introspector to behave exactly as
37  ** if there were no BeanInfo class at all (Introspecting
38  ** everything).<P>
39  **
40  ** Overriding one or two of these functions
41  ** to give explicit information on only those things you
42  ** wish to give explicit information is perfectly safe,
43  ** and even desirable.<P>
44  **
45  ** See the BeanInfo class for information on what the
46  ** various methods actually do.
47  **
48  ** @author John Keiser
49  ** @since JDK1.1
50  ** @version 1.1.0, 29 Jul 1998
51  ** @see java.beans.BeanInfo
52  **/
53
54 public class SimpleBeanInfo implements BeanInfo {
55         /** Force Introspection of the general bean info.
56          ** @return <CODE>null</CODE>.
57          **/
58         public BeanDescriptor getBeanDescriptor() {
59                 return null;
60         }
61
62         /** Force Introspection of the events this Bean type
63          ** fires.
64          ** @return <CODE>null</CODE>
65          **/
66         public EventSetDescriptor[] getEventSetDescriptors() {
67                 return null;
68         }
69
70         /** Say that there is no "default" event set.
71          ** @return <CODE>-1</CODE>.
72          **/
73         public int getDefaultEventIndex() {
74                 return -1;
75         }
76
77         /** Force Introspection of the Bean properties.
78          ** @return <CODE>null</CODE>.
79          **/
80         public PropertyDescriptor[] getPropertyDescriptors() {
81                 return null;
82         }
83
84         /** Say that there is no "default" property.
85          ** @return <CODE>-1</CODE>.
86          **/
87         public int getDefaultPropertyIndex() {
88                 return -1;
89         }
90
91         /** Force Introspection of the Bean's methods.
92          ** @return <CODE>null</CODE>.
93          **/
94         public MethodDescriptor[] getMethodDescriptors() {
95                 return null;
96         }
97
98         /** Tell the Introspector to go look for other BeanInfo
99          ** itself.
100          ** @return <CODE>null</CODE>.
101          **/
102         public BeanInfo[] getAdditionalBeanInfo() {
103                 return null;
104         }
105
106         /** Say that this Bean has no icons.
107          ** @param iconType the type of icon
108          ** @return <CODE>null</CODE>.
109          **/
110         public Image getIcon(int iconType) {
111                 return null;
112         }
113
114         /** Helper method to load an image using the Bean class
115          ** getResource() method on the BeanInfo class (using
116          ** getClass(), since you'll extend this class to get
117          ** the BeanInfo).  Basically it's assumed that the Bean
118          ** and its BeanInfo are both loaded by the same
119          ** ClassLoader, generally a reasonable assumption.
120          ** @param location the URL relative
121          ** @return the Image in question.
122          **/
123         public Image loadImage(String location) {
124                 return Toolkit.getDefaultToolkit().getImage(getClass().getResource(location));
125         }
126 }
127