001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.visualweb.faces.dt_1_2.component;
043:
044: import java.awt.Image;
045: import java.beans.BeanDescriptor;
046: import java.beans.BeanInfo;
047: import java.beans.IntrospectionException;
048: import java.beans.PropertyDescriptor;
049: import java.util.Locale;
050: import java.util.List;
051: import java.util.ArrayList;
052: import java.util.Arrays;
053: import java.util.ResourceBundle;
054:
055: import com.sun.rave.designtime.CategoryDescriptor;
056: import com.sun.rave.designtime.Constants;
057: import com.sun.rave.designtime.faces.FacetDescriptor;
058: import com.sun.rave.designtime.markup.AttributeDescriptor;
059:
060: import org.netbeans.modules.visualweb.faces.dt.HtmlBeanInfoBase;
061: import org.netbeans.modules.visualweb.faces.dt.BeanDescriptorBase;
062: import org.netbeans.modules.visualweb.faces.dt.PropertyDescriptorBase;
063:
064: /**
065: * <p>Auto-generated design time metadata class.
066: * Do <strong>NOT</strong> modify; all changes
067: * <strong>will</strong> be lost!</p>
068: */
069:
070: abstract class UISelectItemBeanInfoBase extends HtmlBeanInfoBase {
071:
072: protected static ResourceBundle resources = ResourceBundle
073: .getBundle(
074: "org.netbeans.modules.visualweb.faces.dt_1_2.component.Bundle-JSF",
075: Locale.getDefault(), UISelectItemBeanInfoBase.class
076: .getClassLoader());
077:
078: /**
079: * <p>Construct a new <code>UISelectItemBeanInfoBase</code>.</p>
080: */
081: public UISelectItemBeanInfoBase() {
082:
083: beanClass = javax.faces.component.UISelectItem.class;
084: iconFileName_C16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UISelectItem_C16";
085: iconFileName_C32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UISelectItem_C32";
086: iconFileName_M16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UISelectItem_M16";
087: iconFileName_M32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UISelectItem_M32";
088:
089: }
090:
091: private BeanDescriptor beanDescriptor;
092:
093: /**
094: * <p>Return the <code>BeanDescriptor</code> for this bean.</p>
095: */
096: public BeanDescriptor getBeanDescriptor() {
097:
098: if (beanDescriptor != null) {
099: return beanDescriptor;
100: }
101:
102: beanDescriptor = new BeanDescriptorBase(beanClass);
103: beanDescriptor.setDisplayName(resources
104: .getString("UISelectItem_DisplayName"));
105: beanDescriptor.setShortDescription(resources
106: .getString("UISelectItem_Description"));
107: beanDescriptor.setExpert(false);
108: beanDescriptor.setHidden(false);
109: beanDescriptor.setPreferred(false);
110: beanDescriptor.setValue(
111: Constants.BeanDescriptor.FACET_DESCRIPTORS,
112: getFacetDescriptors());
113: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
114: "selectItem");
115: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
116: Boolean.TRUE);
117: beanDescriptor.setValue(
118: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
119: getCategoryDescriptors());
120: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
121: "selectItem");
122:
123: return beanDescriptor;
124:
125: }
126:
127: /**
128: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
129: */
130: private CategoryDescriptor[] getCategoryDescriptors() {
131:
132: return com.sun.rave.designtime.base.CategoryDescriptors
133: .getDefaultCategoryDescriptors();
134:
135: }
136:
137: /**
138: * <p>The cached facet descriptors.</p>
139: */
140: protected FacetDescriptor[] facetDescriptors;
141:
142: /**
143: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
144: */
145: public FacetDescriptor[] getFacetDescriptors() {
146:
147: if (facetDescriptors != null) {
148: return facetDescriptors;
149: }
150: facetDescriptors = new FacetDescriptor[] {};
151: return facetDescriptors;
152:
153: }
154:
155: /**
156: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
157: */
158:
159: private PropertyDescriptor[] propertyDescriptors;
160:
161: /**
162: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
163: */
164: public PropertyDescriptor[] getPropertyDescriptors() {
165:
166: if (propertyDescriptors != null) {
167: return propertyDescriptors;
168: }
169: AttributeDescriptor attrib = null;
170:
171: try {
172:
173: PropertyDescriptor prop_attributes = new PropertyDescriptorBase(
174: "attributes", beanClass, "getAttributes", null);
175: prop_attributes.setDisplayName(resources
176: .getString("UISelectItem_attributes_DisplayName"));
177: prop_attributes.setShortDescription(resources
178: .getString("UISelectItem_attributes_Description"));
179: prop_attributes.setExpert(false);
180: prop_attributes.setHidden(true);
181: prop_attributes.setPreferred(false);
182: prop_attributes
183: .setValue(
184: Constants.PropertyDescriptor.CATEGORY,
185: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
186:
187: PropertyDescriptor prop_childCount = new PropertyDescriptorBase(
188: "childCount", beanClass, "getChildCount", null);
189: prop_childCount.setDisplayName(resources
190: .getString("UISelectItem_childCount_DisplayName"));
191: prop_childCount.setShortDescription(resources
192: .getString("UISelectItem_childCount_Description"));
193: prop_childCount.setExpert(false);
194: prop_childCount.setHidden(true);
195: prop_childCount.setPreferred(false);
196: prop_childCount
197: .setValue(
198: Constants.PropertyDescriptor.CATEGORY,
199: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
200:
201: PropertyDescriptor prop_children = new PropertyDescriptorBase(
202: "children", beanClass, "getChildren", null);
203: prop_children.setDisplayName(resources
204: .getString("UISelectItem_children_DisplayName"));
205: prop_children.setShortDescription(resources
206: .getString("UISelectItem_children_Description"));
207: prop_children.setExpert(false);
208: prop_children.setHidden(true);
209: prop_children.setPreferred(false);
210: prop_children
211: .setValue(
212: Constants.PropertyDescriptor.CATEGORY,
213: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
214:
215: PropertyDescriptor prop_facets = new PropertyDescriptorBase(
216: "facets", beanClass, "getFacets", null);
217: prop_facets.setDisplayName(resources
218: .getString("UISelectItem_facets_DisplayName"));
219: prop_facets.setShortDescription(resources
220: .getString("UISelectItem_facets_Description"));
221: prop_facets.setExpert(false);
222: prop_facets.setHidden(true);
223: prop_facets.setPreferred(false);
224: prop_facets
225: .setValue(
226: Constants.PropertyDescriptor.CATEGORY,
227: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
228:
229: PropertyDescriptor prop_family = new PropertyDescriptorBase(
230: "family", beanClass, "getFamily", null);
231: prop_family.setDisplayName(resources
232: .getString("UISelectItem_family_DisplayName"));
233: prop_family.setShortDescription(resources
234: .getString("UISelectItem_family_Description"));
235: prop_family.setExpert(false);
236: prop_family.setHidden(true);
237: prop_family.setPreferred(false);
238: prop_family
239: .setValue(
240: Constants.PropertyDescriptor.CATEGORY,
241: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
242:
243: PropertyDescriptor prop_id = new PropertyDescriptorBase(
244: "id", beanClass, "getId", "setId");
245: prop_id.setDisplayName(resources
246: .getString("UISelectItem_id_DisplayName"));
247: prop_id.setShortDescription(resources
248: .getString("UISelectItem_id_Description"));
249: prop_id.setExpert(false);
250: prop_id.setHidden(true);
251: prop_id.setPreferred(false);
252: attrib = new AttributeDescriptor("id", false, null, true);
253: prop_id.setValue(
254: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
255: attrib);
256: prop_id
257: .setValue(
258: Constants.PropertyDescriptor.CATEGORY,
259: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
260:
261: PropertyDescriptor prop_itemDescription = new PropertyDescriptorBase(
262: "itemDescription", beanClass, "getItemDescription",
263: "setItemDescription");
264: prop_itemDescription
265: .setDisplayName(resources
266: .getString("UISelectItem_itemDescription_DisplayName"));
267: prop_itemDescription
268: .setShortDescription(resources
269: .getString("UISelectItem_itemDescription_Description"));
270: prop_itemDescription.setExpert(false);
271: prop_itemDescription.setHidden(false);
272: prop_itemDescription.setPreferred(false);
273: attrib = new AttributeDescriptor("itemDescription", false,
274: null, true);
275: prop_itemDescription.setValue(
276: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
277: attrib);
278: prop_itemDescription
279: .setValue(
280: Constants.PropertyDescriptor.CATEGORY,
281: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
282:
283: PropertyDescriptor prop_itemDisabled = new PropertyDescriptorBase(
284: "itemDisabled", beanClass, "isItemDisabled",
285: "setItemDisabled");
286: prop_itemDisabled
287: .setDisplayName(resources
288: .getString("UISelectItem_itemDisabled_DisplayName"));
289: prop_itemDisabled
290: .setShortDescription(resources
291: .getString("UISelectItem_itemDisabled_Description"));
292: prop_itemDisabled.setExpert(false);
293: prop_itemDisabled.setHidden(false);
294: prop_itemDisabled.setPreferred(false);
295: attrib = new AttributeDescriptor("itemDisabled", false,
296: null, true);
297: prop_itemDisabled.setValue(
298: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
299: attrib);
300: prop_itemDisabled
301: .setValue(
302: Constants.PropertyDescriptor.CATEGORY,
303: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
304:
305: PropertyDescriptor prop_itemLabel = new PropertyDescriptorBase(
306: "itemLabel", beanClass, "getItemLabel",
307: "setItemLabel");
308: prop_itemLabel.setDisplayName(resources
309: .getString("UISelectItem_itemLabel_DisplayName"));
310: prop_itemLabel.setShortDescription(resources
311: .getString("UISelectItem_itemLabel_Description"));
312: prop_itemLabel.setExpert(false);
313: prop_itemLabel.setHidden(false);
314: prop_itemLabel.setPreferred(false);
315: attrib = new AttributeDescriptor("itemLabel", false, null,
316: true);
317: prop_itemLabel.setValue(
318: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
319: attrib);
320: prop_itemLabel
321: .setValue(
322: Constants.PropertyDescriptor.CATEGORY,
323: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
324:
325: PropertyDescriptor prop_itemValue = new PropertyDescriptorBase(
326: "itemValue", beanClass, "getItemValue",
327: "setItemValue");
328: prop_itemValue.setDisplayName(resources
329: .getString("UISelectItem_itemValue_DisplayName"));
330: prop_itemValue.setShortDescription(resources
331: .getString("UISelectItem_itemValue_Description"));
332: prop_itemValue.setExpert(false);
333: prop_itemValue.setHidden(false);
334: prop_itemValue.setPreferred(false);
335: attrib = new AttributeDescriptor("itemValue", false, null,
336: true);
337: prop_itemValue.setValue(
338: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
339: attrib);
340: prop_itemValue
341: .setValue(
342: Constants.PropertyDescriptor.CATEGORY,
343: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
344:
345: PropertyDescriptor prop_parent = new PropertyDescriptorBase(
346: "parent", beanClass, "getParent", null);
347: prop_parent.setDisplayName(resources
348: .getString("UISelectItem_parent_DisplayName"));
349: prop_parent.setShortDescription(resources
350: .getString("UISelectItem_parent_Description"));
351: prop_parent.setExpert(false);
352: prop_parent.setHidden(true);
353: prop_parent.setPreferred(false);
354: prop_parent
355: .setValue(
356: Constants.PropertyDescriptor.CATEGORY,
357: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
358:
359: PropertyDescriptor prop_rendered = new PropertyDescriptorBase(
360: "rendered", beanClass, "isRendered", "setRendered");
361: prop_rendered.setDisplayName(resources
362: .getString("UISelectItem_rendered_DisplayName"));
363: prop_rendered.setShortDescription(resources
364: .getString("UISelectItem_rendered_Description"));
365: prop_rendered.setExpert(false);
366: prop_rendered.setHidden(false);
367: prop_rendered.setPreferred(false);
368: attrib = new AttributeDescriptor("rendered", false, null,
369: true);
370: prop_rendered.setValue(
371: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
372: attrib);
373: prop_rendered
374: .setValue(
375: Constants.PropertyDescriptor.CATEGORY,
376: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
377:
378: PropertyDescriptor prop_rendererType = new PropertyDescriptorBase(
379: "rendererType", beanClass, "getRendererType",
380: "setRendererType");
381: prop_rendererType
382: .setDisplayName(resources
383: .getString("UISelectItem_rendererType_DisplayName"));
384: prop_rendererType
385: .setShortDescription(resources
386: .getString("UISelectItem_rendererType_Description"));
387: prop_rendererType.setExpert(false);
388: prop_rendererType.setHidden(true);
389: prop_rendererType.setPreferred(false);
390: prop_rendererType
391: .setValue(
392: Constants.PropertyDescriptor.CATEGORY,
393: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
394:
395: PropertyDescriptor prop_rendersChildren = new PropertyDescriptorBase(
396: "rendersChildren", beanClass, "getRendersChildren",
397: null);
398: prop_rendersChildren
399: .setDisplayName(resources
400: .getString("UISelectItem_rendersChildren_DisplayName"));
401: prop_rendersChildren
402: .setShortDescription(resources
403: .getString("UISelectItem_rendersChildren_Description"));
404: prop_rendersChildren.setExpert(false);
405: prop_rendersChildren.setHidden(true);
406: prop_rendersChildren.setPreferred(false);
407: prop_rendersChildren
408: .setValue(
409: Constants.PropertyDescriptor.CATEGORY,
410: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
411:
412: PropertyDescriptor prop_value = new PropertyDescriptorBase(
413: "value", beanClass, "getValue", "setValue");
414: prop_value.setDisplayName(resources
415: .getString("UISelectItem_value_DisplayName"));
416: prop_value.setShortDescription(resources
417: .getString("UISelectItem_value_Description"));
418: prop_value
419: .setPropertyEditorClass(org.netbeans.modules.visualweb.faces.dt.std.ValueBindingPropertyEditor.class);
420: prop_value.setExpert(false);
421: prop_value.setHidden(false);
422: prop_value.setPreferred(false);
423: attrib = new AttributeDescriptor("value", false, null, true);
424: prop_value.setValue(
425: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
426: attrib);
427: prop_value
428: .setValue(
429: Constants.PropertyDescriptor.CATEGORY,
430: com.sun.rave.designtime.base.CategoryDescriptors.DATA);
431: prop_value.setValue("ignoreIsBound", "true");
432:
433: List<PropertyDescriptor> propertyDescriptorList = new ArrayList<PropertyDescriptor>();
434: propertyDescriptorList.add(prop_attributes);
435: propertyDescriptorList.add(prop_childCount);
436: propertyDescriptorList.add(prop_children);
437: propertyDescriptorList.add(prop_facets);
438: propertyDescriptorList.add(prop_family);
439: propertyDescriptorList.add(prop_id);
440: propertyDescriptorList.add(prop_itemDescription);
441: propertyDescriptorList.add(prop_itemDisabled);
442: propertyDescriptorList.add(prop_itemLabel);
443: propertyDescriptorList.add(prop_itemValue);
444: propertyDescriptorList.add(prop_parent);
445: propertyDescriptorList.add(prop_rendered);
446: propertyDescriptorList.add(prop_rendererType);
447: propertyDescriptorList.add(prop_rendersChildren);
448: propertyDescriptorList.add(prop_value);
449:
450: propertyDescriptorList.addAll(Arrays.asList(super
451: .getPropertyDescriptors()));
452: propertyDescriptors = propertyDescriptorList
453: .toArray(new PropertyDescriptor[propertyDescriptorList
454: .size()]);
455: return propertyDescriptors;
456:
457: } catch (IntrospectionException e) {
458: e.printStackTrace();
459: return null;
460: }
461:
462: }
463:
464: }
|