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 MetaBeanInfoBase 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(), MetaBeanInfoBase.class
071: .getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>MetaBeanInfoBase</code>.</p>
075: */
076: public MetaBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.Meta.class;
079: defaultPropertyName = "content";
080: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/Meta_C16";
081: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/Meta_C32";
082: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/Meta_M16";
083: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/Meta_M32";
084:
085: }
086:
087: /**
088: * <p>The bean class that this BeanInfo represents.
089: */
090: protected Class beanClass;
091:
092: /**
093: * <p>The cached BeanDescriptor.</p>
094: */
095: protected BeanDescriptor beanDescriptor;
096:
097: /**
098: * <p>The index of the default property.</p>
099: */
100: protected int defaultPropertyIndex = -2;
101:
102: /**
103: * <p>The name of the default property.</p>
104: */
105: protected String defaultPropertyName;
106:
107: /**
108: * <p>The 16x16 color icon.</p>
109: */
110: protected String iconFileName_C16;
111:
112: /**
113: * <p>The 32x32 color icon.</p>
114: */
115: protected String iconFileName_C32;
116:
117: /**
118: * <p>The 16x16 monochrome icon.</p>
119: */
120: protected String iconFileName_M16;
121:
122: /**
123: * <p>The 32x32 monochrome icon.</p>
124: */
125: protected String iconFileName_M32;
126:
127: /**
128: * <p>The cached property descriptors.</p>
129: */
130: protected PropertyDescriptor[] propDescriptors;
131:
132: /**
133: * <p>Return the <code>BeanDescriptor</code> for this bean.</p>
134: */
135: public BeanDescriptor getBeanDescriptor() {
136:
137: if (beanDescriptor != null) {
138: return beanDescriptor;
139: }
140:
141: beanDescriptor = new BeanDescriptor(beanClass);
142: beanDescriptor.setDisplayName(resources
143: .getString("Meta_DisplayName"));
144: beanDescriptor.setShortDescription(resources
145: .getString("Meta_Description"));
146: beanDescriptor.setExpert(false);
147: beanDescriptor.setHidden(false);
148: beanDescriptor.setPreferred(false);
149: beanDescriptor.setValue(
150: Constants.BeanDescriptor.FACET_DESCRIPTORS,
151: getFacetDescriptors());
152: beanDescriptor.setValue(Constants.BeanDescriptor.HELP_KEY,
153: "projrave_ui_elements_palette_bh_meta");
154: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
155: "meta");
156: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
157: Boolean.FALSE);
158: beanDescriptor
159: .setValue(Constants.BeanDescriptor.PROPERTIES_HELP_KEY,
160: "projrave_ui_elements_palette_bh_propsheets_bh_meta_props");
161: beanDescriptor.setValue(
162: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
163: getCategoryDescriptors());
164: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
165: "meta");
166: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
167: "ui");
168: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
169: "http://www.sun.com/web/ui");
170:
171: return beanDescriptor;
172:
173: }
174:
175: /**
176: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
177: */
178: private CategoryDescriptor[] getCategoryDescriptors() {
179:
180: return com.sun.rave.designtime.base.CategoryDescriptors
181: .getDefaultCategoryDescriptors();
182:
183: }
184:
185: /**
186: * <p>Return the index of the default property, or
187: * -1 if there is no default property.</p>
188: */
189: public int getDefaultPropertyIndex() {
190:
191: if (defaultPropertyIndex > -2) {
192: return defaultPropertyIndex;
193: } else {
194: if (defaultPropertyName == null) {
195: defaultPropertyIndex = -1;
196: } else {
197: PropertyDescriptor pd[] = getPropertyDescriptors();
198: for (int i = 0; i < pd.length; i++) {
199: if (defaultPropertyName.equals(pd[i].getName())) {
200: defaultPropertyIndex = i;
201: break;
202: }
203: }
204: }
205: }
206: return defaultPropertyIndex;
207: }
208:
209: /**
210: * <p>The cached facet descriptors.</p>
211: */
212: protected FacetDescriptor[] facetDescriptors;
213:
214: /**
215: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
216: */
217: public FacetDescriptor[] getFacetDescriptors() {
218:
219: if (facetDescriptors != null) {
220: return facetDescriptors;
221: }
222: facetDescriptors = new FacetDescriptor[] {};
223: return facetDescriptors;
224:
225: }
226:
227: /**
228: * <p>Return the specified image (if any)
229: * for this component class.</p>
230: */
231: public Image getIcon(int kind) {
232:
233: String name;
234: switch (kind) {
235: case ICON_COLOR_16x16:
236: name = iconFileName_C16;
237: break;
238: case ICON_COLOR_32x32:
239: name = iconFileName_C32;
240: break;
241: case ICON_MONO_16x16:
242: name = iconFileName_M16;
243: break;
244: case ICON_MONO_32x32:
245: name = iconFileName_M32;
246: break;
247: default:
248: name = null;
249: break;
250: }
251: if (name == null) {
252: return null;
253: }
254:
255: Image image = loadImage(name + ".png");
256: if (image == null) {
257: image = loadImage(name + ".gif");
258: }
259: return image;
260:
261: }
262:
263: /**
264: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
265: */
266: private java.lang.Class loadClass(java.lang.String name) {
267:
268: try {
269: return Class.forName(name);
270: } catch (ClassNotFoundException e) {
271: throw new RuntimeException(e);
272: }
273:
274: }
275:
276: /**
277: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
278: */
279: public PropertyDescriptor[] getPropertyDescriptors() {
280:
281: if (propDescriptors != null) {
282: return propDescriptors;
283: }
284: AttributeDescriptor attrib = null;
285:
286: try {
287:
288: PropertyDescriptor prop_content = new PropertyDescriptor(
289: "content", beanClass, "getContent", "setContent");
290: prop_content.setDisplayName(resources
291: .getString("Meta_content_DisplayName"));
292: prop_content.setShortDescription(resources
293: .getString("Meta_content_Description"));
294: prop_content.setExpert(false);
295: prop_content.setHidden(false);
296: prop_content.setPreferred(false);
297: attrib = new AttributeDescriptor("content", false, null,
298: true);
299: prop_content.setValue(
300: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
301: attrib);
302: prop_content
303: .setValue(
304: Constants.PropertyDescriptor.CATEGORY,
305: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
306:
307: PropertyDescriptor prop_httpEquiv = new PropertyDescriptor(
308: "httpEquiv", beanClass, "getHttpEquiv",
309: "setHttpEquiv");
310: prop_httpEquiv.setDisplayName(resources
311: .getString("Meta_httpEquiv_DisplayName"));
312: prop_httpEquiv.setShortDescription(resources
313: .getString("Meta_httpEquiv_Description"));
314: prop_httpEquiv.setExpert(false);
315: prop_httpEquiv.setHidden(false);
316: prop_httpEquiv.setPreferred(false);
317: attrib = new AttributeDescriptor("httpEquiv", false, null,
318: true);
319: prop_httpEquiv.setValue(
320: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
321: attrib);
322: prop_httpEquiv
323: .setValue(
324: Constants.PropertyDescriptor.CATEGORY,
325: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
326:
327: PropertyDescriptor prop_name = new PropertyDescriptor(
328: "name", beanClass, "getName", "setName");
329: prop_name.setDisplayName(resources
330: .getString("Meta_name_DisplayName"));
331: prop_name.setShortDescription(resources
332: .getString("Meta_name_Description"));
333: prop_name.setExpert(false);
334: prop_name.setHidden(false);
335: prop_name.setPreferred(false);
336: attrib = new AttributeDescriptor("name", false, null, true);
337: prop_name.setValue(
338: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
339: attrib);
340: prop_name
341: .setValue(
342: Constants.PropertyDescriptor.CATEGORY,
343: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
344:
345: PropertyDescriptor prop_scheme = new PropertyDescriptor(
346: "scheme", beanClass, "getScheme", "setScheme");
347: prop_scheme.setDisplayName(resources
348: .getString("Meta_scheme_DisplayName"));
349: prop_scheme.setShortDescription(resources
350: .getString("Meta_scheme_Description"));
351: prop_scheme.setExpert(false);
352: prop_scheme.setHidden(false);
353: prop_scheme.setPreferred(false);
354: attrib = new AttributeDescriptor("scheme", false, null,
355: true);
356: prop_scheme.setValue(
357: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
358: attrib);
359: prop_scheme
360: .setValue(
361: Constants.PropertyDescriptor.CATEGORY,
362: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
363:
364: PropertyDescriptor prop_attributes = new PropertyDescriptor(
365: "attributes", beanClass, "getAttributes", null);
366: prop_attributes.setDisplayName(resources
367: .getString("Meta_attributes_DisplayName"));
368: prop_attributes.setShortDescription(resources
369: .getString("Meta_attributes_Description"));
370: prop_attributes.setExpert(false);
371: prop_attributes.setHidden(true);
372: prop_attributes.setPreferred(false);
373: prop_attributes
374: .setValue(
375: Constants.PropertyDescriptor.CATEGORY,
376: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
377:
378: PropertyDescriptor prop_childCount = new PropertyDescriptor(
379: "childCount", beanClass, "getChildCount", null);
380: prop_childCount.setDisplayName(resources
381: .getString("Meta_childCount_DisplayName"));
382: prop_childCount.setShortDescription(resources
383: .getString("Meta_childCount_Description"));
384: prop_childCount.setExpert(false);
385: prop_childCount.setHidden(true);
386: prop_childCount.setPreferred(false);
387: prop_childCount
388: .setValue(
389: Constants.PropertyDescriptor.CATEGORY,
390: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
391:
392: PropertyDescriptor prop_children = new PropertyDescriptor(
393: "children", beanClass, "getChildren", null);
394: prop_children.setDisplayName(resources
395: .getString("Meta_children_DisplayName"));
396: prop_children.setShortDescription(resources
397: .getString("Meta_children_Description"));
398: prop_children.setExpert(false);
399: prop_children.setHidden(true);
400: prop_children.setPreferred(false);
401: prop_children
402: .setValue(
403: Constants.PropertyDescriptor.CATEGORY,
404: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
405:
406: PropertyDescriptor prop_facets = new PropertyDescriptor(
407: "facets", beanClass, "getFacets", null);
408: prop_facets.setDisplayName(resources
409: .getString("Meta_facets_DisplayName"));
410: prop_facets.setShortDescription(resources
411: .getString("Meta_facets_Description"));
412: prop_facets.setExpert(false);
413: prop_facets.setHidden(true);
414: prop_facets.setPreferred(false);
415: prop_facets
416: .setValue(
417: Constants.PropertyDescriptor.CATEGORY,
418: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
419:
420: PropertyDescriptor prop_family = new PropertyDescriptor(
421: "family", beanClass, "getFamily", null);
422: prop_family.setDisplayName(resources
423: .getString("Meta_family_DisplayName"));
424: prop_family.setShortDescription(resources
425: .getString("Meta_family_Description"));
426: prop_family.setExpert(false);
427: prop_family.setHidden(true);
428: prop_family.setPreferred(false);
429: prop_family
430: .setValue(
431: Constants.PropertyDescriptor.CATEGORY,
432: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
433:
434: PropertyDescriptor prop_id = new PropertyDescriptor("id",
435: beanClass, "getId", "setId");
436: prop_id.setDisplayName(resources
437: .getString("Meta_id_DisplayName"));
438: prop_id.setShortDescription(resources
439: .getString("Meta_id_Description"));
440: prop_id.setExpert(false);
441: prop_id.setHidden(true);
442: prop_id.setPreferred(false);
443: attrib = new AttributeDescriptor("id", false, null, false);
444: prop_id.setValue(
445: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
446: attrib);
447: prop_id
448: .setValue(
449: Constants.PropertyDescriptor.CATEGORY,
450: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
451:
452: PropertyDescriptor prop_parent = new PropertyDescriptor(
453: "parent", beanClass, "getParent", "setParent");
454: prop_parent.setDisplayName(resources
455: .getString("Meta_parent_DisplayName"));
456: prop_parent.setShortDescription(resources
457: .getString("Meta_parent_Description"));
458: prop_parent.setExpert(false);
459: prop_parent.setHidden(true);
460: prop_parent.setPreferred(false);
461: prop_parent
462: .setValue(
463: Constants.PropertyDescriptor.CATEGORY,
464: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
465:
466: PropertyDescriptor prop_rendered = new PropertyDescriptor(
467: "rendered", beanClass, "isRendered", "setRendered");
468: prop_rendered.setDisplayName(resources
469: .getString("Meta_rendered_DisplayName"));
470: prop_rendered.setShortDescription(resources
471: .getString("Meta_rendered_Description"));
472: prop_rendered.setExpert(false);
473: prop_rendered.setHidden(false);
474: prop_rendered.setPreferred(false);
475: attrib = new AttributeDescriptor("rendered", false, null,
476: true);
477: prop_rendered.setValue(
478: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
479: attrib);
480: prop_rendered
481: .setValue(
482: Constants.PropertyDescriptor.CATEGORY,
483: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
484:
485: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
486: "rendererType", beanClass, "getRendererType",
487: "setRendererType");
488: prop_rendererType.setDisplayName(resources
489: .getString("Meta_rendererType_DisplayName"));
490: prop_rendererType.setShortDescription(resources
491: .getString("Meta_rendererType_Description"));
492: prop_rendererType.setExpert(false);
493: prop_rendererType.setHidden(true);
494: prop_rendererType.setPreferred(false);
495: prop_rendererType
496: .setValue(
497: Constants.PropertyDescriptor.CATEGORY,
498: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
499:
500: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
501: "rendersChildren", beanClass, "getRendersChildren",
502: null);
503: prop_rendersChildren.setDisplayName(resources
504: .getString("Meta_rendersChildren_DisplayName"));
505: prop_rendersChildren.setShortDescription(resources
506: .getString("Meta_rendersChildren_Description"));
507: prop_rendersChildren.setExpert(false);
508: prop_rendersChildren.setHidden(true);
509: prop_rendersChildren.setPreferred(false);
510: prop_rendersChildren
511: .setValue(
512: Constants.PropertyDescriptor.CATEGORY,
513: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
514:
515: propDescriptors = new PropertyDescriptor[] {
516: prop_attributes, prop_childCount, prop_children,
517: prop_content, prop_facets, prop_family,
518: prop_httpEquiv, prop_id, prop_name, prop_parent,
519: prop_rendered, prop_rendererType,
520: prop_rendersChildren, prop_scheme, };
521: return propDescriptors;
522:
523: } catch (IntrospectionException e) {
524: e.printStackTrace();
525: return null;
526: }
527:
528: }
529:
530: }
531: //GEN-END:BeanInfo
|