1 |
3318
|
barteau
|
/*
|
2 |
|
|
* ClientViewBeanInfo.java
|
3 |
|
|
*
|
4 |
|
|
* Created on June 25, 2007, 10:24 AM
|
5 |
|
|
*/
|
6 |
|
|
|
7 |
|
|
package edu.ucsb.nceas.metacat.clientview;
|
8 |
|
|
|
9 |
|
|
import java.beans.*;
|
10 |
|
|
|
11 |
|
|
/**
|
12 |
|
|
* @author barteau
|
13 |
|
|
*/
|
14 |
|
|
public class ClientViewBeanInfo extends SimpleBeanInfo {
|
15 |
|
|
|
16 |
|
|
// Bean descriptor//GEN-FIRST:BeanDescriptor
|
17 |
|
|
/*lazy BeanDescriptor*/
|
18 |
|
|
private static BeanDescriptor getBdescriptor(){
|
19 |
|
|
BeanDescriptor beanDescriptor = new BeanDescriptor ( edu.ucsb.nceas.metacat.clientview.ClientView.class , null ); // NOI18N
|
20 |
|
|
beanDescriptor.setDisplayName ( "Client View" );
|
21 |
|
|
beanDescriptor.setShortDescription ( "Client view bean" );//GEN-HEADEREND:BeanDescriptor
|
22 |
|
|
|
23 |
|
|
// Here you can add code for customizing the BeanDescriptor.
|
24 |
|
|
|
25 |
|
|
return beanDescriptor; }//GEN-LAST:BeanDescriptor
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
// Property identifiers//GEN-FIRST:Properties
|
29 |
|
|
private static final int PROPERTY_action = 0;
|
30 |
|
|
private static final int PROPERTY_anyfield = 1;
|
31 |
3371
|
barteau
|
private static final int PROPERTY_contentStandard = 2;
|
32 |
|
|
private static final int PROPERTY_dataFileName = 3;
|
33 |
|
|
private static final int PROPERTY_docId = 4;
|
34 |
|
|
private static final int PROPERTY_message = 5;
|
35 |
3456
|
barteau
|
private static final int PROPERTY_metaFileDocId = 6;
|
36 |
|
|
private static final int PROPERTY_metaFileName = 7;
|
37 |
|
|
private static final int PROPERTY_organization = 8;
|
38 |
|
|
private static final int PROPERTY_password = 9;
|
39 |
|
|
private static final int PROPERTY_pathExpr = 10;
|
40 |
|
|
private static final int PROPERTY_pathValue = 11;
|
41 |
|
|
private static final int PROPERTY_publicAccess = 12;
|
42 |
|
|
private static final int PROPERTY_qformat = 13;
|
43 |
|
|
private static final int PROPERTY_returnfield = 14;
|
44 |
|
|
private static final int PROPERTY_sessionid = 15;
|
45 |
|
|
private static final int PROPERTY_username = 16;
|
46 |
3318
|
barteau
|
|
47 |
|
|
// Property array
|
48 |
|
|
/*lazy PropertyDescriptor*/
|
49 |
|
|
private static PropertyDescriptor[] getPdescriptor(){
|
50 |
3456
|
barteau
|
PropertyDescriptor[] properties = new PropertyDescriptor[17];
|
51 |
3318
|
barteau
|
|
52 |
|
|
try {
|
53 |
|
|
properties[PROPERTY_action] = new PropertyDescriptor ( "action", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getAction", "setAction" ); // NOI18N
|
54 |
|
|
properties[PROPERTY_action].setDisplayName ( "Action" );
|
55 |
|
|
properties[PROPERTY_action].setShortDescription ( "Server action" );
|
56 |
|
|
properties[PROPERTY_anyfield] = new PropertyDescriptor ( "anyfield", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getAnyfield", "setAnyfield" ); // NOI18N
|
57 |
|
|
properties[PROPERTY_anyfield].setDisplayName ( "Any Field" );
|
58 |
|
|
properties[PROPERTY_anyfield].setShortDescription ( "Search any field for data" );
|
59 |
3371
|
barteau
|
properties[PROPERTY_contentStandard] = new PropertyDescriptor ( "contentStandard", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getContentStandard", "setContentStandard" ); // NOI18N
|
60 |
|
|
properties[PROPERTY_contentStandard].setDisplayName ( "Content Standard" );
|
61 |
|
|
properties[PROPERTY_contentStandard].setShortDescription ( "XML metadata content standard" );
|
62 |
3318
|
barteau
|
properties[PROPERTY_dataFileName] = new IndexedPropertyDescriptor ( "dataFileName", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getDataFileName", "setDataFileName", "getDataFileName", "setDataFileName" ); // NOI18N
|
63 |
|
|
properties[PROPERTY_dataFileName].setDisplayName ( "Data File" );
|
64 |
|
|
properties[PROPERTY_dataFileName].setShortDescription ( "Data file name" );
|
65 |
|
|
properties[PROPERTY_docId] = new PropertyDescriptor ( "docId", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getDocId", "setDocId" ); // NOI18N
|
66 |
|
|
properties[PROPERTY_docId].setDisplayName ( "Doc ID" );
|
67 |
|
|
properties[PROPERTY_docId].setShortDescription ( "Metacat Document Identifier" );
|
68 |
|
|
properties[PROPERTY_message] = new IndexedPropertyDescriptor ( "message", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getMessage", "setMessage", "getMessage", "setMessage" ); // NOI18N
|
69 |
|
|
properties[PROPERTY_message].setDisplayName ( "Message" );
|
70 |
|
|
properties[PROPERTY_message].setShortDescription ( "Server messages" );
|
71 |
3456
|
barteau
|
properties[PROPERTY_metaFileDocId] = new PropertyDescriptor ( "metaFileDocId", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getMetaFileDocId", "setMetaFileDocId" ); // NOI18N
|
72 |
|
|
properties[PROPERTY_metaFileDocId].setDisplayName ( "Metadata File Doc Id" );
|
73 |
|
|
properties[PROPERTY_metaFileDocId].setShortDescription ( "Metadata File Document Id" );
|
74 |
3318
|
barteau
|
properties[PROPERTY_metaFileName] = new PropertyDescriptor ( "metaFileName", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getMetaFileName", "setMetaFileName" ); // NOI18N
|
75 |
|
|
properties[PROPERTY_metaFileName].setDisplayName ( "Metadata File" );
|
76 |
|
|
properties[PROPERTY_metaFileName].setShortDescription ( "XML metadata file name" );
|
77 |
|
|
properties[PROPERTY_organization] = new PropertyDescriptor ( "organization", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getOrganization", "setOrganization" ); // NOI18N
|
78 |
|
|
properties[PROPERTY_organization].setDisplayName ( "Organization" );
|
79 |
|
|
properties[PROPERTY_organization].setShortDescription ( "User's organization" );
|
80 |
|
|
properties[PROPERTY_password] = new PropertyDescriptor ( "password", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getPassword", "setPassword" ); // NOI18N
|
81 |
|
|
properties[PROPERTY_password].setDisplayName ( "Password" );
|
82 |
|
|
properties[PROPERTY_password].setShortDescription ( "Metacat user password" );
|
83 |
|
|
properties[PROPERTY_pathExpr] = new PropertyDescriptor ( "pathExpr", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getPathExpr", "setPathExpr" ); // NOI18N
|
84 |
|
|
properties[PROPERTY_pathExpr].setDisplayName ( "Path Expression" );
|
85 |
|
|
properties[PROPERTY_pathExpr].setShortDescription ( "Query path expression" );
|
86 |
|
|
properties[PROPERTY_pathValue] = new PropertyDescriptor ( "pathValue", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getPathValue", "setPathValue" ); // NOI18N
|
87 |
|
|
properties[PROPERTY_pathValue].setDisplayName ( "Path Value" );
|
88 |
|
|
properties[PROPERTY_pathValue].setShortDescription ( "Query path comparison value" );
|
89 |
|
|
properties[PROPERTY_publicAccess] = new PropertyDescriptor ( "publicAccess", edu.ucsb.nceas.metacat.clientview.ClientView.class, "isPublicAccess", "setPublicAccess" ); // NOI18N
|
90 |
|
|
properties[PROPERTY_publicAccess].setDisplayName ( "Public Access" );
|
91 |
|
|
properties[PROPERTY_publicAccess].setShortDescription ( "Grant public read access to data package" );
|
92 |
|
|
properties[PROPERTY_qformat] = new PropertyDescriptor ( "qformat", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getQformat", "setQformat" ); // NOI18N
|
93 |
|
|
properties[PROPERTY_qformat].setDisplayName ( "Format" );
|
94 |
|
|
properties[PROPERTY_qformat].setShortDescription ( "Query format" );
|
95 |
|
|
properties[PROPERTY_returnfield] = new PropertyDescriptor ( "returnfield", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getReturnfield", "setReturnfield" ); // NOI18N
|
96 |
|
|
properties[PROPERTY_returnfield].setDisplayName ( "Return Field" );
|
97 |
|
|
properties[PROPERTY_returnfield].setShortDescription ( "Query Return Field" );
|
98 |
|
|
properties[PROPERTY_sessionid] = new PropertyDescriptor ( "sessionid", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getSessionid", "setSessionid" ); // NOI18N
|
99 |
|
|
properties[PROPERTY_sessionid].setDisplayName ( "Sess ID" );
|
100 |
|
|
properties[PROPERTY_sessionid].setShortDescription ( "Http Session Id" );
|
101 |
|
|
properties[PROPERTY_username] = new PropertyDescriptor ( "username", edu.ucsb.nceas.metacat.clientview.ClientView.class, "getUsername", "setUsername" ); // NOI18N
|
102 |
|
|
properties[PROPERTY_username].setDisplayName ( "User Name" );
|
103 |
|
|
properties[PROPERTY_username].setShortDescription ( "Metacat user name" );
|
104 |
|
|
}
|
105 |
|
|
catch(IntrospectionException e) {
|
106 |
|
|
e.printStackTrace();
|
107 |
|
|
}//GEN-HEADEREND:Properties
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
return properties; }//GEN-LAST:Properties
|
111 |
|
|
|
112 |
|
|
// EventSet identifiers//GEN-FIRST:Events
|
113 |
|
|
|
114 |
|
|
// EventSet array
|
115 |
|
|
/*lazy EventSetDescriptor*/
|
116 |
|
|
private static EventSetDescriptor[] getEdescriptor(){
|
117 |
|
|
EventSetDescriptor[] eventSets = new EventSetDescriptor[0];//GEN-HEADEREND:Events
|
118 |
|
|
|
119 |
|
|
// Here you can add code for customizing the event sets array.
|
120 |
|
|
|
121 |
|
|
return eventSets; }//GEN-LAST:Events
|
122 |
|
|
|
123 |
|
|
// Method identifiers//GEN-FIRST:Methods
|
124 |
|
|
|
125 |
|
|
// Method array
|
126 |
|
|
/*lazy MethodDescriptor*/
|
127 |
|
|
private static MethodDescriptor[] getMdescriptor(){
|
128 |
|
|
MethodDescriptor[] methods = new MethodDescriptor[0];//GEN-HEADEREND:Methods
|
129 |
|
|
|
130 |
|
|
// Here you can add code for customizing the methods array.
|
131 |
|
|
|
132 |
|
|
return methods; }//GEN-LAST:Methods
|
133 |
|
|
|
134 |
|
|
|
135 |
|
|
private static final int defaultPropertyIndex = -1;//GEN-BEGIN:Idx
|
136 |
|
|
private static final int defaultEventIndex = -1;//GEN-END:Idx
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
//GEN-FIRST:Superclass
|
140 |
|
|
|
141 |
|
|
// Here you can add code for customizing the Superclass BeanInfo.
|
142 |
|
|
|
143 |
|
|
//GEN-LAST:Superclass
|
144 |
|
|
|
145 |
|
|
/**
|
146 |
|
|
* Gets the bean's <code>BeanDescriptor</code>s.
|
147 |
|
|
*
|
148 |
|
|
* @return BeanDescriptor describing the editable
|
149 |
|
|
* properties of this bean. May return null if the
|
150 |
|
|
* information should be obtained by automatic analysis.
|
151 |
|
|
*/
|
152 |
|
|
public BeanDescriptor getBeanDescriptor() {
|
153 |
|
|
return getBdescriptor();
|
154 |
|
|
}
|
155 |
|
|
|
156 |
|
|
/**
|
157 |
|
|
* Gets the bean's <code>PropertyDescriptor</code>s.
|
158 |
|
|
*
|
159 |
|
|
* @return An array of PropertyDescriptors describing the editable
|
160 |
|
|
* properties supported by this bean. May return null if the
|
161 |
|
|
* information should be obtained by automatic analysis.
|
162 |
|
|
* <p>
|
163 |
|
|
* If a property is indexed, then its entry in the result array will
|
164 |
|
|
* belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor.
|
165 |
|
|
* A client of getPropertyDescriptors can use "instanceof" to check
|
166 |
|
|
* if a given PropertyDescriptor is an IndexedPropertyDescriptor.
|
167 |
|
|
*/
|
168 |
|
|
public PropertyDescriptor[] getPropertyDescriptors() {
|
169 |
|
|
return getPdescriptor();
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
/**
|
173 |
|
|
* Gets the bean's <code>EventSetDescriptor</code>s.
|
174 |
|
|
*
|
175 |
|
|
* @return An array of EventSetDescriptors describing the kinds of
|
176 |
|
|
* events fired by this bean. May return null if the information
|
177 |
|
|
* should be obtained by automatic analysis.
|
178 |
|
|
*/
|
179 |
|
|
public EventSetDescriptor[] getEventSetDescriptors() {
|
180 |
|
|
return getEdescriptor();
|
181 |
|
|
}
|
182 |
|
|
|
183 |
|
|
/**
|
184 |
|
|
* Gets the bean's <code>MethodDescriptor</code>s.
|
185 |
|
|
*
|
186 |
|
|
* @return An array of MethodDescriptors describing the methods
|
187 |
|
|
* implemented by this bean. May return null if the information
|
188 |
|
|
* should be obtained by automatic analysis.
|
189 |
|
|
*/
|
190 |
|
|
public MethodDescriptor[] getMethodDescriptors() {
|
191 |
|
|
return getMdescriptor();
|
192 |
|
|
}
|
193 |
|
|
|
194 |
|
|
/**
|
195 |
|
|
* A bean may have a "default" property that is the property that will
|
196 |
|
|
* mostly commonly be initially chosen for update by human's who are
|
197 |
|
|
* customizing the bean.
|
198 |
|
|
* @return Index of default property in the PropertyDescriptor array
|
199 |
|
|
* returned by getPropertyDescriptors.
|
200 |
|
|
* <P> Returns -1 if there is no default property.
|
201 |
|
|
*/
|
202 |
|
|
public int getDefaultPropertyIndex() {
|
203 |
|
|
return defaultPropertyIndex;
|
204 |
|
|
}
|
205 |
|
|
|
206 |
|
|
/**
|
207 |
|
|
* A bean may have a "default" event that is the event that will
|
208 |
|
|
* mostly commonly be used by human's when using the bean.
|
209 |
|
|
* @return Index of default event in the EventSetDescriptor array
|
210 |
|
|
* returned by getEventSetDescriptors.
|
211 |
|
|
* <P> Returns -1 if there is no default event.
|
212 |
|
|
*/
|
213 |
|
|
public int getDefaultEventIndex() {
|
214 |
|
|
return defaultEventIndex;
|
215 |
|
|
}
|
216 |
|
|
|
217 |
|
|
|
218 |
|
|
}
|