001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.visualweb.faces.dt_1_2.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.List;
051: import java.util.ArrayList;
052: import java.util.Arrays;
053: import java.util.ResourceBundle;
054:
055: import com.sun.rave.designtime.CategoryDescriptor;
056: import com.sun.rave.designtime.Constants;
057: import com.sun.rave.designtime.faces.FacetDescriptor;
058: import com.sun.rave.designtime.markup.AttributeDescriptor;
059:
060: import org.netbeans.modules.visualweb.faces.dt.HtmlBeanInfoBase;
061: import org.netbeans.modules.visualweb.faces.dt.BeanDescriptorBase;
062: import org.netbeans.modules.visualweb.faces.dt.PropertyDescriptorBase;
063:
064: /**
065: * <p>Auto-generated design time metadata class.
066: * Do <strong>NOT</strong> modify; all changes
067: * <strong>will</strong> be lost!</p>
068: */
069:
070: abstract class UIPanelBeanInfoBase extends HtmlBeanInfoBase {
071:
072: protected static ResourceBundle resources = ResourceBundle
073: .getBundle(
074: "org.netbeans.modules.visualweb.faces.dt_1_2.component.Bundle-JSF",
075: Locale.getDefault(), UIPanelBeanInfoBase.class
076: .getClassLoader());
077:
078: /**
079: * <p>Construct a new <code>UIPanelBeanInfoBase</code>.</p>
080: */
081: public UIPanelBeanInfoBase() {
082:
083: beanClass = javax.faces.component.UIPanel.class;
084: iconFileName_C16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UIPanel_C16";
085: iconFileName_C32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UIPanel_C32";
086: iconFileName_M16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UIPanel_M16";
087: iconFileName_M32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/UIPanel_M32";
088:
089: }
090:
091: private BeanDescriptor beanDescriptor;
092:
093: /**
094: * <p>Return the <code>BeanDescriptor</code> for this bean.</p>
095: */
096: public BeanDescriptor getBeanDescriptor() {
097:
098: if (beanDescriptor != null) {
099: return beanDescriptor;
100: }
101:
102: beanDescriptor = new BeanDescriptorBase(beanClass);
103: beanDescriptor.setDisplayName(resources
104: .getString("UIPanel_DisplayName"));
105: beanDescriptor.setShortDescription(resources
106: .getString("UIPanel_Description"));
107: beanDescriptor.setExpert(false);
108: beanDescriptor.setHidden(false);
109: beanDescriptor.setPreferred(false);
110: beanDescriptor.setValue(
111: Constants.BeanDescriptor.FACET_DESCRIPTORS,
112: getFacetDescriptors());
113: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
114: "panel");
115: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
116: Boolean.TRUE);
117: beanDescriptor.setValue(
118: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
119: getCategoryDescriptors());
120: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
121: "panel");
122:
123: return beanDescriptor;
124:
125: }
126:
127: /**
128: * <p>Return the <code>CategoryDescriptor</code> array for the property categories of this component.</p>
129: */
130: private CategoryDescriptor[] getCategoryDescriptors() {
131:
132: return com.sun.rave.designtime.base.CategoryDescriptors
133: .getDefaultCategoryDescriptors();
134:
135: }
136:
137: /**
138: * <p>The cached facet descriptors.</p>
139: */
140: protected FacetDescriptor[] facetDescriptors;
141:
142: /**
143: * <p>Return the <code>FacetDescriptor</code>s for this bean.</p>
144: */
145: public FacetDescriptor[] getFacetDescriptors() {
146:
147: if (facetDescriptors != null) {
148: return facetDescriptors;
149: }
150: facetDescriptors = new FacetDescriptor[] {};
151: return facetDescriptors;
152:
153: }
154:
155: /**
156: * <p>Return a class loaded by name via the class loader that loaded this class.</p>
157: */
158:
159: private PropertyDescriptor[] propertyDescriptors;
160:
161: /**
162: * <p>Return the <code>PropertyDescriptor</code>s for this bean.</p>
163: */
164: public PropertyDescriptor[] getPropertyDescriptors() {
165:
166: if (propertyDescriptors != null) {
167: return propertyDescriptors;
168: }
169: AttributeDescriptor attrib = null;
170:
171: try {
172:
173: PropertyDescriptor prop_attributes = new PropertyDescriptorBase(
174: "attributes", beanClass, "getAttributes", null);
175: prop_attributes.setDisplayName(resources
176: .getString("UIPanel_attributes_DisplayName"));
177: prop_attributes.setShortDescription(resources
178: .getString("UIPanel_attributes_Description"));
179: prop_attributes.setExpert(false);
180: prop_attributes.setHidden(true);
181: prop_attributes.setPreferred(false);
182: prop_attributes
183: .setValue(
184: Constants.PropertyDescriptor.CATEGORY,
185: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
186:
187: PropertyDescriptor prop_childCount = new PropertyDescriptorBase(
188: "childCount", beanClass, "getChildCount", null);
189: prop_childCount.setDisplayName(resources
190: .getString("UIPanel_childCount_DisplayName"));
191: prop_childCount.setShortDescription(resources
192: .getString("UIPanel_childCount_Description"));
193: prop_childCount.setExpert(false);
194: prop_childCount.setHidden(true);
195: prop_childCount.setPreferred(false);
196: prop_childCount
197: .setValue(
198: Constants.PropertyDescriptor.CATEGORY,
199: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
200:
201: PropertyDescriptor prop_children = new PropertyDescriptorBase(
202: "children", beanClass, "getChildren", null);
203: prop_children.setDisplayName(resources
204: .getString("UIPanel_children_DisplayName"));
205: prop_children.setShortDescription(resources
206: .getString("UIPanel_children_Description"));
207: prop_children.setExpert(false);
208: prop_children.setHidden(true);
209: prop_children.setPreferred(false);
210: prop_children
211: .setValue(
212: Constants.PropertyDescriptor.CATEGORY,
213: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
214:
215: PropertyDescriptor prop_facets = new PropertyDescriptorBase(
216: "facets", beanClass, "getFacets", null);
217: prop_facets.setDisplayName(resources
218: .getString("UIPanel_facets_DisplayName"));
219: prop_facets.setShortDescription(resources
220: .getString("UIPanel_facets_Description"));
221: prop_facets.setExpert(false);
222: prop_facets.setHidden(true);
223: prop_facets.setPreferred(false);
224: prop_facets
225: .setValue(
226: Constants.PropertyDescriptor.CATEGORY,
227: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
228:
229: PropertyDescriptor prop_family = new PropertyDescriptorBase(
230: "family", beanClass, "getFamily", null);
231: prop_family.setDisplayName(resources
232: .getString("UIPanel_family_DisplayName"));
233: prop_family.setShortDescription(resources
234: .getString("UIPanel_family_Description"));
235: prop_family.setExpert(false);
236: prop_family.setHidden(true);
237: prop_family.setPreferred(false);
238: prop_family
239: .setValue(
240: Constants.PropertyDescriptor.CATEGORY,
241: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
242:
243: PropertyDescriptor prop_id = new PropertyDescriptorBase(
244: "id", beanClass, "getId", "setId");
245: prop_id.setDisplayName(resources
246: .getString("UIPanel_id_DisplayName"));
247: prop_id.setShortDescription(resources
248: .getString("UIPanel_id_Description"));
249: prop_id.setExpert(false);
250: prop_id.setHidden(true);
251: prop_id.setPreferred(false);
252: attrib = new AttributeDescriptor("id", false, null, true);
253: prop_id.setValue(
254: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
255: attrib);
256: prop_id
257: .setValue(
258: Constants.PropertyDescriptor.CATEGORY,
259: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
260:
261: PropertyDescriptor prop_parent = new PropertyDescriptorBase(
262: "parent", beanClass, "getParent", null);
263: prop_parent.setDisplayName(resources
264: .getString("UIPanel_parent_DisplayName"));
265: prop_parent.setShortDescription(resources
266: .getString("UIPanel_parent_Description"));
267: prop_parent.setExpert(false);
268: prop_parent.setHidden(true);
269: prop_parent.setPreferred(false);
270: prop_parent
271: .setValue(
272: Constants.PropertyDescriptor.CATEGORY,
273: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
274:
275: PropertyDescriptor prop_rendered = new PropertyDescriptorBase(
276: "rendered", beanClass, "isRendered", "setRendered");
277: prop_rendered.setDisplayName(resources
278: .getString("UIPanel_rendered_DisplayName"));
279: prop_rendered.setShortDescription(resources
280: .getString("UIPanel_rendered_Description"));
281: prop_rendered.setExpert(false);
282: prop_rendered.setHidden(false);
283: prop_rendered.setPreferred(false);
284: attrib = new AttributeDescriptor("rendered", false, null,
285: true);
286: prop_rendered.setValue(
287: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
288: attrib);
289: prop_rendered
290: .setValue(
291: Constants.PropertyDescriptor.CATEGORY,
292: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
293:
294: PropertyDescriptor prop_rendererType = new PropertyDescriptorBase(
295: "rendererType", beanClass, "getRendererType",
296: "setRendererType");
297: prop_rendererType.setDisplayName(resources
298: .getString("UIPanel_rendererType_DisplayName"));
299: prop_rendererType.setShortDescription(resources
300: .getString("UIPanel_rendererType_Description"));
301: prop_rendererType.setExpert(false);
302: prop_rendererType.setHidden(true);
303: prop_rendererType.setPreferred(false);
304: prop_rendererType
305: .setValue(
306: Constants.PropertyDescriptor.CATEGORY,
307: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
308:
309: PropertyDescriptor prop_rendersChildren = new PropertyDescriptorBase(
310: "rendersChildren", beanClass, "getRendersChildren",
311: null);
312: prop_rendersChildren.setDisplayName(resources
313: .getString("UIPanel_rendersChildren_DisplayName"));
314: prop_rendersChildren.setShortDescription(resources
315: .getString("UIPanel_rendersChildren_Description"));
316: prop_rendersChildren.setExpert(false);
317: prop_rendersChildren.setHidden(true);
318: prop_rendersChildren.setPreferred(false);
319: prop_rendersChildren
320: .setValue(
321: Constants.PropertyDescriptor.CATEGORY,
322: com.sun.rave.designtime.base.CategoryDescriptors.INTERNAL);
323:
324: List<PropertyDescriptor> propertyDescriptorList = new ArrayList<PropertyDescriptor>();
325: propertyDescriptorList.add(prop_attributes);
326: propertyDescriptorList.add(prop_childCount);
327: propertyDescriptorList.add(prop_children);
328: propertyDescriptorList.add(prop_facets);
329: propertyDescriptorList.add(prop_family);
330: propertyDescriptorList.add(prop_id);
331: propertyDescriptorList.add(prop_parent);
332: propertyDescriptorList.add(prop_rendered);
333: propertyDescriptorList.add(prop_rendererType);
334: propertyDescriptorList.add(prop_rendersChildren);
335:
336: propertyDescriptorList.addAll(Arrays.asList(super
337: .getPropertyDescriptors()));
338: propertyDescriptors = propertyDescriptorList
339: .toArray(new PropertyDescriptor[propertyDescriptorList
340: .size()]);
341: return propertyDescriptors;
342:
343: } catch (IntrospectionException e) {
344: e.printStackTrace();
345: return null;
346: }
347:
348: }
349:
350: }
|