KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > SecurityRoleMappingBeanInfo


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.sun.share.configbean;
21
22 import java.beans.*;
23 import org.openide.util.Exceptions;
24
25 public class SecurityRoleMappingBeanInfo extends SimpleBeanInfo {
26     
27     /** Return an appropriate icon (currently, only 16x16 color is available)
28      */

29     public java.awt.Image JavaDoc getIcon(int iconKind) {
30         return loadImage("resources/SecurityRoleMappingIcon16.gif"); // NOI18N
31
}
32     
33         /**
34          * Gets the bean's <code>BeanDescriptor</code>s.
35          *
36          * @return BeanDescriptor describing the editable
37          * properties of this bean. May return null if the
38          * information should be obtained by automatic analysis.
39          */

40         public BeanDescriptor getBeanDescriptor() {
41             BeanDescriptor beanDescriptor = new BeanDescriptor ( SecurityRoleMapping.class , org.netbeans.modules.j2ee.sun.share.configbean.customizers.SecurityRoleMappingCustomizer.class );//GEN-HEADEREND:BeanDescriptor
42
return beanDescriptor;
43         }
44     
45     /**
46      * Gets the bean's <code>PropertyDescriptor</code>s.
47      *
48      * @return An array of PropertyDescriptors describing the editable
49      * properties supported by this bean. May return null if the
50      * information should be obtained by automatic analysis.
51      * <p>
52      * If a property is indexed, then its entry in the result array will
53      * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
54      * A client of getPropertyDescriptors can use "instanceof" to check
55      * if a given PropertyDescriptor is an IndexedPropertyDescriptor.
56      */

57     public PropertyDescriptor[] getPropertyDescriptors() {
58             int PROPERTY_groupName = 0;
59             int PROPERTY_identity = 1;
60             int PROPERTY_principalName = 2;
61             int PROPERTY_roleName = 3;
62             PropertyDescriptor[] properties = new PropertyDescriptor[4];
63
64             try {
65                 properties[PROPERTY_groupName] = new IndexedPropertyDescriptor ( "groupName", SecurityRoleMapping.class, null, null, "getGroupName", null );
66                 properties[PROPERTY_groupName].setBound ( true );
67                 properties[PROPERTY_groupName].setConstrained ( true );
68                 properties[PROPERTY_identity] = new PropertyDescriptor ( "identity", SecurityRoleMapping.class, "getIdentity", null );
69                 properties[PROPERTY_identity].setBound ( true );
70                 properties[PROPERTY_identity].setConstrained ( true );
71                 properties[PROPERTY_principalName] = new IndexedPropertyDescriptor ( "principalName", SecurityRoleMapping.class, null, null, "getPrincipalName", null );
72                 properties[PROPERTY_principalName].setBound ( true );
73                 properties[PROPERTY_principalName].setConstrained ( true );
74                 properties[PROPERTY_roleName] = new PropertyDescriptor ( "roleName", SecurityRoleMapping.class, "getRoleName", null );
75                 properties[PROPERTY_roleName].setBound ( true );
76                 properties[PROPERTY_roleName].setConstrained ( true );
77             }
78             catch( IntrospectionException e) {
79                 Exceptions.printStackTrace(e);
80             }
81             return properties;
82     }
83     
84     /**
85      * Gets the bean's <code>EventSetDescriptor</code>s.
86      *
87      * @return An array of EventSetDescriptors describing the kinds of
88      * events fired by this bean. May return null if the information
89      * should be obtained by automatic analysis.
90      */

91     public EventSetDescriptor[] getEventSetDescriptors() {
92             int EVENT_propertyChangeListener = 0;
93             int EVENT_vetoableChangeListener = 1;
94             EventSetDescriptor[] eventSets = new EventSetDescriptor[2];
95
96                 try {
97                 eventSets[EVENT_propertyChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.SecurityRoleMapping.class, "propertyChangeListener", java.beans.PropertyChangeListener JavaDoc.class, new String JavaDoc[] {"propertyChange"}, "addPropertyChangeListener", "removePropertyChangeListener" );
98                 eventSets[EVENT_vetoableChangeListener] = new EventSetDescriptor ( org.netbeans.modules.j2ee.sun.share.configbean.SecurityRoleMapping.class, "vetoableChangeListener", java.beans.VetoableChangeListener JavaDoc.class, new String JavaDoc[] {"vetoableChange"}, "addVetoableChangeListener", "removeVetoableChangeListener" );
99             }
100             catch( IntrospectionException e) {
101                 Exceptions.printStackTrace(e);
102             }
103             return eventSets;
104     }
105     
106     /**
107      * Gets the bean's <code>MethodDescriptor</code>s.
108      *
109      * @return An array of MethodDescriptors describing the methods
110      * implemented by this bean. May return null if the information
111      * should be obtained by automatic analysis.
112      */

113     public MethodDescriptor[] getMethodDescriptors() {
114             return new MethodDescriptor[0];
115     }
116     
117 }
118
119
Popular Tags