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 SkipHyperlinkBeanInfoBase 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(),
071: SkipHyperlinkBeanInfoBase.class.getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>SkipHyperlinkBeanInfoBase</code>.</p>
075: */
076: public SkipHyperlinkBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.SkipHyperlink.class;
079: defaultPropertyName = "alt";
080: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/SkipHyperlink_C16";
081: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/SkipHyperlink_C32";
082: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/SkipHyperlink_M16";
083: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/SkipHyperlink_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("SkipHyperlink_DisplayName"));
144: beanDescriptor.setShortDescription(resources
145: .getString("SkipHyperlink_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.INSTANCE_NAME,
153: "skipHyperlink");
154: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
155: Boolean.TRUE);
156: beanDescriptor.setValue(
157: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
158: getCategoryDescriptors());
159: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
160: "skipHyperlink");
161: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
162: "ui");
163: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
164: "http://www.sun.com/web/ui");
165:
166: return beanDescriptor;
167:
168: }
169:
170: /**
171: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
172: */
173: private CategoryDescriptor[] getCategoryDescriptors() {
174:
175: return com.sun.rave.designtime.base.CategoryDescriptors
176: .getDefaultCategoryDescriptors();
177:
178: }
179:
180: /**
181: * <p>Return the index of the default property, or
182: * -1 if there is no default property.</p>
183: */
184: public int getDefaultPropertyIndex() {
185:
186: if (defaultPropertyIndex > -2) {
187: return defaultPropertyIndex;
188: } else {
189: if (defaultPropertyName == null) {
190: defaultPropertyIndex = -1;
191: } else {
192: PropertyDescriptor pd[] = getPropertyDescriptors();
193: for (int i = 0; i < pd.length; i++) {
194: if (defaultPropertyName.equals(pd[i].getName())) {
195: defaultPropertyIndex = i;
196: break;
197: }
198: }
199: }
200: }
201: return defaultPropertyIndex;
202: }
203:
204: /**
205: * <p>The cached facet descriptors.</p>
206: */
207: protected FacetDescriptor[] facetDescriptors;
208:
209: /**
210: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
211: */
212: public FacetDescriptor[] getFacetDescriptors() {
213:
214: if (facetDescriptors != null) {
215: return facetDescriptors;
216: }
217: facetDescriptors = new FacetDescriptor[] {};
218: return facetDescriptors;
219:
220: }
221:
222: /**
223: * <p>Return the specified image (if any)
224: * for this component class.</p>
225: */
226: public Image getIcon(int kind) {
227:
228: String name;
229: switch (kind) {
230: case ICON_COLOR_16x16:
231: name = iconFileName_C16;
232: break;
233: case ICON_COLOR_32x32:
234: name = iconFileName_C32;
235: break;
236: case ICON_MONO_16x16:
237: name = iconFileName_M16;
238: break;
239: case ICON_MONO_32x32:
240: name = iconFileName_M32;
241: break;
242: default:
243: name = null;
244: break;
245: }
246: if (name == null) {
247: return null;
248: }
249:
250: Image image = loadImage(name + ".png");
251: if (image == null) {
252: image = loadImage(name + ".gif");
253: }
254: return image;
255:
256: }
257:
258: /**
259: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
260: */
261: private java.lang.Class loadClass(java.lang.String name) {
262:
263: try {
264: return Class.forName(name);
265: } catch (ClassNotFoundException e) {
266: throw new RuntimeException(e);
267: }
268:
269: }
270:
271: /**
272: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
273: */
274: public PropertyDescriptor[] getPropertyDescriptors() {
275:
276: if (propDescriptors != null) {
277: return propDescriptors;
278: }
279: AttributeDescriptor attrib = null;
280:
281: try {
282:
283: PropertyDescriptor prop_description = new PropertyDescriptor(
284: "description", beanClass, "getDescription",
285: "setDescription");
286: prop_description
287: .setDisplayName(resources
288: .getString("SkipHyperlink_description_DisplayName"));
289: prop_description
290: .setShortDescription(resources
291: .getString("SkipHyperlink_description_Description"));
292: prop_description.setExpert(false);
293: prop_description.setHidden(false);
294: prop_description.setPreferred(false);
295: attrib = new AttributeDescriptor("description", false,
296: null, true);
297: prop_description.setValue(
298: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
299: attrib);
300: prop_description
301: .setValue(
302: Constants.PropertyDescriptor.CATEGORY,
303: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
304:
305: PropertyDescriptor prop_style = new PropertyDescriptor(
306: "style", beanClass, "getStyle", "setStyle");
307: prop_style.setDisplayName(resources
308: .getString("SkipHyperlink_style_DisplayName"));
309: prop_style.setShortDescription(resources
310: .getString("SkipHyperlink_style_Description"));
311: prop_style
312: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.css.CssStylePropertyEditor"));
313: prop_style.setExpert(false);
314: prop_style.setHidden(false);
315: prop_style.setPreferred(false);
316: attrib = new AttributeDescriptor("style", false, null, true);
317: prop_style.setValue(
318: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
319: attrib);
320: prop_style
321: .setValue(
322: Constants.PropertyDescriptor.CATEGORY,
323: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
324:
325: PropertyDescriptor prop_styleClass = new PropertyDescriptor(
326: "styleClass", beanClass, "getStyleClass",
327: "setStyleClass");
328: prop_styleClass.setDisplayName(resources
329: .getString("SkipHyperlink_styleClass_DisplayName"));
330: prop_styleClass.setShortDescription(resources
331: .getString("SkipHyperlink_styleClass_Description"));
332: prop_styleClass
333: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StyleClassPropertyEditor"));
334: prop_styleClass.setExpert(false);
335: prop_styleClass.setHidden(false);
336: prop_styleClass.setPreferred(false);
337: attrib = new AttributeDescriptor("styleClass", false, null,
338: true);
339: prop_styleClass.setValue(
340: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
341: attrib);
342: prop_styleClass
343: .setValue(
344: Constants.PropertyDescriptor.CATEGORY,
345: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
346:
347: PropertyDescriptor prop_tabIndex = new PropertyDescriptor(
348: "tabIndex", beanClass, "getTabIndex", "setTabIndex");
349: prop_tabIndex.setDisplayName(resources
350: .getString("SkipHyperlink_tabIndex_DisplayName"));
351: prop_tabIndex.setShortDescription(resources
352: .getString("SkipHyperlink_tabIndex_Description"));
353: prop_tabIndex
354: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.IntegerPropertyEditor"));
355: prop_tabIndex.setExpert(false);
356: prop_tabIndex.setHidden(false);
357: prop_tabIndex.setPreferred(false);
358: attrib = new AttributeDescriptor("tabIndex", false, null,
359: true);
360: prop_tabIndex.setValue(
361: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
362: attrib);
363: prop_tabIndex
364: .setValue(
365: Constants.PropertyDescriptor.CATEGORY,
366: com.sun.rave.designtime.base.CategoryDescriptors.ACCESSIBILITY);
367: prop_tabIndex.setValue(
368: "com.sun.rave.propertyeditors.MIN_VALUE", "1");
369:
370: PropertyDescriptor prop_action = new PropertyDescriptor(
371: "action", beanClass, "getAction", "setAction");
372: prop_action.setDisplayName(resources
373: .getString("SkipHyperlink_action_DisplayName"));
374: prop_action.setShortDescription(resources
375: .getString("SkipHyperlink_action_Description"));
376: prop_action
377: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.MethodBindingPropertyEditor"));
378: prop_action.setExpert(false);
379: prop_action.setHidden(true);
380: prop_action.setPreferred(false);
381: prop_action
382: .setValue(
383: Constants.PropertyDescriptor.CATEGORY,
384: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
385:
386: PropertyDescriptor prop_actionListener = new PropertyDescriptor(
387: "actionListener", beanClass, "getActionListener",
388: "setActionListener");
389: prop_actionListener
390: .setDisplayName(resources
391: .getString("SkipHyperlink_actionListener_DisplayName"));
392: prop_actionListener
393: .setShortDescription(resources
394: .getString("SkipHyperlink_actionListener_Description"));
395: prop_actionListener
396: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.MethodBindingPropertyEditor"));
397: prop_actionListener.setExpert(false);
398: prop_actionListener.setHidden(true);
399: prop_actionListener.setPreferred(false);
400: prop_actionListener
401: .setValue(
402: Constants.PropertyDescriptor.CATEGORY,
403: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
404:
405: PropertyDescriptor prop_attributes = new PropertyDescriptor(
406: "attributes", beanClass, "getAttributes", null);
407: prop_attributes.setDisplayName(resources
408: .getString("SkipHyperlink_attributes_DisplayName"));
409: prop_attributes.setShortDescription(resources
410: .getString("SkipHyperlink_attributes_Description"));
411: prop_attributes.setExpert(false);
412: prop_attributes.setHidden(true);
413: prop_attributes.setPreferred(false);
414: prop_attributes
415: .setValue(
416: Constants.PropertyDescriptor.CATEGORY,
417: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
418:
419: PropertyDescriptor prop_childCount = new PropertyDescriptor(
420: "childCount", beanClass, "getChildCount", null);
421: prop_childCount.setDisplayName(resources
422: .getString("SkipHyperlink_childCount_DisplayName"));
423: prop_childCount.setShortDescription(resources
424: .getString("SkipHyperlink_childCount_Description"));
425: prop_childCount.setExpert(false);
426: prop_childCount.setHidden(true);
427: prop_childCount.setPreferred(false);
428: prop_childCount
429: .setValue(
430: Constants.PropertyDescriptor.CATEGORY,
431: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
432:
433: PropertyDescriptor prop_children = new PropertyDescriptor(
434: "children", beanClass, "getChildren", null);
435: prop_children.setDisplayName(resources
436: .getString("SkipHyperlink_children_DisplayName"));
437: prop_children.setShortDescription(resources
438: .getString("SkipHyperlink_children_Description"));
439: prop_children.setExpert(false);
440: prop_children.setHidden(true);
441: prop_children.setPreferred(false);
442: prop_children
443: .setValue(
444: Constants.PropertyDescriptor.CATEGORY,
445: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
446:
447: PropertyDescriptor prop_facets = new PropertyDescriptor(
448: "facets", beanClass, "getFacets", null);
449: prop_facets.setDisplayName(resources
450: .getString("SkipHyperlink_facets_DisplayName"));
451: prop_facets.setShortDescription(resources
452: .getString("SkipHyperlink_facets_Description"));
453: prop_facets.setExpert(false);
454: prop_facets.setHidden(true);
455: prop_facets.setPreferred(false);
456: prop_facets
457: .setValue(
458: Constants.PropertyDescriptor.CATEGORY,
459: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
460:
461: PropertyDescriptor prop_family = new PropertyDescriptor(
462: "family", beanClass, "getFamily", null);
463: prop_family.setDisplayName(resources
464: .getString("SkipHyperlink_family_DisplayName"));
465: prop_family.setShortDescription(resources
466: .getString("SkipHyperlink_family_Description"));
467: prop_family.setExpert(false);
468: prop_family.setHidden(true);
469: prop_family.setPreferred(false);
470: prop_family
471: .setValue(
472: Constants.PropertyDescriptor.CATEGORY,
473: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
474:
475: PropertyDescriptor prop_id = new PropertyDescriptor("id",
476: beanClass, "getId", "setId");
477: prop_id.setDisplayName(resources
478: .getString("SkipHyperlink_id_DisplayName"));
479: prop_id.setShortDescription(resources
480: .getString("SkipHyperlink_id_Description"));
481: prop_id.setExpert(false);
482: prop_id.setHidden(true);
483: prop_id.setPreferred(false);
484: attrib = new AttributeDescriptor("id", false, null, true);
485: prop_id.setValue(
486: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
487: attrib);
488: prop_id
489: .setValue(
490: Constants.PropertyDescriptor.CATEGORY,
491: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
492:
493: PropertyDescriptor prop_immediate = new PropertyDescriptor(
494: "immediate", beanClass, "isImmediate",
495: "setImmediate");
496: prop_immediate.setDisplayName(resources
497: .getString("SkipHyperlink_immediate_DisplayName"));
498: prop_immediate.setShortDescription(resources
499: .getString("SkipHyperlink_immediate_Description"));
500: prop_immediate.setExpert(false);
501: prop_immediate.setHidden(true);
502: prop_immediate.setPreferred(false);
503: prop_immediate
504: .setValue(
505: Constants.PropertyDescriptor.CATEGORY,
506: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
507:
508: PropertyDescriptor prop_parent = new PropertyDescriptor(
509: "parent", beanClass, "getParent", null);
510: prop_parent.setDisplayName(resources
511: .getString("SkipHyperlink_parent_DisplayName"));
512: prop_parent.setShortDescription(resources
513: .getString("SkipHyperlink_parent_Description"));
514: prop_parent.setExpert(false);
515: prop_parent.setHidden(true);
516: prop_parent.setPreferred(false);
517: prop_parent
518: .setValue(
519: Constants.PropertyDescriptor.CATEGORY,
520: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
521:
522: PropertyDescriptor prop_rendered = new PropertyDescriptor(
523: "rendered", beanClass, "isRendered", "setRendered");
524: prop_rendered.setDisplayName(resources
525: .getString("SkipHyperlink_rendered_DisplayName"));
526: prop_rendered.setShortDescription(resources
527: .getString("SkipHyperlink_rendered_Description"));
528: prop_rendered.setExpert(false);
529: prop_rendered.setHidden(false);
530: prop_rendered.setPreferred(false);
531: attrib = new AttributeDescriptor("rendered", false, null,
532: true);
533: prop_rendered.setValue(
534: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
535: attrib);
536: prop_rendered
537: .setValue(
538: Constants.PropertyDescriptor.CATEGORY,
539: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
540:
541: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
542: "rendererType", beanClass, "getRendererType",
543: "setRendererType");
544: prop_rendererType
545: .setDisplayName(resources
546: .getString("SkipHyperlink_rendererType_DisplayName"));
547: prop_rendererType
548: .setShortDescription(resources
549: .getString("SkipHyperlink_rendererType_Description"));
550: prop_rendererType.setExpert(false);
551: prop_rendererType.setHidden(true);
552: prop_rendererType.setPreferred(false);
553: prop_rendererType
554: .setValue(
555: Constants.PropertyDescriptor.CATEGORY,
556: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
557:
558: PropertyDescriptor prop_rendersChildren = new PropertyDescriptor(
559: "rendersChildren", beanClass, "getRendersChildren",
560: null);
561: prop_rendersChildren
562: .setDisplayName(resources
563: .getString("SkipHyperlink_rendersChildren_DisplayName"));
564: prop_rendersChildren
565: .setShortDescription(resources
566: .getString("SkipHyperlink_rendersChildren_Description"));
567: prop_rendersChildren.setExpert(false);
568: prop_rendersChildren.setHidden(true);
569: prop_rendersChildren.setPreferred(false);
570: prop_rendersChildren
571: .setValue(
572: Constants.PropertyDescriptor.CATEGORY,
573: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
574:
575: PropertyDescriptor prop_value = new PropertyDescriptor(
576: "value", beanClass, "getValue", "setValue");
577: prop_value.setDisplayName(resources
578: .getString("SkipHyperlink_value_DisplayName"));
579: prop_value.setShortDescription(resources
580: .getString("SkipHyperlink_value_Description"));
581: prop_value
582: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.binding.ValueBindingPropertyEditor"));
583: prop_value.setExpert(false);
584: prop_value.setHidden(true);
585: prop_value.setPreferred(false);
586: prop_value
587: .setValue(
588: Constants.PropertyDescriptor.CATEGORY,
589: com.sun.rave.designtime.base.CategoryDescriptors.DATA);
590: prop_value.setValue("ignoreIsBound", "true");
591:
592: propDescriptors = new PropertyDescriptor[] { prop_action,
593: prop_actionListener, prop_attributes,
594: prop_childCount, prop_children, prop_description,
595: prop_facets, prop_family, prop_id, prop_immediate,
596: prop_parent, prop_rendered, prop_rendererType,
597: prop_rendersChildren, prop_style, prop_styleClass,
598: prop_tabIndex, prop_value, };
599: return propDescriptors;
600:
601: } catch (IntrospectionException e) {
602: e.printStackTrace();
603: return null;
604: }
605:
606: }
607:
608: }
609: //GEN-END:BeanInfo
|