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_1.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: import com.sun.rave.designtime.Constants;
053: import com.sun.rave.designtime.markup.AttributeDescriptor;
054: import com.sun.rave.propertyeditors.DomainPropertyEditor;
055: import com.sun.rave.propertyeditors.SelectOneDomainEditor;
056: import com.sun.rave.propertyeditors.domains.TextDirectionDomain;
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_1.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_1.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_1/component/html/HtmlSelectManyCheckbox_C16";
073: iconFileName_C32 = "/org/netbeans/modules/visualweb/faces/dt_1_1/component/html/HtmlSelectManyCheckbox_C32";
074: iconFileName_M16 = "/org/netbeans/modules/visualweb/faces/dt_1_1/component/html/HtmlSelectManyCheckbox_M16";
075: iconFileName_M32 = "/org/netbeans/modules/visualweb/faces/dt_1_1/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_dir = new PropertyDescriptorBase(
180: "dir", beanClass, "getDir", "setDir");
181: prop_dir
182: .setDisplayName(resources
183: .getString("HtmlSelectManyCheckbox_dir_DisplayName"));
184: prop_dir
185: .setShortDescription(resources
186: .getString("HtmlSelectManyCheckbox_dir_Description"));
187: prop_dir
188: .setPropertyEditorClass(SelectOneDomainEditor.class);
189: prop_dir.setExpert(false);
190: prop_dir.setHidden(false);
191: prop_dir.setPreferred(false);
192: attrib = new AttributeDescriptor("dir", false, null, true);
193: prop_dir.setValue(
194: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
195: attrib);
196: prop_dir
197: .setValue(
198: Constants.PropertyDescriptor.CATEGORY,
199: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
200: prop_dir.setValue(DomainPropertyEditor.DOMAIN_CLASS,
201: TextDirectionDomain.class);
202:
203: PropertyDescriptor prop_disabled = new PropertyDescriptorBase(
204: "disabled", beanClass, "isDisabled", "setDisabled");
205: prop_disabled
206: .setDisplayName(resources
207: .getString("HtmlSelectManyCheckbox_disabled_DisplayName"));
208: prop_disabled
209: .setShortDescription(resources
210: .getString("HtmlSelectManyCheckbox_disabled_Description"));
211: prop_disabled.setExpert(false);
212: prop_disabled.setHidden(false);
213: prop_disabled.setPreferred(false);
214: attrib = new AttributeDescriptor("disabled", false, null,
215: true);
216: prop_disabled.setValue(
217: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
218: attrib);
219: prop_disabled
220: .setValue(
221: Constants.PropertyDescriptor.CATEGORY,
222: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
223:
224: PropertyDescriptor prop_disabledClass = new PropertyDescriptorBase(
225: "disabledClass", beanClass, "getDisabledClass",
226: "setDisabledClass");
227: prop_disabledClass
228: .setDisplayName(resources
229: .getString("HtmlSelectManyCheckbox_disabledClass_DisplayName"));
230: prop_disabledClass
231: .setShortDescription(resources
232: .getString("HtmlSelectManyCheckbox_disabledClass_Description"));
233: prop_disabledClass
234: .setPropertyEditorClass(com.sun.rave.propertyeditors.StyleClassPropertyEditor.class);
235: prop_disabledClass.setExpert(false);
236: prop_disabledClass.setHidden(false);
237: prop_disabledClass.setPreferred(false);
238: attrib = new AttributeDescriptor("disabledClass", false,
239: null, true);
240: prop_disabledClass.setValue(
241: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
242: attrib);
243: prop_disabledClass
244: .setValue(
245: Constants.PropertyDescriptor.CATEGORY,
246: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
247:
248: PropertyDescriptor prop_enabledClass = new PropertyDescriptorBase(
249: "enabledClass", beanClass, "getEnabledClass",
250: "setEnabledClass");
251: prop_enabledClass
252: .setDisplayName(resources
253: .getString("HtmlSelectManyCheckbox_enabledClass_DisplayName"));
254: prop_enabledClass
255: .setShortDescription(resources
256: .getString("HtmlSelectManyCheckbox_enabledClass_Description"));
257: prop_enabledClass
258: .setPropertyEditorClass(com.sun.rave.propertyeditors.StyleClassPropertyEditor.class);
259: prop_enabledClass.setExpert(false);
260: prop_enabledClass.setHidden(false);
261: prop_enabledClass.setPreferred(false);
262: attrib = new AttributeDescriptor("enabledClass", false,
263: null, true);
264: prop_enabledClass.setValue(
265: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
266: attrib);
267: prop_enabledClass
268: .setValue(
269: Constants.PropertyDescriptor.CATEGORY,
270: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
271:
272: PropertyDescriptor prop_lang = new PropertyDescriptorBase(
273: "lang", beanClass, "getLang", "setLang");
274: prop_lang
275: .setDisplayName(resources
276: .getString("HtmlSelectManyCheckbox_lang_DisplayName"));
277: prop_lang
278: .setShortDescription(resources
279: .getString("HtmlSelectManyCheckbox_lang_Description"));
280: prop_lang
281: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
282: prop_lang.setExpert(false);
283: prop_lang.setHidden(false);
284: prop_lang.setPreferred(false);
285: attrib = new AttributeDescriptor("lang", false, null, true);
286: prop_lang.setValue(
287: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
288: attrib);
289: prop_lang
290: .setValue(
291: Constants.PropertyDescriptor.CATEGORY,
292: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
293: prop_lang
294: .setValue(
295: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
296: com.sun.rave.propertyeditors.domains.LanguagesDomain.class);
297:
298: PropertyDescriptor prop_layout = new PropertyDescriptorBase(
299: "layout", beanClass, "getLayout", "setLayout");
300: prop_layout
301: .setDisplayName(resources
302: .getString("HtmlSelectManyCheckbox_layout_DisplayName"));
303: prop_layout
304: .setShortDescription(resources
305: .getString("HtmlSelectManyCheckbox_layout_Description"));
306: prop_layout
307: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
308: prop_layout.setExpert(false);
309: prop_layout.setHidden(false);
310: prop_layout.setPreferred(false);
311: attrib = new AttributeDescriptor("layout", false, null,
312: true);
313: prop_layout.setValue(
314: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
315: attrib);
316: prop_layout
317: .setValue(
318: Constants.PropertyDescriptor.CATEGORY,
319: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
320: prop_layout
321: .setValue(
322: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
323: org.netbeans.modules.visualweb.faces.dt_1_1.component.html.HtmlCheckboxLayoutStylesDomain.class);
324:
325: PropertyDescriptor prop_readonly = new PropertyDescriptorBase(
326: "readonly", beanClass, "isReadonly", "setReadonly");
327: prop_readonly
328: .setDisplayName(resources
329: .getString("HtmlSelectManyCheckbox_readonly_DisplayName"));
330: prop_readonly
331: .setShortDescription(resources
332: .getString("HtmlSelectManyCheckbox_readonly_Description"));
333: prop_readonly.setExpert(false);
334: prop_readonly.setHidden(false);
335: prop_readonly.setPreferred(false);
336: attrib = new AttributeDescriptor("readonly", false, null,
337: true);
338: prop_readonly.setValue(
339: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
340: attrib);
341: prop_readonly
342: .setValue(
343: Constants.PropertyDescriptor.CATEGORY,
344: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
345:
346: PropertyDescriptor prop_selectedValues = new PropertyDescriptorBase(
347: "selectedValues", beanClass, "getSelectedValues",
348: "setSelectedValues");
349: prop_selectedValues
350: .setDisplayName(resources
351: .getString("HtmlSelectManyCheckbox_selectedValues_DisplayName"));
352: prop_selectedValues
353: .setShortDescription(resources
354: .getString("HtmlSelectManyCheckbox_selectedValues_Description"));
355: prop_selectedValues.setExpert(false);
356: prop_selectedValues.setHidden(false);
357: prop_selectedValues.setPreferred(false);
358: prop_selectedValues
359: .setValue(
360: Constants.PropertyDescriptor.CATEGORY,
361: com.sun.rave.designtime.base.CategoryDescriptors.DATA);
362:
363: PropertyDescriptor prop_tabindex = new PropertyDescriptorBase(
364: "tabindex", beanClass, "getTabindex", "setTabindex");
365: prop_tabindex
366: .setDisplayName(resources
367: .getString("HtmlSelectManyCheckbox_tabindex_DisplayName"));
368: prop_tabindex
369: .setShortDescription(resources
370: .getString("HtmlSelectManyCheckbox_tabindex_Description"));
371: prop_tabindex
372: .setPropertyEditorClass(com.sun.rave.propertyeditors.IntegerPropertyEditor.class);
373: prop_tabindex.setExpert(false);
374: prop_tabindex.setHidden(false);
375: prop_tabindex.setPreferred(false);
376: attrib = new AttributeDescriptor("tabindex", false, null,
377: true);
378: prop_tabindex.setValue(
379: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
380: attrib);
381: prop_tabindex
382: .setValue(
383: Constants.PropertyDescriptor.CATEGORY,
384: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
385: prop_tabindex.setValue("maxValue", new Integer(
386: Short.MAX_VALUE));
387: prop_tabindex.setValue("minValue", new Integer(0));
388:
389: PropertyDescriptor prop_title = new PropertyDescriptorBase(
390: "title", beanClass, "getTitle", "setTitle");
391: prop_title
392: .setDisplayName(resources
393: .getString("HtmlSelectManyCheckbox_title_DisplayName"));
394: prop_title
395: .setShortDescription(resources
396: .getString("HtmlSelectManyCheckbox_title_Description"));
397: prop_title.setExpert(false);
398: prop_title.setHidden(false);
399: prop_title.setPreferred(false);
400: attrib = new AttributeDescriptor("title", false, null, true);
401: prop_title.setValue(
402: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
403: attrib);
404: prop_title
405: .setValue(
406: Constants.PropertyDescriptor.CATEGORY,
407: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
408:
409: List<PropertyDescriptor> propertyDescriptorList = new ArrayList<PropertyDescriptor>();
410: propertyDescriptorList.add(prop_accesskey);
411: propertyDescriptorList.add(prop_border);
412: propertyDescriptorList.add(prop_dir);
413: propertyDescriptorList.add(prop_disabled);
414: propertyDescriptorList.add(prop_disabledClass);
415: propertyDescriptorList.add(prop_enabledClass);
416: propertyDescriptorList.add(prop_lang);
417: propertyDescriptorList.add(prop_layout);
418: propertyDescriptorList.add(prop_readonly);
419: propertyDescriptorList.add(prop_selectedValues);
420: propertyDescriptorList.add(prop_tabindex);
421: propertyDescriptorList.add(prop_title);
422:
423: propertyDescriptorList.addAll(Properties
424: .getVisualPropertyList(beanClass));
425: propertyDescriptorList.addAll(Properties
426: .getKeyEventPropertyList(beanClass));
427: propertyDescriptorList.addAll(Properties
428: .getMouseEventPropertyList(beanClass));
429: propertyDescriptorList.addAll(Properties
430: .getClickEventPropertyList(beanClass));
431: propertyDescriptorList.addAll(Properties
432: .getFocusEventPropertyList(beanClass));
433: propertyDescriptorList.addAll(Properties
434: .getSelectEventPropertyList(beanClass));
435: propertyDescriptorList.addAll(Properties
436: .getChangeEventPropertyList(beanClass));
437: propertyDescriptorList.addAll(Arrays.asList(super
438: .getPropertyDescriptors()));
439: propertyDescriptors = propertyDescriptorList
440: .toArray(new PropertyDescriptor[propertyDescriptorList
441: .size()]);
442: return propertyDescriptors;
443:
444: } catch (IntrospectionException e) {
445: e.printStackTrace();
446: return null;
447: }
448:
449: }
450:
451: }
|