/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class BeanInfoUtils
{
/* The values of these createPropertyDescriptor() and
* createBeanDescriptor() keywords are the names of the
* properties they're used to set.
*/
{
}
}
}
}
}
/* Otherwise assume that we have an arbitrary FeatureDescriptor
* "attribute".
*/
else {
}
}
/**
* arguments. The following sample call shows all of the supported
* keywords:
*<pre>
* createPropertyDescriptor("contentPane", new Object[] {
* BOUND, Boolean.TRUE,
* CONSTRAINED, Boolean.TRUE,
* PROPERTYEDITORCLASS, package.MyEditor.class,
* READMETHOD, "getContentPane",
* WRITEMETHOD, "setContentPane",
* DISPLAYNAME, "contentPane",
* EXPERT, Boolean.FALSE,
* HIDDEN, Boolean.FALSE,
* PREFERRED, Boolean.TRUE,
* SHORTDESCRIPTION, "A top level window with a window manager border",
* "random attribute","random object value"
* }
* );
* </pre>
* The keywords correspond to <code>java.beans.PropertyDescriptor</code> and
* <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
* for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
* Using createPropertyDescriptor instead of the PropertyDescriptor
* constructor and set methods is preferrable in that it regularizes
* the code in a <code>java.beans.BeanInfo.getPropertyDescriptors()</code>
* method implementation. One can use <code>createPropertyDescriptor</code>
* to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
* "random object value".
* <p>
* All properties should provide a reasonable value for the
* <code>SHORTDESCRIPTION</code> keyword and should set <code>BOUND</code>
* to <code>Boolean.TRUE</code> if neccessary. The remaining keywords
* are optional. There's no need to provide values for keywords like
* READMETHOD if the correct value can be computed, i.e. if the properties
* <p>
* The PREFERRED keyword is not supported by the JDK1.1 java.beans package.
* It's still worth setting it to true for properties that are most
* likely to be interested to the average developer, e.g. AbstractButton.title
* is a preferred property, AbstractButton.focusPainted is not.
*
* @see java.beans#BeanInfo
* @see java.beans#PropertyDescriptor
* @see java.beans#FeatureDescriptor
*/
{
try {
} catch (IntrospectionException e) {
// Try creating a read-only property, in case setter isn't defined.
try {
} catch (IntrospectionException ie) {
}
}
}
}
}
try {
}
catch(Exception e) {
}
}
try {
}
catch(Exception e) {
}
}
else {
}
}
return pd;
}
/**
* arguments. The following sample call shows all of the supported
* keywords:
*<pre>
* createBeanDescriptor(JWindow..class, new Object[] {
* CUSTOMIZERCLASS, package.MyCustomizer.class,
* DISPLAYNAME, "JFrame",
* EXPERT, Boolean.FALSE,
* HIDDEN, Boolean.FALSE,
* PREFERRED, Boolean.TRUE,
* SHORTDESCRIPTION, "A top level window with a window manager border",
* "random attribute","random object value"
* }
* );
* </pre>
* The keywords correspond to <code>java.beans.BeanDescriptor</code> and
* <code>java.beans.FeatureDescriptor</code> properties, e.g. providing a value
* for displayName is comparable to <code>FeatureDescriptor.setDisplayName()</code>.
* Using createBeanDescriptor instead of the BeanDescriptor
* constructor and set methods is preferrable in that it regularizes
* the code in a <code>java.beans.BeanInfo.getBeanDescriptor()</code>
* method implementation. One can use <code>createBeanDescriptor</code>
* to set <code>FeatureDescriptor</code> attributes, as in "random attribute"
* "random object value".
*
* @see java.beans#BeanInfo
* @see java.beans#PropertyDescriptor
*/
{
/* For reasons I don't understand, customizerClass is a
* readOnly property. So we have to find it and pass it
* to the constructor here.
*/
break;
}
}
}
return bd;
}
// Is it a boolean?
try {
if (readMethod == null) {
try {
// Try normal accessor pattern.
}
if (readMethod != null) {
}
try {
// Try indexed accessor pattern.
parameters[0] = int.class;
} catch (NoSuchMethodException nsme) {
throw new IntrospectionException(
}
}
// Modified methods from java.beans.Introspector
if (s.length() == 0) {
return s;
}
char chars[] = s.toCharArray();
}
/**
* Fatal errors are handled by calling this method.
*/
}
}