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 PanelGroupBeanInfoBase 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(), PanelGroupBeanInfoBase.class
071: .getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>PanelGroupBeanInfoBase</code>.</p>
075: */
076: public PanelGroupBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.PanelGroup.class;
079: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PanelGroup_C16";
080: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PanelGroup_C32";
081: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PanelGroup_M16";
082: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PanelGroup_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("PanelGroup_DisplayName"));
143: beanDescriptor.setShortDescription(resources
144: .getString("PanelGroup_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_group_panel");
153: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
154: "groupPanel");
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_group_panel_props");
160: beanDescriptor.setValue(
161: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
162: getCategoryDescriptors());
163: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
164: "panelGroup");
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_block = new PropertyDescriptor(
288: "block", beanClass, "isBlock", "setBlock");
289: prop_block.setDisplayName(resources
290: .getString("PanelGroup_block_DisplayName"));
291: prop_block.setShortDescription(resources
292: .getString("PanelGroup_block_Description"));
293: prop_block.setExpert(false);
294: prop_block.setHidden(false);
295: prop_block.setPreferred(false);
296: attrib = new AttributeDescriptor("block", false, null, true);
297: prop_block.setValue(
298: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
299: attrib);
300: prop_block
301: .setValue(
302: Constants.PropertyDescriptor.CATEGORY,
303: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
304:
305: PropertyDescriptor prop_separator = new PropertyDescriptor(
306: "separator", beanClass, "getSeparator",
307: "setSeparator");
308: prop_separator.setDisplayName(resources
309: .getString("PanelGroup_separator_DisplayName"));
310: prop_separator.setShortDescription(resources
311: .getString("PanelGroup_separator_Description"));
312: prop_separator
313: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StringPropertyEditor"));
314: prop_separator.setExpert(false);
315: prop_separator.setHidden(false);
316: prop_separator.setPreferred(false);
317: attrib = new AttributeDescriptor("separator", false, null,
318: true);
319: prop_separator.setValue(
320: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
321: attrib);
322: prop_separator
323: .setValue(
324: Constants.PropertyDescriptor.CATEGORY,
325: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
326:
327: PropertyDescriptor prop_style = new PropertyDescriptor(
328: "style", beanClass, "getStyle", "setStyle");
329: prop_style.setDisplayName(resources
330: .getString("PanelGroup_style_DisplayName"));
331: prop_style.setShortDescription(resources
332: .getString("PanelGroup_style_Description"));
333: prop_style
334: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.css.CssStylePropertyEditor"));
335: prop_style.setExpert(false);
336: prop_style.setHidden(false);
337: prop_style.setPreferred(false);
338: attrib = new AttributeDescriptor("style", false, null, true);
339: prop_style.setValue(
340: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
341: attrib);
342: prop_style
343: .setValue(
344: Constants.PropertyDescriptor.CATEGORY,
345: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
346:
347: PropertyDescriptor prop_styleClass = new PropertyDescriptor(
348: "styleClass", beanClass, "getStyleClass",
349: "setStyleClass");
350: prop_styleClass.setDisplayName(resources
351: .getString("PanelGroup_styleClass_DisplayName"));
352: prop_styleClass.setShortDescription(resources
353: .getString("PanelGroup_styleClass_Description"));
354: prop_styleClass
355: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StyleClassPropertyEditor"));
356: prop_styleClass.setExpert(false);
357: prop_styleClass.setHidden(false);
358: prop_styleClass.setPreferred(false);
359: attrib = new AttributeDescriptor("styleClass", false, null,
360: true);
361: prop_styleClass.setValue(
362: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
363: attrib);
364: prop_styleClass
365: .setValue(
366: Constants.PropertyDescriptor.CATEGORY,
367: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
368:
369: PropertyDescriptor prop_visible = new PropertyDescriptor(
370: "visible", beanClass, "isVisible", "setVisible");
371: prop_visible.setDisplayName(resources
372: .getString("PanelGroup_visible_DisplayName"));
373: prop_visible.setShortDescription(resources
374: .getString("PanelGroup_visible_Description"));
375: prop_visible.setExpert(false);
376: prop_visible.setHidden(false);
377: prop_visible.setPreferred(false);
378: attrib = new AttributeDescriptor("visible", false, "true",
379: true);
380: prop_visible.setValue(
381: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
382: attrib);
383: prop_visible
384: .setValue(
385: Constants.PropertyDescriptor.CATEGORY,
386: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
387:
388: PropertyDescriptor prop_attributes = new PropertyDescriptor(
389: "attributes", beanClass, "getAttributes", null);
390: prop_attributes.setDisplayName(resources
391: .getString("PanelGroup_attributes_DisplayName"));
392: prop_attributes.setShortDescription(resources
393: .getString("PanelGroup_attributes_Description"));
394: prop_attributes.setExpert(false);
395: prop_attributes.setHidden(true);
396: prop_attributes.setPreferred(false);
397: prop_attributes
398: .setValue(
399: Constants.PropertyDescriptor.CATEGORY,
400: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
401:
402: PropertyDescriptor prop_childCount = new PropertyDescriptor(
403: "childCount", beanClass, "getChildCount", null);
404: prop_childCount.setDisplayName(resources
405: .getString("PanelGroup_childCount_DisplayName"));
406: prop_childCount.setShortDescription(resources
407: .getString("PanelGroup_childCount_Description"));
408: prop_childCount.setExpert(false);
409: prop_childCount.setHidden(true);
410: prop_childCount.setPreferred(false);
411: prop_childCount
412: .setValue(
413: Constants.PropertyDescriptor.CATEGORY,
414: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
415:
416: PropertyDescriptor prop_children = new PropertyDescriptor(
417: "children", beanClass, "getChildren", null);
418: prop_children.setDisplayName(resources
419: .getString("PanelGroup_children_DisplayName"));
420: prop_children.setShortDescription(resources
421: .getString("PanelGroup_children_Description"));
422: prop_children.setExpert(false);
423: prop_children.setHidden(true);
424: prop_children.setPreferred(false);
425: prop_children
426: .setValue(
427: Constants.PropertyDescriptor.CATEGORY,
428: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
429:
430: PropertyDescriptor prop_facets = new PropertyDescriptor(
431: "facets", beanClass, "getFacets", null);
432: prop_facets.setDisplayName(resources
433: .getString("PanelGroup_facets_DisplayName"));
434: prop_facets.setShortDescription(resources
435: .getString("PanelGroup_facets_Description"));
436: prop_facets.setExpert(false);
437: prop_facets.setHidden(true);
438: prop_facets.setPreferred(false);
439: prop_facets
440: .setValue(
441: Constants.PropertyDescriptor.CATEGORY,
442: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
443:
444: PropertyDescriptor prop_family = new PropertyDescriptor(
445: "family", beanClass, "getFamily", null);
446: prop_family.setDisplayName(resources
447: .getString("PanelGroup_family_DisplayName"));
448: prop_family.setShortDescription(resources
449: .getString("PanelGroup_family_Description"));
450: prop_family.setExpert(false);
451: prop_family.setHidden(true);
452: prop_family.setPreferred(false);
453: prop_family
454: .setValue(
455: Constants.PropertyDescriptor.CATEGORY,
456: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
457:
458: PropertyDescriptor prop_id = new PropertyDescriptor("id",
459: beanClass, "getId", "setId");
460: prop_id.setDisplayName(resources
461: .getString("PanelGroup_id_DisplayName"));
462: prop_id.setShortDescription(resources
463: .getString("PanelGroup_id_Description"));
464: prop_id.setExpert(false);
465: prop_id.setHidden(true);
466: prop_id.setPreferred(false);
467: attrib = new AttributeDescriptor("id", false, null, false);
468: prop_id.setValue(
469: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
470: attrib);
471: prop_id
472: .setValue(
473: Constants.PropertyDescriptor.CATEGORY,
474: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
475:
476: PropertyDescriptor prop_parent = new PropertyDescriptor(
477: "parent", beanClass, "getParent", "setParent");
478: prop_parent.setDisplayName(resources
479: .getString("PanelGroup_parent_DisplayName"));
480: prop_parent.setShortDescription(resources
481: .getString("PanelGroup_parent_Description"));
482: prop_parent.setExpert(false);
483: prop_parent.setHidden(true);
484: prop_parent.setPreferred(false);
485: prop_parent
486: .setValue(
487: Constants.PropertyDescriptor.CATEGORY,
488: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
489:
490: PropertyDescriptor prop_rendered = new PropertyDescriptor(
491: "rendered", beanClass, "isRendered", "setRendered");
492: prop_rendered.setDisplayName(resources
493: .getString("PanelGroup_rendered_DisplayName"));
494: prop_rendered.setShortDescription(resources
495: .getString("PanelGroup_rendered_Description"));
496: prop_rendered.setExpert(false);
497: prop_rendered.setHidden(false);
498: prop_rendered.setPreferred(false);
499: attrib = new AttributeDescriptor("rendered", false, null,
500: true);
501: prop_rendered.setValue(
502: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
503: attrib);
504: prop_rendered
505: .setValue(
506: Constants.PropertyDescriptor.CATEGORY,
507: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
508:
509: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
510: "rendererType", beanClass, "getRendererType",
511: "setRendererType");
512: prop_rendererType.setDisplayName(resources
513: .getString("PanelGroup_rendererType_DisplayName"));
514: prop_rendererType.setShortDescription(resources
515: .getString("PanelGroup_rendererType_Description"));
516: prop_rendererType.setExpert(false);
517: prop_rendererType.setHidden(true);
518: prop_rendererType.setPreferred(false);
519: prop_rendererType
520: .setValue(
521: Constants.PropertyDescriptor.CATEGORY,
522: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
523:
524: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
525: "rendersChildren", beanClass, "getRendersChildren",
526: null);
527: prop_rendersChildren
528: .setDisplayName(resources
529: .getString("PanelGroup_rendersChildren_DisplayName"));
530: prop_rendersChildren
531: .setShortDescription(resources
532: .getString("PanelGroup_rendersChildren_Description"));
533: prop_rendersChildren.setExpert(false);
534: prop_rendersChildren.setHidden(true);
535: prop_rendersChildren.setPreferred(false);
536: prop_rendersChildren
537: .setValue(
538: Constants.PropertyDescriptor.CATEGORY,
539: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
540:
541: propDescriptors = new PropertyDescriptor[] {
542: prop_attributes, prop_block, prop_childCount,
543: prop_children, prop_facets, prop_family, prop_id,
544: prop_parent, prop_rendered, prop_rendererType,
545: prop_rendersChildren, prop_separator, prop_style,
546: prop_styleClass, prop_visible, };
547: return propDescriptors;
548:
549: } catch (IntrospectionException e) {
550: e.printStackTrace();
551: return null;
552: }
553:
554: }
555:
556: }
557: //GEN-END:BeanInfo
|