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 PageSeparatorBeanInfoBase 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: PageSeparatorBeanInfoBase.class.getClassLoader());
072:
073: /**
074: * <p>Construct a new <code>PageSeparatorBeanInfoBase</code>.</p>
075: */
076: public PageSeparatorBeanInfoBase() {
077:
078: beanClass = com.sun.rave.web.ui.component.PageSeparator.class;
079: iconFileName_C16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PageSeparator_C16";
080: iconFileName_C32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PageSeparator_C32";
081: iconFileName_M16 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PageSeparator_M16";
082: iconFileName_M32 = "/org/netbeans/modules/visualweb/web/ui/dt/component/PageSeparator_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("PageSeparator_DisplayName"));
143: beanDescriptor.setShortDescription(resources
144: .getString("PageSeparator_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_page_separator");
153: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
154: "pageSeparator");
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_page_separator_props");
160: beanDescriptor.setValue(
161: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
162: getCategoryDescriptors());
163: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
164: "pageSeparator");
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_style = new PropertyDescriptor(
288: "style", beanClass, "getStyle", "setStyle");
289: prop_style.setDisplayName(resources
290: .getString("PageSeparator_style_DisplayName"));
291: prop_style.setShortDescription(resources
292: .getString("PageSeparator_style_Description"));
293: prop_style
294: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.css.CssStylePropertyEditor"));
295: prop_style.setExpert(false);
296: prop_style.setHidden(false);
297: prop_style.setPreferred(false);
298: attrib = new AttributeDescriptor("style", false, null, true);
299: prop_style.setValue(
300: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
301: attrib);
302: prop_style
303: .setValue(
304: Constants.PropertyDescriptor.CATEGORY,
305: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
306:
307: PropertyDescriptor prop_styleClass = new PropertyDescriptor(
308: "styleClass", beanClass, "getStyleClass",
309: "setStyleClass");
310: prop_styleClass.setDisplayName(resources
311: .getString("PageSeparator_styleClass_DisplayName"));
312: prop_styleClass.setShortDescription(resources
313: .getString("PageSeparator_styleClass_Description"));
314: prop_styleClass
315: .setPropertyEditorClass(loadClass("com.sun.rave.propertyeditors.StyleClassPropertyEditor"));
316: prop_styleClass.setExpert(false);
317: prop_styleClass.setHidden(false);
318: prop_styleClass.setPreferred(false);
319: attrib = new AttributeDescriptor("styleClass", false, null,
320: true);
321: prop_styleClass.setValue(
322: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
323: attrib);
324: prop_styleClass
325: .setValue(
326: Constants.PropertyDescriptor.CATEGORY,
327: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
328:
329: PropertyDescriptor prop_value = new PropertyDescriptor(
330: "value", beanClass, "getValue", "setValue");
331: prop_value.setDisplayName(resources
332: .getString("PageSeparator_value_DisplayName"));
333: prop_value.setShortDescription(resources
334: .getString("PageSeparator_value_Description"));
335: prop_value.setExpert(false);
336: prop_value.setHidden(true);
337: prop_value.setPreferred(false);
338: prop_value
339: .setValue(
340: Constants.PropertyDescriptor.CATEGORY,
341: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
342:
343: PropertyDescriptor prop_visible = new PropertyDescriptor(
344: "visible", beanClass, "isVisible", "setVisible");
345: prop_visible.setDisplayName(resources
346: .getString("PageSeparator_visible_DisplayName"));
347: prop_visible.setShortDescription(resources
348: .getString("PageSeparator_visible_Description"));
349: prop_visible.setExpert(false);
350: prop_visible.setHidden(false);
351: prop_visible.setPreferred(false);
352: attrib = new AttributeDescriptor("visible", false, "true",
353: true);
354: prop_visible.setValue(
355: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
356: attrib);
357: prop_visible
358: .setValue(
359: Constants.PropertyDescriptor.CATEGORY,
360: com.sun.rave.designtime.base.CategoryDescriptors.BEHAVIOR);
361:
362: PropertyDescriptor prop_attributes = new PropertyDescriptor(
363: "attributes", beanClass, "getAttributes", null);
364: prop_attributes.setDisplayName(resources
365: .getString("PageSeparator_attributes_DisplayName"));
366: prop_attributes.setShortDescription(resources
367: .getString("PageSeparator_attributes_Description"));
368: prop_attributes.setExpert(false);
369: prop_attributes.setHidden(true);
370: prop_attributes.setPreferred(false);
371: prop_attributes
372: .setValue(
373: Constants.PropertyDescriptor.CATEGORY,
374: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
375:
376: PropertyDescriptor prop_childCount = new PropertyDescriptor(
377: "childCount", beanClass, "getChildCount", null);
378: prop_childCount.setDisplayName(resources
379: .getString("PageSeparator_childCount_DisplayName"));
380: prop_childCount.setShortDescription(resources
381: .getString("PageSeparator_childCount_Description"));
382: prop_childCount.setExpert(false);
383: prop_childCount.setHidden(true);
384: prop_childCount.setPreferred(false);
385: prop_childCount
386: .setValue(
387: Constants.PropertyDescriptor.CATEGORY,
388: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
389:
390: PropertyDescriptor prop_children = new PropertyDescriptor(
391: "children", beanClass, "getChildren", null);
392: prop_children.setDisplayName(resources
393: .getString("PageSeparator_children_DisplayName"));
394: prop_children.setShortDescription(resources
395: .getString("PageSeparator_children_Description"));
396: prop_children.setExpert(false);
397: prop_children.setHidden(true);
398: prop_children.setPreferred(false);
399: prop_children
400: .setValue(
401: Constants.PropertyDescriptor.CATEGORY,
402: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
403:
404: PropertyDescriptor prop_facets = new PropertyDescriptor(
405: "facets", beanClass, "getFacets", null);
406: prop_facets.setDisplayName(resources
407: .getString("PageSeparator_facets_DisplayName"));
408: prop_facets.setShortDescription(resources
409: .getString("PageSeparator_facets_Description"));
410: prop_facets.setExpert(false);
411: prop_facets.setHidden(true);
412: prop_facets.setPreferred(false);
413: prop_facets
414: .setValue(
415: Constants.PropertyDescriptor.CATEGORY,
416: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
417:
418: PropertyDescriptor prop_family = new PropertyDescriptor(
419: "family", beanClass, "getFamily", null);
420: prop_family.setDisplayName(resources
421: .getString("PageSeparator_family_DisplayName"));
422: prop_family.setShortDescription(resources
423: .getString("PageSeparator_family_Description"));
424: prop_family.setExpert(false);
425: prop_family.setHidden(true);
426: prop_family.setPreferred(false);
427: prop_family
428: .setValue(
429: Constants.PropertyDescriptor.CATEGORY,
430: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
431:
432: PropertyDescriptor prop_id = new PropertyDescriptor("id",
433: beanClass, "getId", "setId");
434: prop_id.setDisplayName(resources
435: .getString("PageSeparator_id_DisplayName"));
436: prop_id.setShortDescription(resources
437: .getString("PageSeparator_id_Description"));
438: prop_id.setExpert(false);
439: prop_id.setHidden(true);
440: prop_id.setPreferred(false);
441: attrib = new AttributeDescriptor("id", false, null, false);
442: prop_id.setValue(
443: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
444: attrib);
445: prop_id
446: .setValue(
447: Constants.PropertyDescriptor.CATEGORY,
448: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
449:
450: PropertyDescriptor prop_parent = new PropertyDescriptor(
451: "parent", beanClass, "getParent", "setParent");
452: prop_parent.setDisplayName(resources
453: .getString("PageSeparator_parent_DisplayName"));
454: prop_parent.setShortDescription(resources
455: .getString("PageSeparator_parent_Description"));
456: prop_parent.setExpert(false);
457: prop_parent.setHidden(true);
458: prop_parent.setPreferred(false);
459: prop_parent
460: .setValue(
461: Constants.PropertyDescriptor.CATEGORY,
462: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
463:
464: PropertyDescriptor prop_rendered = new PropertyDescriptor(
465: "rendered", beanClass, "isRendered", "setRendered");
466: prop_rendered.setDisplayName(resources
467: .getString("PageSeparator_rendered_DisplayName"));
468: prop_rendered.setShortDescription(resources
469: .getString("PageSeparator_rendered_Description"));
470: prop_rendered.setExpert(false);
471: prop_rendered.setHidden(false);
472: prop_rendered.setPreferred(false);
473: attrib = new AttributeDescriptor("rendered", false, null,
474: true);
475: prop_rendered.setValue(
476: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
477: attrib);
478: prop_rendered
479: .setValue(
480: Constants.PropertyDescriptor.CATEGORY,
481: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
482:
483: PropertyDescriptor prop_rendererType = new PropertyDescriptor(
484: "rendererType", beanClass, "getRendererType",
485: "setRendererType");
486: prop_rendererType
487: .setDisplayName(resources
488: .getString("PageSeparator_rendererType_DisplayName"));
489: prop_rendererType
490: .setShortDescription(resources
491: .getString("PageSeparator_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
504: .setDisplayName(resources
505: .getString("PageSeparator_rendersChildren_DisplayName"));
506: prop_rendersChildren
507: .setShortDescription(resources
508: .getString("PageSeparator_rendersChildren_Description"));
509: prop_rendersChildren.setExpert(false);
510: prop_rendersChildren.setHidden(true);
511: prop_rendersChildren.setPreferred(false);
512: prop_rendersChildren
513: .setValue(
514: Constants.PropertyDescriptor.CATEGORY,
515: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
516:
517: propDescriptors = new PropertyDescriptor[] {
518: prop_attributes, prop_childCount, prop_children,
519: prop_facets, prop_family, prop_id, prop_parent,
520: prop_rendered, prop_rendererType,
521: prop_rendersChildren, prop_style, prop_styleClass,
522: prop_value, prop_visible, };
523: return propDescriptors;
524:
525: } catch (IntrospectionException e) {
526: e.printStackTrace();
527: return null;
528: }
529:
530: }
531:
532: }
533: //GEN-END:BeanInfo
|