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 TabSetBeanInfoBase 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(), TabSetBeanInfoBase.class
071: .getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>TabSetBeanInfoBase</code>.</p>
075: */
076: public TabSetBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.TabSet.class;
079: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/TabSet_C16";
080: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/TabSet_C32";
081: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/TabSet_M16";
082: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/TabSet_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("TabSet_DisplayName"));
143: beanDescriptor.setShortDescription(resources
144: .getString("TabSet_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_tab_set");
153: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
154: "tabSet");
155: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
156: Boolean.TRUE);
157: beanDescriptor
158: .setValue(Constants.BeanDescriptor.PROPERTIES_HELP_KEY,
159: "projrave_ui_elements_palette_bh_propsheets_bh_tab_set_props");
160: beanDescriptor.setValue(
161: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
162: getCategoryDescriptors());
163: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
164: "tabSet");
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_actionListener = new PropertyDescriptor(
288: "actionListener", beanClass, "getActionListener",
289: "setActionListener");
290: prop_actionListener.setDisplayName(resources
291: .getString("TabSet_actionListener_DisplayName"));
292: prop_actionListener.setShortDescription(resources
293: .getString("TabSet_actionListener_Description"));
294: prop_actionListener
295: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.MethodBindingPropertyEditor"));
296: prop_actionListener.setExpert(false);
297: prop_actionListener.setHidden(false);
298: prop_actionListener.setPreferred(false);
299: attrib = new AttributeDescriptor("actionListener", false,
300: null, true);
301: prop_actionListener.setValue(
302: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
303: attrib);
304: prop_actionListener
305: .setValue(
306: Constants.PropertyDescriptor.CATEGORY,
307: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
308:
309: PropertyDescriptor prop_lite = new PropertyDescriptor(
310: "lite", beanClass, "isLite", "setLite");
311: prop_lite.setDisplayName(resources
312: .getString("TabSet_lite_DisplayName"));
313: prop_lite.setShortDescription(resources
314: .getString("TabSet_lite_Description"));
315: prop_lite.setExpert(false);
316: prop_lite.setHidden(false);
317: prop_lite.setPreferred(false);
318: attrib = new AttributeDescriptor("lite", false, "false",
319: true);
320: prop_lite.setValue(
321: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
322: attrib);
323: prop_lite
324: .setValue(
325: Constants.PropertyDescriptor.CATEGORY,
326: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
327:
328: PropertyDescriptor prop_mini = new PropertyDescriptor(
329: "mini", beanClass, "isMini", "setMini");
330: prop_mini.setDisplayName(resources
331: .getString("TabSet_mini_DisplayName"));
332: prop_mini.setShortDescription(resources
333: .getString("TabSet_mini_Description"));
334: prop_mini.setExpert(false);
335: prop_mini.setHidden(false);
336: prop_mini.setPreferred(false);
337: attrib = new AttributeDescriptor("mini", false, null, true);
338: prop_mini.setValue(
339: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
340: attrib);
341: prop_mini
342: .setValue(
343: Constants.PropertyDescriptor.CATEGORY,
344: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
345:
346: PropertyDescriptor prop_selected = new PropertyDescriptor(
347: "selected", beanClass, "getSelected", "setSelected");
348: prop_selected.setDisplayName(resources
349: .getString("TabSet_selected_DisplayName"));
350: prop_selected.setShortDescription(resources
351: .getString("TabSet_selected_Description"));
352: prop_selected
353: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.SelectOneDomainEditor"));
354: prop_selected.setExpert(false);
355: prop_selected.setHidden(false);
356: prop_selected.setPreferred(false);
357: attrib = new AttributeDescriptor("selected", false, null,
358: true);
359: prop_selected.setValue(
360: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
361: attrib);
362: prop_selected
363: .setValue(
364: Constants.PropertyDescriptor.CATEGORY,
365: com.sun.rave.designtime.base.CategoryDescriptors.DATA);
366: prop_selected
367: .setValue(
368: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
369: org.netbeans.modules.visualweb.web.ui.dt.component.propertyeditors.TabIdsDomain.class);
370:
371: PropertyDescriptor prop_style = new PropertyDescriptor(
372: "style", beanClass, "getStyle", "setStyle");
373: prop_style.setDisplayName(resources
374: .getString("TabSet_style_DisplayName"));
375: prop_style.setShortDescription(resources
376: .getString("TabSet_style_Description"));
377: prop_style
378: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.css.CssStylePropertyEditor"));
379: prop_style.setExpert(false);
380: prop_style.setHidden(false);
381: prop_style.setPreferred(false);
382: attrib = new AttributeDescriptor("style", false, null, true);
383: prop_style.setValue(
384: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
385: attrib);
386: prop_style
387: .setValue(
388: Constants.PropertyDescriptor.CATEGORY,
389: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
390:
391: PropertyDescriptor prop_styleClass = new PropertyDescriptor(
392: "styleClass", beanClass, "getStyleClass",
393: "setStyleClass");
394: prop_styleClass.setDisplayName(resources
395: .getString("TabSet_styleClass_DisplayName"));
396: prop_styleClass.setShortDescription(resources
397: .getString("TabSet_styleClass_Description"));
398: prop_styleClass
399: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StyleClassPropertyEditor"));
400: prop_styleClass.setExpert(false);
401: prop_styleClass.setHidden(false);
402: prop_styleClass.setPreferred(false);
403: attrib = new AttributeDescriptor("styleClass", false, null,
404: true);
405: prop_styleClass.setValue(
406: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
407: attrib);
408: prop_styleClass
409: .setValue(
410: Constants.PropertyDescriptor.CATEGORY,
411: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
412:
413: PropertyDescriptor prop_visible = new PropertyDescriptor(
414: "visible", beanClass, "isVisible", "setVisible");
415: prop_visible.setDisplayName(resources
416: .getString("TabSet_visible_DisplayName"));
417: prop_visible.setShortDescription(resources
418: .getString("TabSet_visible_Description"));
419: prop_visible.setExpert(false);
420: prop_visible.setHidden(false);
421: prop_visible.setPreferred(false);
422: attrib = new AttributeDescriptor("visible", false, "true",
423: true);
424: prop_visible.setValue(
425: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
426: attrib);
427: prop_visible
428: .setValue(
429: Constants.PropertyDescriptor.CATEGORY,
430: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
431:
432: PropertyDescriptor prop_attributes = new PropertyDescriptor(
433: "attributes", beanClass, "getAttributes", null);
434: prop_attributes.setDisplayName(resources
435: .getString("TabSet_attributes_DisplayName"));
436: prop_attributes.setShortDescription(resources
437: .getString("TabSet_attributes_Description"));
438: prop_attributes.setExpert(false);
439: prop_attributes.setHidden(true);
440: prop_attributes.setPreferred(false);
441: prop_attributes
442: .setValue(
443: Constants.PropertyDescriptor.CATEGORY,
444: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
445:
446: PropertyDescriptor prop_childCount = new PropertyDescriptor(
447: "childCount", beanClass, "getChildCount", null);
448: prop_childCount.setDisplayName(resources
449: .getString("TabSet_childCount_DisplayName"));
450: prop_childCount.setShortDescription(resources
451: .getString("TabSet_childCount_Description"));
452: prop_childCount.setExpert(false);
453: prop_childCount.setHidden(true);
454: prop_childCount.setPreferred(false);
455: prop_childCount
456: .setValue(
457: Constants.PropertyDescriptor.CATEGORY,
458: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
459:
460: PropertyDescriptor prop_children = new PropertyDescriptor(
461: "children", beanClass, "getChildren", null);
462: prop_children.setDisplayName(resources
463: .getString("TabSet_children_DisplayName"));
464: prop_children.setShortDescription(resources
465: .getString("TabSet_children_Description"));
466: prop_children.setExpert(false);
467: prop_children.setHidden(true);
468: prop_children.setPreferred(false);
469: prop_children
470: .setValue(
471: Constants.PropertyDescriptor.CATEGORY,
472: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
473:
474: PropertyDescriptor prop_facets = new PropertyDescriptor(
475: "facets", beanClass, "getFacets", null);
476: prop_facets.setDisplayName(resources
477: .getString("TabSet_facets_DisplayName"));
478: prop_facets.setShortDescription(resources
479: .getString("TabSet_facets_Description"));
480: prop_facets.setExpert(false);
481: prop_facets.setHidden(true);
482: prop_facets.setPreferred(false);
483: prop_facets
484: .setValue(
485: Constants.PropertyDescriptor.CATEGORY,
486: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
487:
488: PropertyDescriptor prop_family = new PropertyDescriptor(
489: "family", beanClass, "getFamily", null);
490: prop_family.setDisplayName(resources
491: .getString("TabSet_family_DisplayName"));
492: prop_family.setShortDescription(resources
493: .getString("TabSet_family_Description"));
494: prop_family.setExpert(false);
495: prop_family.setHidden(true);
496: prop_family.setPreferred(false);
497: prop_family
498: .setValue(
499: Constants.PropertyDescriptor.CATEGORY,
500: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
501:
502: PropertyDescriptor prop_id = new PropertyDescriptor("id",
503: beanClass, "getId", "setId");
504: prop_id.setDisplayName(resources
505: .getString("TabSet_id_DisplayName"));
506: prop_id.setShortDescription(resources
507: .getString("TabSet_id_Description"));
508: prop_id.setExpert(false);
509: prop_id.setHidden(true);
510: prop_id.setPreferred(false);
511: attrib = new AttributeDescriptor("id", false, null, true);
512: prop_id.setValue(
513: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
514: attrib);
515: prop_id
516: .setValue(
517: Constants.PropertyDescriptor.CATEGORY,
518: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
519:
520: PropertyDescriptor prop_parent = new PropertyDescriptor(
521: "parent", beanClass, "getParent", null);
522: prop_parent.setDisplayName(resources
523: .getString("TabSet_parent_DisplayName"));
524: prop_parent.setShortDescription(resources
525: .getString("TabSet_parent_Description"));
526: prop_parent.setExpert(false);
527: prop_parent.setHidden(true);
528: prop_parent.setPreferred(false);
529: prop_parent
530: .setValue(
531: Constants.PropertyDescriptor.CATEGORY,
532: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
533:
534: PropertyDescriptor prop_rendered = new PropertyDescriptor(
535: "rendered", beanClass, "isRendered", "setRendered");
536: prop_rendered.setDisplayName(resources
537: .getString("TabSet_rendered_DisplayName"));
538: prop_rendered.setShortDescription(resources
539: .getString("TabSet_rendered_Description"));
540: prop_rendered.setExpert(false);
541: prop_rendered.setHidden(false);
542: prop_rendered.setPreferred(false);
543: attrib = new AttributeDescriptor("rendered", false, null,
544: true);
545: prop_rendered.setValue(
546: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
547: attrib);
548: prop_rendered
549: .setValue(
550: Constants.PropertyDescriptor.CATEGORY,
551: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
552:
553: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
554: "rendererType", beanClass, "getRendererType",
555: "setRendererType");
556: prop_rendererType.setDisplayName(resources
557: .getString("TabSet_rendererType_DisplayName"));
558: prop_rendererType.setShortDescription(resources
559: .getString("TabSet_rendererType_Description"));
560: prop_rendererType.setExpert(false);
561: prop_rendererType.setHidden(true);
562: prop_rendererType.setPreferred(false);
563: prop_rendererType
564: .setValue(
565: Constants.PropertyDescriptor.CATEGORY,
566: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
567:
568: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
569: "rendersChildren", beanClass, "getRendersChildren",
570: null);
571: prop_rendersChildren.setDisplayName(resources
572: .getString("TabSet_rendersChildren_DisplayName"));
573: prop_rendersChildren.setShortDescription(resources
574: .getString("TabSet_rendersChildren_Description"));
575: prop_rendersChildren.setExpert(false);
576: prop_rendersChildren.setHidden(true);
577: prop_rendersChildren.setPreferred(false);
578: prop_rendersChildren
579: .setValue(
580: Constants.PropertyDescriptor.CATEGORY,
581: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
582:
583: propDescriptors = new PropertyDescriptor[] {
584: prop_actionListener, prop_attributes,
585: prop_childCount, prop_children, prop_facets,
586: prop_family, prop_id, prop_lite, prop_mini,
587: prop_parent, prop_rendered, prop_rendererType,
588: prop_rendersChildren, prop_selected, prop_style,
589: prop_styleClass, prop_visible, };
590: return propDescriptors;
591:
592: } catch (IntrospectionException e) {
593: e.printStackTrace();
594: return null;
595: }
596:
597: }
598:
599: }
600: //GEN-END:BeanInfo
|