001: //GEN-BEGIN:BeanInfo
002: /*
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
004: *
005: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
006: *
007: * The contents of this file are subject to the terms of either the GNU
008: * General Public License Version 2 only ("GPL") or the Common
009: * Development and Distribution License("CDDL") (collectively, the
010: * "License"). You may not use this file except in compliance with the
011: * License. You can obtain a copy of the License at
012: * http://www.netbeans.org/cddl-gplv2.html
013: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
014: * specific language governing permissions and limitations under the
015: * License. When distributing the software, include this License Header
016: * Notice in each file and include the License file at
017: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
018: * particular file as subject to the "Classpath" exception as provided
019: * by Sun in the GPL Version 2 section of the License file that
020: * accompanied this code. If applicable, add the following below the
021: * License Header, with the fields enclosed by brackets [] replaced by
022: * your own identifying information:
023: * "Portions Copyrighted [year] [name of copyright owner]"
024: *
025: * Contributor(s):
026: *
027: * The Original Software is NetBeans. The Initial Developer of the Original
028: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
029: * Microsystems, Inc. All Rights Reserved.
030: *
031: * If you wish your version of this file to be governed by only the CDDL
032: * or only the GPL Version 2, indicate your decision by adding
033: * "[Contributor] elects to include this software in this distribution
034: * under the [CDDL or GPL Version 2] license." If you do not indicate a
035: * single choice of license, a recipient has the option to distribute
036: * your version of this file under either the CDDL, the GPL Version 2 or
037: * to extend the choice of license to its licensees as provided above.
038: * However, if you add GPL Version 2 code and therefore, elected the GPL
039: * Version 2 license, then the option applies only if the new code is
040: * made subject to such option by the copyright holder.
041: */
042: package org.netbeans.modules.visualweb.web.ui.dt.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.ResourceBundle;
051:
052: import com.sun.rave.designtime.CategoryDescriptor;
053: import com.sun.rave.designtime.Constants;
054: import com.sun.rave.designtime.faces.FacetDescriptor;
055: import com.sun.rave.designtime.markup.AttributeDescriptor;
056:
057: import java.beans.SimpleBeanInfo;
058:
059: /**
060: * <p>Auto-generated design time metadata class.
061: * Do <strong>NOT</strong> modify; all changes
062: * <strong>will</strong> be lost!</p>
063: */
064:
065: abstract class MessageGroupBeanInfoBase extends SimpleBeanInfo {
066:
067: protected static ResourceBundle resources = ResourceBundle
068: .getBundle(
069: "org.netbeans.modules.visualweb.web.ui.dt.component.Bundle-JSF",
070: Locale.getDefault(), MessageGroupBeanInfoBase.class
071: .getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>MessageGroupBeanInfoBase</code>.</p>
075: */
076: public MessageGroupBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.MessageGroup.class;
079: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/MessageGroup_C16";
080: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/MessageGroup_C32";
081: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/MessageGroup_M16";
082: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/MessageGroup_M32";
083:
084: }
085:
086: /**
087: * <p>The bean class that this BeanInfo represents.
088: */
089: protected Class beanClass;
090:
091: /**
092: * <p>The cached BeanDescriptor.</p>
093: */
094: protected BeanDescriptor beanDescriptor;
095:
096: /**
097: * <p>The index of the default property.</p>
098: */
099: protected int defaultPropertyIndex = -2;
100:
101: /**
102: * <p>The name of the default property.</p>
103: */
104: protected String defaultPropertyName;
105:
106: /**
107: * <p>The 16x16 color icon.</p>
108: */
109: protected String iconFileName_C16;
110:
111: /**
112: * <p>The 32x32 color icon.</p>
113: */
114: protected String iconFileName_C32;
115:
116: /**
117: * <p>The 16x16 monochrome icon.</p>
118: */
119: protected String iconFileName_M16;
120:
121: /**
122: * <p>The 32x32 monochrome icon.</p>
123: */
124: protected String iconFileName_M32;
125:
126: /**
127: * <p>The cached property descriptors.</p>
128: */
129: protected PropertyDescriptor[] propDescriptors;
130:
131: /**
132: * <p>Return the <code>BeanDescriptor</code> for this bean.</p>
133: */
134: public BeanDescriptor getBeanDescriptor() {
135:
136: if (beanDescriptor != null) {
137: return beanDescriptor;
138: }
139:
140: beanDescriptor = new BeanDescriptor(beanClass);
141: beanDescriptor.setDisplayName(resources
142: .getString("MessageGroup_DisplayName"));
143: beanDescriptor.setShortDescription(resources
144: .getString("MessageGroup_Description"));
145: beanDescriptor.setExpert(false);
146: beanDescriptor.setHidden(false);
147: beanDescriptor.setPreferred(false);
148: beanDescriptor.setValue(
149: Constants.BeanDescriptor.FACET_DESCRIPTORS,
150: getFacetDescriptors());
151: beanDescriptor.setValue(Constants.BeanDescriptor.HELP_KEY,
152: "projrave_ui_elements_palette_bh_message_group");
153: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
154: "messageGroup");
155: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
156: Boolean.FALSE);
157: beanDescriptor
158: .setValue(Constants.BeanDescriptor.PROPERTIES_HELP_KEY,
159: "projrave_ui_elements_palette_bh_propsheets_bh_message_group_props");
160: beanDescriptor.setValue(
161: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
162: getCategoryDescriptors());
163: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
164: "messageGroup");
165: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
166: "ui");
167: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
168: "http://www.sun.com/web/ui");
169:
170: return beanDescriptor;
171:
172: }
173:
174: /**
175: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
176: */
177: private CategoryDescriptor[] getCategoryDescriptors() {
178:
179: return com.sun.rave.designtime.base.CategoryDescriptors
180: .getDefaultCategoryDescriptors();
181:
182: }
183:
184: /**
185: * <p>Return the index of the default property, or
186: * -1 if there is no default property.</p>
187: */
188: public int getDefaultPropertyIndex() {
189:
190: if (defaultPropertyIndex > -2) {
191: return defaultPropertyIndex;
192: } else {
193: if (defaultPropertyName == null) {
194: defaultPropertyIndex = -1;
195: } else {
196: PropertyDescriptor pd[] = getPropertyDescriptors();
197: for (int i = 0; i < pd.length; i++) {
198: if (defaultPropertyName.equals(pd[i].getName())) {
199: defaultPropertyIndex = i;
200: break;
201: }
202: }
203: }
204: }
205: return defaultPropertyIndex;
206: }
207:
208: /**
209: * <p>The cached facet descriptors.</p>
210: */
211: protected FacetDescriptor[] facetDescriptors;
212:
213: /**
214: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
215: */
216: public FacetDescriptor[] getFacetDescriptors() {
217:
218: if (facetDescriptors != null) {
219: return facetDescriptors;
220: }
221: facetDescriptors = new FacetDescriptor[] {};
222: return facetDescriptors;
223:
224: }
225:
226: /**
227: * <p>Return the specified image (if any)
228: * for this component class.</p>
229: */
230: public Image getIcon(int kind) {
231:
232: String name;
233: switch (kind) {
234: case ICON_COLOR_16x16:
235: name = iconFileName_C16;
236: break;
237: case ICON_COLOR_32x32:
238: name = iconFileName_C32;
239: break;
240: case ICON_MONO_16x16:
241: name = iconFileName_M16;
242: break;
243: case ICON_MONO_32x32:
244: name = iconFileName_M32;
245: break;
246: default:
247: name = null;
248: break;
249: }
250: if (name == null) {
251: return null;
252: }
253:
254: Image image = loadImage(name + ".png");
255: if (image == null) {
256: image = loadImage(name + ".gif");
257: }
258: return image;
259:
260: }
261:
262: /**
263: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
264: */
265: private java.lang.Class loadClass(java.lang.String name) {
266:
267: try {
268: return Class.forName(name);
269: } catch (ClassNotFoundException e) {
270: throw new RuntimeException(e);
271: }
272:
273: }
274:
275: /**
276: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
277: */
278: public PropertyDescriptor[] getPropertyDescriptors() {
279:
280: if (propDescriptors != null) {
281: return propDescriptors;
282: }
283: AttributeDescriptor attrib = null;
284:
285: try {
286:
287: PropertyDescriptor prop_showDetail = new PropertyDescriptor(
288: "showDetail", beanClass, "isShowDetail",
289: "setShowDetail");
290: prop_showDetail.setDisplayName(resources
291: .getString("MessageGroup_showDetail_DisplayName"));
292: prop_showDetail.setShortDescription(resources
293: .getString("MessageGroup_showDetail_Description"));
294: prop_showDetail.setExpert(false);
295: prop_showDetail.setHidden(false);
296: prop_showDetail.setPreferred(false);
297: attrib = new AttributeDescriptor("showDetail", false,
298: "false", true);
299: prop_showDetail.setValue(
300: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
301: attrib);
302: prop_showDetail
303: .setValue(
304: Constants.PropertyDescriptor.CATEGORY,
305: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
306:
307: PropertyDescriptor prop_showGlobalOnly = new PropertyDescriptor(
308: "showGlobalOnly", beanClass, "isShowGlobalOnly",
309: "setShowGlobalOnly");
310: prop_showGlobalOnly
311: .setDisplayName(resources
312: .getString("MessageGroup_showGlobalOnly_DisplayName"));
313: prop_showGlobalOnly
314: .setShortDescription(resources
315: .getString("MessageGroup_showGlobalOnly_Description"));
316: prop_showGlobalOnly.setExpert(false);
317: prop_showGlobalOnly.setHidden(false);
318: prop_showGlobalOnly.setPreferred(false);
319: attrib = new AttributeDescriptor("showGlobalOnly", false,
320: "false", true);
321: prop_showGlobalOnly.setValue(
322: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
323: attrib);
324: prop_showGlobalOnly
325: .setValue(
326: Constants.PropertyDescriptor.CATEGORY,
327: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
328:
329: PropertyDescriptor prop_showSummary = new PropertyDescriptor(
330: "showSummary", beanClass, "isShowSummary",
331: "setShowSummary");
332: prop_showSummary.setDisplayName(resources
333: .getString("MessageGroup_showSummary_DisplayName"));
334: prop_showSummary.setShortDescription(resources
335: .getString("MessageGroup_showSummary_Description"));
336: prop_showSummary.setExpert(false);
337: prop_showSummary.setHidden(false);
338: prop_showSummary.setPreferred(false);
339: attrib = new AttributeDescriptor("showSummary", false,
340: "true", true);
341: prop_showSummary.setValue(
342: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
343: attrib);
344: prop_showSummary
345: .setValue(
346: Constants.PropertyDescriptor.CATEGORY,
347: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
348:
349: PropertyDescriptor prop_style = new PropertyDescriptor(
350: "style", beanClass, "getStyle", "setStyle");
351: prop_style.setDisplayName(resources
352: .getString("MessageGroup_style_DisplayName"));
353: prop_style.setShortDescription(resources
354: .getString("MessageGroup_style_Description"));
355: prop_style
356: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.css.CssStylePropertyEditor"));
357: prop_style.setExpert(false);
358: prop_style.setHidden(false);
359: prop_style.setPreferred(false);
360: attrib = new AttributeDescriptor("style", false, null, true);
361: prop_style.setValue(
362: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
363: attrib);
364: prop_style
365: .setValue(
366: Constants.PropertyDescriptor.CATEGORY,
367: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
368:
369: PropertyDescriptor prop_styleClass = new PropertyDescriptor(
370: "styleClass", beanClass, "getStyleClass",
371: "setStyleClass");
372: prop_styleClass.setDisplayName(resources
373: .getString("MessageGroup_styleClass_DisplayName"));
374: prop_styleClass.setShortDescription(resources
375: .getString("MessageGroup_styleClass_Description"));
376: prop_styleClass
377: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StyleClassPropertyEditor"));
378: prop_styleClass.setExpert(false);
379: prop_styleClass.setHidden(false);
380: prop_styleClass.setPreferred(false);
381: attrib = new AttributeDescriptor("styleClass", false, null,
382: true);
383: prop_styleClass.setValue(
384: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
385: attrib);
386: prop_styleClass
387: .setValue(
388: Constants.PropertyDescriptor.CATEGORY,
389: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
390:
391: PropertyDescriptor prop_toolTip = new PropertyDescriptor(
392: "toolTip", beanClass, "getToolTip", "setToolTip");
393: prop_toolTip.setDisplayName(resources
394: .getString("MessageGroup_toolTip_DisplayName"));
395: prop_toolTip.setShortDescription(resources
396: .getString("MessageGroup_toolTip_Description"));
397: prop_toolTip
398: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StringPropertyEditor"));
399: prop_toolTip.setExpert(false);
400: prop_toolTip.setHidden(false);
401: prop_toolTip.setPreferred(false);
402: attrib = new AttributeDescriptor("toolTip", false, null,
403: true);
404: prop_toolTip.setValue(
405: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
406: attrib);
407: prop_toolTip
408: .setValue(
409: Constants.PropertyDescriptor.CATEGORY,
410: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
411:
412: PropertyDescriptor prop_visible = new PropertyDescriptor(
413: "visible", beanClass, "isVisible", "setVisible");
414: prop_visible.setDisplayName(resources
415: .getString("MessageGroup_visible_DisplayName"));
416: prop_visible.setShortDescription(resources
417: .getString("MessageGroup_visible_Description"));
418: prop_visible.setExpert(false);
419: prop_visible.setHidden(false);
420: prop_visible.setPreferred(false);
421: attrib = new AttributeDescriptor("visible", false, "true",
422: true);
423: prop_visible.setValue(
424: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
425: attrib);
426: prop_visible
427: .setValue(
428: Constants.PropertyDescriptor.CATEGORY,
429: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
430:
431: PropertyDescriptor prop_attributes = new PropertyDescriptor(
432: "attributes", beanClass, "getAttributes", null);
433: prop_attributes.setDisplayName(resources
434: .getString("MessageGroup_attributes_DisplayName"));
435: prop_attributes.setShortDescription(resources
436: .getString("MessageGroup_attributes_Description"));
437: prop_attributes.setExpert(false);
438: prop_attributes.setHidden(true);
439: prop_attributes.setPreferred(false);
440: prop_attributes
441: .setValue(
442: Constants.PropertyDescriptor.CATEGORY,
443: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
444:
445: PropertyDescriptor prop_childCount = new PropertyDescriptor(
446: "childCount", beanClass, "getChildCount", null);
447: prop_childCount.setDisplayName(resources
448: .getString("MessageGroup_childCount_DisplayName"));
449: prop_childCount.setShortDescription(resources
450: .getString("MessageGroup_childCount_Description"));
451: prop_childCount.setExpert(false);
452: prop_childCount.setHidden(true);
453: prop_childCount.setPreferred(false);
454: prop_childCount
455: .setValue(
456: Constants.PropertyDescriptor.CATEGORY,
457: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
458:
459: PropertyDescriptor prop_children = new PropertyDescriptor(
460: "children", beanClass, "getChildren", null);
461: prop_children.setDisplayName(resources
462: .getString("MessageGroup_children_DisplayName"));
463: prop_children.setShortDescription(resources
464: .getString("MessageGroup_children_Description"));
465: prop_children.setExpert(false);
466: prop_children.setHidden(true);
467: prop_children.setPreferred(false);
468: prop_children
469: .setValue(
470: Constants.PropertyDescriptor.CATEGORY,
471: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
472:
473: PropertyDescriptor prop_facets = new PropertyDescriptor(
474: "facets", beanClass, "getFacets", null);
475: prop_facets.setDisplayName(resources
476: .getString("MessageGroup_facets_DisplayName"));
477: prop_facets.setShortDescription(resources
478: .getString("MessageGroup_facets_Description"));
479: prop_facets.setExpert(false);
480: prop_facets.setHidden(true);
481: prop_facets.setPreferred(false);
482: prop_facets
483: .setValue(
484: Constants.PropertyDescriptor.CATEGORY,
485: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
486:
487: PropertyDescriptor prop_family = new PropertyDescriptor(
488: "family", beanClass, "getFamily", null);
489: prop_family.setDisplayName(resources
490: .getString("MessageGroup_family_DisplayName"));
491: prop_family.setShortDescription(resources
492: .getString("MessageGroup_family_Description"));
493: prop_family.setExpert(false);
494: prop_family.setHidden(true);
495: prop_family.setPreferred(false);
496: prop_family
497: .setValue(
498: Constants.PropertyDescriptor.CATEGORY,
499: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
500:
501: PropertyDescriptor prop_id = new PropertyDescriptor("id",
502: beanClass, "getId", "setId");
503: prop_id.setDisplayName(resources
504: .getString("MessageGroup_id_DisplayName"));
505: prop_id.setShortDescription(resources
506: .getString("MessageGroup_id_Description"));
507: prop_id.setExpert(false);
508: prop_id.setHidden(true);
509: prop_id.setPreferred(false);
510: attrib = new AttributeDescriptor("id", false, null, false);
511: prop_id.setValue(
512: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
513: attrib);
514: prop_id
515: .setValue(
516: Constants.PropertyDescriptor.CATEGORY,
517: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
518:
519: PropertyDescriptor prop_parent = new PropertyDescriptor(
520: "parent", beanClass, "getParent", "setParent");
521: prop_parent.setDisplayName(resources
522: .getString("MessageGroup_parent_DisplayName"));
523: prop_parent.setShortDescription(resources
524: .getString("MessageGroup_parent_Description"));
525: prop_parent.setExpert(false);
526: prop_parent.setHidden(true);
527: prop_parent.setPreferred(false);
528: prop_parent
529: .setValue(
530: Constants.PropertyDescriptor.CATEGORY,
531: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
532:
533: PropertyDescriptor prop_rendered = new PropertyDescriptor(
534: "rendered", beanClass, "isRendered", "setRendered");
535: prop_rendered.setDisplayName(resources
536: .getString("MessageGroup_rendered_DisplayName"));
537: prop_rendered.setShortDescription(resources
538: .getString("MessageGroup_rendered_Description"));
539: prop_rendered.setExpert(false);
540: prop_rendered.setHidden(false);
541: prop_rendered.setPreferred(false);
542: attrib = new AttributeDescriptor("rendered", false, null,
543: true);
544: prop_rendered.setValue(
545: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
546: attrib);
547: prop_rendered
548: .setValue(
549: Constants.PropertyDescriptor.CATEGORY,
550: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
551:
552: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
553: "rendererType", beanClass, "getRendererType",
554: "setRendererType");
555: prop_rendererType
556: .setDisplayName(resources
557: .getString("MessageGroup_rendererType_DisplayName"));
558: prop_rendererType
559: .setShortDescription(resources
560: .getString("MessageGroup_rendererType_Description"));
561: prop_rendererType.setExpert(false);
562: prop_rendererType.setHidden(true);
563: prop_rendererType.setPreferred(false);
564: prop_rendererType
565: .setValue(
566: Constants.PropertyDescriptor.CATEGORY,
567: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
568:
569: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
570: "rendersChildren", beanClass, "getRendersChildren",
571: null);
572: prop_rendersChildren
573: .setDisplayName(resources
574: .getString("MessageGroup_rendersChildren_DisplayName"));
575: prop_rendersChildren
576: .setShortDescription(resources
577: .getString("MessageGroup_rendersChildren_Description"));
578: prop_rendersChildren.setExpert(false);
579: prop_rendersChildren.setHidden(true);
580: prop_rendersChildren.setPreferred(false);
581: prop_rendersChildren
582: .setValue(
583: Constants.PropertyDescriptor.CATEGORY,
584: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
585:
586: propDescriptors = new PropertyDescriptor[] {
587: prop_attributes, prop_childCount, prop_children,
588: prop_facets, prop_family, prop_id, prop_parent,
589: prop_rendered, prop_rendererType,
590: prop_rendersChildren, prop_showDetail,
591: prop_showGlobalOnly, prop_showSummary, prop_style,
592: prop_styleClass, prop_toolTip, prop_visible, };
593: return propDescriptors;
594:
595: } catch (IntrospectionException e) {
596: e.printStackTrace();
597: return null;
598: }
599:
600: }
601:
602: }
603: //GEN-END:BeanInfo
|