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.html;
043:
044: import java.beans.BeanDescriptor;
045: import java.beans.IntrospectionException;
046: import java.beans.PropertyDescriptor;
047: import java.util.Locale;
048: import java.util.List;
049: import java.util.ArrayList;
050: import java.util.Arrays;
051: import java.util.ResourceBundle;
052:
053: import com.sun.rave.designtime.CategoryDescriptor;
054: import com.sun.rave.designtime.Constants;
055: import com.sun.rave.designtime.faces.FacetDescriptor;
056: import com.sun.rave.designtime.markup.AttributeDescriptor;
057: import org.netbeans.modules.visualweb.faces.dt.BeanDescriptorBase;
058: import org.netbeans.modules.visualweb.faces.dt.PropertyDescriptorBase;
059: import org.netbeans.modules.visualweb.faces.dt_1_2.component.UIInputBeanInfoBase;
060:
061: public class HtmlSelectManyCheckboxBeanInfo extends UIInputBeanInfoBase {
062:
063: protected static ResourceBundle resources = ResourceBundle
064: .getBundle(
065: "org.netbeans.modules.visualweb.faces.dt_1_2.component.html.Bundle-JSF",
066: Locale.getDefault(),
067: HtmlSelectManyCheckboxBeanInfo.class
068: .getClassLoader());
069:
070: public HtmlSelectManyCheckboxBeanInfo() {
071: beanClass = javax.faces.component.html.HtmlSelectManyCheckbox.class;
072: iconFileName_C16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlSelectManyCheckbox_C16";
073: iconFileName_C32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlSelectManyCheckbox_C32";
074: iconFileName_M16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlSelectManyCheckbox_M16";
075: iconFileName_M32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlSelectManyCheckbox_M32";
076: }
077:
078: private BeanDescriptor beanDescriptor;
079:
080: public BeanDescriptor getBeanDescriptor() {
081:
082: if (beanDescriptor != null) {
083: return beanDescriptor;
084: }
085:
086: beanDescriptor = new BeanDescriptorBase(beanClass);
087: beanDescriptor.setDisplayName(resources
088: .getString("HtmlSelectManyCheckbox_DisplayName"));
089: beanDescriptor.setShortDescription(resources
090: .getString("HtmlSelectManyCheckbox_Description"));
091: beanDescriptor.setExpert(false);
092: beanDescriptor.setHidden(false);
093: beanDescriptor.setPreferred(false);
094: beanDescriptor.setValue(
095: Constants.BeanDescriptor.FACET_DESCRIPTORS,
096: getFacetDescriptors());
097: beanDescriptor.setValue(Constants.BeanDescriptor.HELP_KEY,
098: "projrave_ui_elements_palette_jsfstd_checkbox_list");
099: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
100: "checkboxList");
101: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
102: Boolean.TRUE);
103: beanDescriptor
104: .setValue(Constants.BeanDescriptor.PROPERTIES_HELP_KEY,
105: "projrave_ui_elements_propsheets_jsfstd_checkbox_list_props");
106: beanDescriptor.setValue(
107: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
108: getCategoryDescriptors());
109: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
110: "selectManyCheckbox");
111: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
112: "h");
113: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
114: "http://java.sun.com/jsf/html");
115:
116: return beanDescriptor;
117:
118: }
119:
120: private PropertyDescriptor[] propertyDescriptors;
121:
122: public PropertyDescriptor[] getPropertyDescriptors() {
123:
124: if (propertyDescriptors != null) {
125: return propertyDescriptors;
126: }
127: AttributeDescriptor attrib = null;
128:
129: try {
130:
131: PropertyDescriptor prop_accesskey = new PropertyDescriptorBase(
132: "accesskey", beanClass, "getAccesskey",
133: "setAccesskey");
134: prop_accesskey
135: .setDisplayName(resources
136: .getString("HtmlSelectManyCheckbox_accesskey_DisplayName"));
137: prop_accesskey
138: .setShortDescription(resources
139: .getString("HtmlSelectManyCheckbox_accesskey_Description"));
140: prop_accesskey.setExpert(false);
141: prop_accesskey.setHidden(false);
142: prop_accesskey.setPreferred(false);
143: attrib = new AttributeDescriptor("accesskey", false, null,
144: true);
145: prop_accesskey.setValue(
146: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
147: attrib);
148: prop_accesskey
149: .setValue(
150: Constants.PropertyDescriptor.CATEGORY,
151: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
152:
153: PropertyDescriptor prop_border = new PropertyDescriptorBase(
154: "border", beanClass, "getBorder", "setBorder");
155: prop_border
156: .setDisplayName(resources
157: .getString("HtmlSelectManyCheckbox_border_DisplayName"));
158: prop_border
159: .setShortDescription(resources
160: .getString("HtmlSelectManyCheckbox_border_Description"));
161: prop_border
162: .setPropertyEditorClass(com.sun.rave.propertyeditors.IntegerPropertyEditor.class);
163: prop_border.setExpert(false);
164: prop_border.setHidden(false);
165: prop_border.setPreferred(false);
166: attrib = new AttributeDescriptor("border", false, null,
167: true);
168: prop_border.setValue(
169: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
170: attrib);
171: prop_border
172: .setValue(
173: Constants.PropertyDescriptor.CATEGORY,
174: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
175: prop_border.setValue("minValue", new Integer(0));
176: prop_border.setValue("unsetValue", new Integer(
177: Integer.MIN_VALUE));
178:
179: PropertyDescriptor prop_disabled = new PropertyDescriptorBase(
180: "disabled", beanClass, "isDisabled", "setDisabled");
181: prop_disabled
182: .setDisplayName(resources
183: .getString("HtmlSelectManyCheckbox_disabled_DisplayName"));
184: prop_disabled
185: .setShortDescription(resources
186: .getString("HtmlSelectManyCheckbox_disabled_Description"));
187: prop_disabled.setExpert(false);
188: prop_disabled.setHidden(false);
189: prop_disabled.setPreferred(false);
190: attrib = new AttributeDescriptor("disabled", false, null,
191: true);
192: prop_disabled.setValue(
193: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
194: attrib);
195: prop_disabled
196: .setValue(
197: Constants.PropertyDescriptor.CATEGORY,
198: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
199:
200: PropertyDescriptor prop_disabledClass = new PropertyDescriptorBase(
201: "disabledClass", beanClass, "getDisabledClass",
202: "setDisabledClass");
203: prop_disabledClass
204: .setDisplayName(resources
205: .getString("HtmlSelectManyCheckbox_disabledClass_DisplayName"));
206: prop_disabledClass
207: .setShortDescription(resources
208: .getString("HtmlSelectManyCheckbox_disabledClass_Description"));
209: prop_disabledClass
210: .setPropertyEditorClass(com.sun.rave.propertyeditors.StyleClassPropertyEditor.class);
211: prop_disabledClass.setExpert(false);
212: prop_disabledClass.setHidden(false);
213: prop_disabledClass.setPreferred(false);
214: attrib = new AttributeDescriptor("disabledClass", false,
215: null, true);
216: prop_disabledClass.setValue(
217: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
218: attrib);
219: prop_disabledClass
220: .setValue(
221: Constants.PropertyDescriptor.CATEGORY,
222: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
223:
224: PropertyDescriptor prop_enabledClass = new PropertyDescriptorBase(
225: "enabledClass", beanClass, "getEnabledClass",
226: "setEnabledClass");
227: prop_enabledClass
228: .setDisplayName(resources
229: .getString("HtmlSelectManyCheckbox_enabledClass_DisplayName"));
230: prop_enabledClass
231: .setShortDescription(resources
232: .getString("HtmlSelectManyCheckbox_enabledClass_Description"));
233: prop_enabledClass
234: .setPropertyEditorClass(com.sun.rave.propertyeditors.StyleClassPropertyEditor.class);
235: prop_enabledClass.setExpert(false);
236: prop_enabledClass.setHidden(false);
237: prop_enabledClass.setPreferred(false);
238: attrib = new AttributeDescriptor("enabledClass", false,
239: null, true);
240: prop_enabledClass.setValue(
241: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
242: attrib);
243: prop_enabledClass
244: .setValue(
245: Constants.PropertyDescriptor.CATEGORY,
246: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
247:
248: PropertyDescriptor prop_layout = new PropertyDescriptorBase(
249: "layout", beanClass, "getLayout", "setLayout");
250: prop_layout
251: .setDisplayName(resources
252: .getString("HtmlSelectManyCheckbox_layout_DisplayName"));
253: prop_layout
254: .setShortDescription(resources
255: .getString("HtmlSelectManyCheckbox_layout_Description"));
256: prop_layout
257: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
258: prop_layout.setExpert(false);
259: prop_layout.setHidden(false);
260: prop_layout.setPreferred(false);
261: attrib = new AttributeDescriptor("layout", false, null,
262: true);
263: prop_layout.setValue(
264: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
265: attrib);
266: prop_layout
267: .setValue(
268: Constants.PropertyDescriptor.CATEGORY,
269: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
270: prop_layout
271: .setValue(
272: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
273: org.netbeans.modules.visualweb.faces.dt_1_2.component.html.HtmlCheckboxLayoutStylesDomain.class);
274:
275: PropertyDescriptor prop_readonly = new PropertyDescriptorBase(
276: "readonly", beanClass, "isReadonly", "setReadonly");
277: prop_readonly
278: .setDisplayName(resources
279: .getString("HtmlSelectManyCheckbox_readonly_DisplayName"));
280: prop_readonly
281: .setShortDescription(resources
282: .getString("HtmlSelectManyCheckbox_readonly_Description"));
283: prop_readonly.setExpert(false);
284: prop_readonly.setHidden(false);
285: prop_readonly.setPreferred(false);
286: attrib = new AttributeDescriptor("readonly", false, null,
287: true);
288: prop_readonly.setValue(
289: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
290: attrib);
291: prop_readonly
292: .setValue(
293: Constants.PropertyDescriptor.CATEGORY,
294: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
295:
296: PropertyDescriptor prop_selectedValues = new PropertyDescriptorBase(
297: "selectedValues", beanClass, "getSelectedValues",
298: "setSelectedValues");
299: prop_selectedValues
300: .setDisplayName(resources
301: .getString("HtmlSelectManyCheckbox_selectedValues_DisplayName"));
302: prop_selectedValues
303: .setShortDescription(resources
304: .getString("HtmlSelectManyCheckbox_selectedValues_Description"));
305: prop_selectedValues.setExpert(false);
306: prop_selectedValues.setHidden(false);
307: prop_selectedValues.setPreferred(false);
308: prop_selectedValues
309: .setValue(
310: Constants.PropertyDescriptor.CATEGORY,
311: com.sun.rave.designtime.base.CategoryDescriptors.DATA);
312:
313: PropertyDescriptor prop_tabindex = new PropertyDescriptorBase(
314: "tabindex", beanClass, "getTabindex", "setTabindex");
315: prop_tabindex
316: .setDisplayName(resources
317: .getString("HtmlSelectManyCheckbox_tabindex_DisplayName"));
318: prop_tabindex
319: .setShortDescription(resources
320: .getString("HtmlSelectManyCheckbox_tabindex_Description"));
321: prop_tabindex
322: .setPropertyEditorClass(com.sun.rave.propertyeditors.IntegerPropertyEditor.class);
323: prop_tabindex.setExpert(false);
324: prop_tabindex.setHidden(false);
325: prop_tabindex.setPreferred(false);
326: attrib = new AttributeDescriptor("tabindex", false, null,
327: true);
328: prop_tabindex.setValue(
329: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
330: attrib);
331: prop_tabindex
332: .setValue(
333: Constants.PropertyDescriptor.CATEGORY,
334: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
335: prop_tabindex.setValue("maxValue", new Integer(
336: Short.MAX_VALUE));
337: prop_tabindex.setValue("minValue", new Integer(0));
338:
339: List<PropertyDescriptor> propertyDescriptorList = new ArrayList<PropertyDescriptor>();
340: propertyDescriptorList.add(prop_accesskey);
341: propertyDescriptorList.add(prop_border);
342: propertyDescriptorList.add(prop_disabled);
343: propertyDescriptorList.add(prop_disabledClass);
344: propertyDescriptorList.add(prop_enabledClass);
345: propertyDescriptorList.add(prop_layout);
346: propertyDescriptorList.add(prop_readonly);
347: propertyDescriptorList.add(prop_selectedValues);
348: propertyDescriptorList.add(prop_tabindex);
349:
350: propertyDescriptorList.addAll(Properties
351: .getVisualPropertyList(beanClass));
352: propertyDescriptorList.addAll(Properties
353: .getKeyEventPropertyList(beanClass));
354: propertyDescriptorList.addAll(Properties
355: .getMouseEventPropertyList(beanClass));
356: propertyDescriptorList.addAll(Properties
357: .getClickEventPropertyList(beanClass));
358: propertyDescriptorList.addAll(Properties
359: .getFocusEventPropertyList(beanClass));
360: propertyDescriptorList.addAll(Properties
361: .getSelectEventPropertyList(beanClass));
362: propertyDescriptorList.addAll(Properties
363: .getChangeEventPropertyList(beanClass));
364: propertyDescriptorList.addAll(Properties
365: .getInputPropertyList(beanClass));
366: propertyDescriptorList.addAll(Arrays.asList(super
367: .getPropertyDescriptors()));
368: propertyDescriptors = propertyDescriptorList
369: .toArray(new PropertyDescriptor[propertyDescriptorList
370: .size()]);
371: return propertyDescriptors;
372:
373: } catch (IntrospectionException e) {
374: e.printStackTrace();
375: return null;
376: }
377:
378: }
379:
380: }
|