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 ThemeLinksBeanInfoBase 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(), ThemeLinksBeanInfoBase.class
071: .getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>ThemeLinksBeanInfoBase</code>.</p>
075: */
076: public ThemeLinksBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.ThemeLinks.class;
079: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/ThemeLinks_C16";
080: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/ThemeLinks_C32";
081: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/ThemeLinks_M16";
082: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/ThemeLinks_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("ThemeLinks_DisplayName"));
143: beanDescriptor.setShortDescription(resources
144: .getString("ThemeLinks_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.INSTANCE_NAME,
152: "themeLinks");
153: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
154: Boolean.FALSE);
155: beanDescriptor.setValue(
156: Constants.BeanDescriptor.MARKUP_SECTION, "body");
157: beanDescriptor.setValue(
158: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
159: getCategoryDescriptors());
160: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
161: "themeLinks");
162: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
163: "ui");
164: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
165: "http://www.sun.com/web/ui");
166:
167: return beanDescriptor;
168:
169: }
170:
171: /**
172: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
173: */
174: private CategoryDescriptor[] getCategoryDescriptors() {
175:
176: return com.sun.rave.designtime.base.CategoryDescriptors
177: .getDefaultCategoryDescriptors();
178:
179: }
180:
181: /**
182: * <p>Return the index of the default property, or
183: * -1 if there is no default property.</p>
184: */
185: public int getDefaultPropertyIndex() {
186:
187: if (defaultPropertyIndex > -2) {
188: return defaultPropertyIndex;
189: } else {
190: if (defaultPropertyName == null) {
191: defaultPropertyIndex = -1;
192: } else {
193: PropertyDescriptor pd[] = getPropertyDescriptors();
194: for (int i = 0; i < pd.length; i++) {
195: if (defaultPropertyName.equals(pd[i].getName())) {
196: defaultPropertyIndex = i;
197: break;
198: }
199: }
200: }
201: }
202: return defaultPropertyIndex;
203: }
204:
205: /**
206: * <p>The cached facet descriptors.</p>
207: */
208: protected FacetDescriptor[] facetDescriptors;
209:
210: /**
211: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
212: */
213: public FacetDescriptor[] getFacetDescriptors() {
214:
215: if (facetDescriptors != null) {
216: return facetDescriptors;
217: }
218: facetDescriptors = new FacetDescriptor[] {};
219: return facetDescriptors;
220:
221: }
222:
223: /**
224: * <p>Return the specified image (if any)
225: * for this component class.</p>
226: */
227: public Image getIcon(int kind) {
228:
229: String name;
230: switch (kind) {
231: case ICON_COLOR_16x16:
232: name = iconFileName_C16;
233: break;
234: case ICON_COLOR_32x32:
235: name = iconFileName_C32;
236: break;
237: case ICON_MONO_16x16:
238: name = iconFileName_M16;
239: break;
240: case ICON_MONO_32x32:
241: name = iconFileName_M32;
242: break;
243: default:
244: name = null;
245: break;
246: }
247: if (name == null) {
248: return null;
249: }
250:
251: Image image = loadImage(name + ".png");
252: if (image == null) {
253: image = loadImage(name + ".gif");
254: }
255: return image;
256:
257: }
258:
259: /**
260: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
261: */
262: private java.lang.Class loadClass(java.lang.String name) {
263:
264: try {
265: return Class.forName(name);
266: } catch (ClassNotFoundException e) {
267: throw new RuntimeException(e);
268: }
269:
270: }
271:
272: /**
273: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
274: */
275: public PropertyDescriptor[] getPropertyDescriptors() {
276:
277: if (propDescriptors != null) {
278: return propDescriptors;
279: }
280: AttributeDescriptor attrib = null;
281:
282: try {
283:
284: PropertyDescriptor prop_javaScript = new PropertyDescriptor(
285: "javaScript", beanClass, "isJavaScript",
286: "setJavaScript");
287: prop_javaScript.setDisplayName(resources
288: .getString("ThemeLinks_javaScript_DisplayName"));
289: prop_javaScript.setShortDescription(resources
290: .getString("ThemeLinks_javaScript_Description"));
291: prop_javaScript.setExpert(false);
292: prop_javaScript.setHidden(false);
293: prop_javaScript.setPreferred(false);
294: attrib = new AttributeDescriptor("javaScript", false,
295: "true", true);
296: prop_javaScript.setValue(
297: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
298: attrib);
299: prop_javaScript
300: .setValue(
301: Constants.PropertyDescriptor.CATEGORY,
302: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
303:
304: PropertyDescriptor prop_styleSheet = new PropertyDescriptor(
305: "styleSheet", beanClass, "isStyleSheet",
306: "setStyleSheet");
307: prop_styleSheet.setDisplayName(resources
308: .getString("ThemeLinks_styleSheet_DisplayName"));
309: prop_styleSheet.setShortDescription(resources
310: .getString("ThemeLinks_styleSheet_Description"));
311: prop_styleSheet.setExpert(false);
312: prop_styleSheet.setHidden(false);
313: prop_styleSheet.setPreferred(false);
314: attrib = new AttributeDescriptor("styleSheet", false,
315: "true", true);
316: prop_styleSheet.setValue(
317: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
318: attrib);
319: prop_styleSheet
320: .setValue(
321: Constants.PropertyDescriptor.CATEGORY,
322: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
323:
324: PropertyDescriptor prop_styleSheetInline = new PropertyDescriptor(
325: "styleSheetInline", beanClass,
326: "isStyleSheetInline", "setStyleSheetInline");
327: prop_styleSheetInline
328: .setDisplayName(resources
329: .getString("ThemeLinks_styleSheetInline_DisplayName"));
330: prop_styleSheetInline
331: .setShortDescription(resources
332: .getString("ThemeLinks_styleSheetInline_Description"));
333: prop_styleSheetInline.setExpert(false);
334: prop_styleSheetInline.setHidden(false);
335: prop_styleSheetInline.setPreferred(false);
336: attrib = new AttributeDescriptor("styleSheetInline", false,
337: null, true);
338: prop_styleSheetInline.setValue(
339: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
340: attrib);
341: prop_styleSheetInline
342: .setValue(
343: Constants.PropertyDescriptor.CATEGORY,
344: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
345:
346: PropertyDescriptor prop_attributes = new PropertyDescriptor(
347: "attributes", beanClass, "getAttributes", null);
348: prop_attributes.setDisplayName(resources
349: .getString("ThemeLinks_attributes_DisplayName"));
350: prop_attributes.setShortDescription(resources
351: .getString("ThemeLinks_attributes_Description"));
352: prop_attributes.setExpert(false);
353: prop_attributes.setHidden(true);
354: prop_attributes.setPreferred(false);
355: prop_attributes
356: .setValue(
357: Constants.PropertyDescriptor.CATEGORY,
358: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
359:
360: PropertyDescriptor prop_childCount = new PropertyDescriptor(
361: "childCount", beanClass, "getChildCount", null);
362: prop_childCount.setDisplayName(resources
363: .getString("ThemeLinks_childCount_DisplayName"));
364: prop_childCount.setShortDescription(resources
365: .getString("ThemeLinks_childCount_Description"));
366: prop_childCount.setExpert(false);
367: prop_childCount.setHidden(true);
368: prop_childCount.setPreferred(false);
369: prop_childCount
370: .setValue(
371: Constants.PropertyDescriptor.CATEGORY,
372: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
373:
374: PropertyDescriptor prop_children = new PropertyDescriptor(
375: "children", beanClass, "getChildren", null);
376: prop_children.setDisplayName(resources
377: .getString("ThemeLinks_children_DisplayName"));
378: prop_children.setShortDescription(resources
379: .getString("ThemeLinks_children_Description"));
380: prop_children.setExpert(false);
381: prop_children.setHidden(true);
382: prop_children.setPreferred(false);
383: prop_children
384: .setValue(
385: Constants.PropertyDescriptor.CATEGORY,
386: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
387:
388: PropertyDescriptor prop_facets = new PropertyDescriptor(
389: "facets", beanClass, "getFacets", null);
390: prop_facets.setDisplayName(resources
391: .getString("ThemeLinks_facets_DisplayName"));
392: prop_facets.setShortDescription(resources
393: .getString("ThemeLinks_facets_Description"));
394: prop_facets.setExpert(false);
395: prop_facets.setHidden(true);
396: prop_facets.setPreferred(false);
397: prop_facets
398: .setValue(
399: Constants.PropertyDescriptor.CATEGORY,
400: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
401:
402: PropertyDescriptor prop_family = new PropertyDescriptor(
403: "family", beanClass, "getFamily", null);
404: prop_family.setDisplayName(resources
405: .getString("ThemeLinks_family_DisplayName"));
406: prop_family.setShortDescription(resources
407: .getString("ThemeLinks_family_Description"));
408: prop_family.setExpert(false);
409: prop_family.setHidden(true);
410: prop_family.setPreferred(false);
411: prop_family
412: .setValue(
413: Constants.PropertyDescriptor.CATEGORY,
414: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
415:
416: PropertyDescriptor prop_id = new PropertyDescriptor("id",
417: beanClass, "getId", "setId");
418: prop_id.setDisplayName(resources
419: .getString("ThemeLinks_id_DisplayName"));
420: prop_id.setShortDescription(resources
421: .getString("ThemeLinks_id_Description"));
422: prop_id.setExpert(false);
423: prop_id.setHidden(true);
424: prop_id.setPreferred(false);
425: attrib = new AttributeDescriptor("id", false, null, false);
426: prop_id.setValue(
427: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
428: attrib);
429: prop_id
430: .setValue(
431: Constants.PropertyDescriptor.CATEGORY,
432: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
433:
434: PropertyDescriptor prop_parent = new PropertyDescriptor(
435: "parent", beanClass, "getParent", "setParent");
436: prop_parent.setDisplayName(resources
437: .getString("ThemeLinks_parent_DisplayName"));
438: prop_parent.setShortDescription(resources
439: .getString("ThemeLinks_parent_Description"));
440: prop_parent.setExpert(false);
441: prop_parent.setHidden(true);
442: prop_parent.setPreferred(false);
443: prop_parent
444: .setValue(
445: Constants.PropertyDescriptor.CATEGORY,
446: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
447:
448: PropertyDescriptor prop_rendered = new PropertyDescriptor(
449: "rendered", beanClass, "isRendered", "setRendered");
450: prop_rendered.setDisplayName(resources
451: .getString("ThemeLinks_rendered_DisplayName"));
452: prop_rendered.setShortDescription(resources
453: .getString("ThemeLinks_rendered_Description"));
454: prop_rendered.setExpert(false);
455: prop_rendered.setHidden(false);
456: prop_rendered.setPreferred(false);
457: attrib = new AttributeDescriptor("rendered", false, null,
458: true);
459: prop_rendered.setValue(
460: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
461: attrib);
462: prop_rendered
463: .setValue(
464: Constants.PropertyDescriptor.CATEGORY,
465: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
466:
467: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
468: "rendererType", beanClass, "getRendererType",
469: "setRendererType");
470: prop_rendererType.setDisplayName(resources
471: .getString("ThemeLinks_rendererType_DisplayName"));
472: prop_rendererType.setShortDescription(resources
473: .getString("ThemeLinks_rendererType_Description"));
474: prop_rendererType.setExpert(false);
475: prop_rendererType.setHidden(true);
476: prop_rendererType.setPreferred(false);
477: prop_rendererType
478: .setValue(
479: Constants.PropertyDescriptor.CATEGORY,
480: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
481:
482: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
483: "rendersChildren", beanClass, "getRendersChildren",
484: null);
485: prop_rendersChildren
486: .setDisplayName(resources
487: .getString("ThemeLinks_rendersChildren_DisplayName"));
488: prop_rendersChildren
489: .setShortDescription(resources
490: .getString("ThemeLinks_rendersChildren_Description"));
491: prop_rendersChildren.setExpert(false);
492: prop_rendersChildren.setHidden(true);
493: prop_rendersChildren.setPreferred(false);
494: prop_rendersChildren
495: .setValue(
496: Constants.PropertyDescriptor.CATEGORY,
497: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
498:
499: propDescriptors = new PropertyDescriptor[] {
500: prop_attributes, prop_childCount, prop_children,
501: prop_facets, prop_family, prop_id, prop_javaScript,
502: prop_parent, prop_rendered, prop_rendererType,
503: prop_rendersChildren, prop_styleSheet,
504: prop_styleSheetInline, };
505: return propDescriptors;
506:
507: } catch (IntrospectionException e) {
508: e.printStackTrace();
509: return null;
510: }
511:
512: }
513:
514: }
515: //GEN-END:BeanInfo
|