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.UIOutputBeanInfoBase;
060:
061: public class HtmlOutputLinkBeanInfo extends UIOutputBeanInfoBase {
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(), HtmlOutputLinkBeanInfo.class
067: .getClassLoader());
068:
069: public HtmlOutputLinkBeanInfo() {
070: beanClass = javax.faces.component.html.HtmlOutputLink.class;
071: iconFileName_C16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlOutputLink_C16";
072: iconFileName_C32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlOutputLink_C32";
073: iconFileName_M16 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlOutputLink_M16";
074: iconFileName_M32 = "/org/netbeans/modules/visualweb/faces/dt_1_2/component/html/HtmlOutputLink_M32";
075: }
076:
077: private BeanDescriptor beanDescriptor;
078:
079: public BeanDescriptor getBeanDescriptor() {
080:
081: if (beanDescriptor != null) {
082: return beanDescriptor;
083: }
084:
085: beanDescriptor = new BeanDescriptorBase(beanClass);
086: beanDescriptor.setDisplayName(resources
087: .getString("HtmlOutputLink_DisplayName"));
088: beanDescriptor.setShortDescription(resources
089: .getString("HtmlOutputLink_Description"));
090: beanDescriptor.setExpert(false);
091: beanDescriptor.setHidden(false);
092: beanDescriptor.setPreferred(false);
093: beanDescriptor.setValue(
094: Constants.BeanDescriptor.FACET_DESCRIPTORS,
095: getFacetDescriptors());
096: beanDescriptor.setValue(Constants.BeanDescriptor.HELP_KEY,
097: "projrave_ui_elements_palette_jsfstd_hyperlink");
098: beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
099: "hyperlink");
100: beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
101: Boolean.TRUE);
102: beanDescriptor
103: .setValue(Constants.BeanDescriptor.PROPERTIES_HELP_KEY,
104: "projrave_ui_elements_propsheets_jsfstd_hyperlink_props");
105: beanDescriptor.setValue(
106: Constants.BeanDescriptor.PROPERTY_CATEGORIES,
107: getCategoryDescriptors());
108: beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
109: "outputLink");
110: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
111: "h");
112: beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
113: "http://java.sun.com/jsf/html");
114:
115: return beanDescriptor;
116:
117: }
118:
119: private PropertyDescriptor[] propertyDescriptors;
120:
121: public PropertyDescriptor[] getPropertyDescriptors() {
122:
123: if (propertyDescriptors != null) {
124: return propertyDescriptors;
125: }
126: AttributeDescriptor attrib = null;
127:
128: try {
129:
130: PropertyDescriptor prop_accesskey = new PropertyDescriptorBase(
131: "accesskey", beanClass, "getAccesskey",
132: "setAccesskey");
133: prop_accesskey.setDisplayName(resources
134: .getString("HtmlOutputLink_accesskey_DisplayName"));
135: prop_accesskey.setShortDescription(resources
136: .getString("HtmlOutputLink_accesskey_Description"));
137: prop_accesskey.setExpert(false);
138: prop_accesskey.setHidden(false);
139: prop_accesskey.setPreferred(false);
140: attrib = new AttributeDescriptor("accesskey", false, null,
141: true);
142: prop_accesskey.setValue(
143: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
144: attrib);
145: prop_accesskey
146: .setValue(
147: Constants.PropertyDescriptor.CATEGORY,
148: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
149:
150: PropertyDescriptor prop_charset = new PropertyDescriptorBase(
151: "charset", beanClass, "getCharset", "setCharset");
152: prop_charset.setDisplayName(resources
153: .getString("HtmlOutputLink_charset_DisplayName"));
154: prop_charset.setShortDescription(resources
155: .getString("HtmlOutputLink_charset_Description"));
156: prop_charset
157: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
158: prop_charset.setExpert(false);
159: prop_charset.setHidden(false);
160: prop_charset.setPreferred(false);
161: attrib = new AttributeDescriptor("charset", false, null,
162: true);
163: prop_charset.setValue(
164: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
165: attrib);
166: prop_charset
167: .setValue(
168: Constants.PropertyDescriptor.CATEGORY,
169: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
170: prop_charset
171: .setValue(
172: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
173: com.sun.rave.propertyeditors.domains.CharacterSetsDomain.class);
174:
175: PropertyDescriptor prop_coords = new PropertyDescriptorBase(
176: "coords", beanClass, "getCoords", "setCoords");
177: prop_coords.setDisplayName(resources
178: .getString("HtmlOutputLink_coords_DisplayName"));
179: prop_coords.setShortDescription(resources
180: .getString("HtmlOutputLink_coords_Description"));
181: prop_coords
182: .setPropertyEditorClass(com.sun.rave.propertyeditors.StringPropertyEditor.class);
183: prop_coords.setExpert(false);
184: prop_coords.setHidden(false);
185: prop_coords.setPreferred(false);
186: attrib = new AttributeDescriptor("coords", false, null,
187: true);
188: prop_coords.setValue(
189: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
190: attrib);
191: prop_coords
192: .setValue(
193: Constants.PropertyDescriptor.CATEGORY,
194: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
195:
196: PropertyDescriptor prop_dir = new PropertyDescriptorBase(
197: "dir", beanClass, "getDir", "setDir");
198: prop_dir.setDisplayName(resources
199: .getString("HtmlOutputLink_dir_DisplayName"));
200: prop_dir.setShortDescription(resources
201: .getString("HtmlOutputLink_dir_Description"));
202: prop_dir
203: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
204: prop_dir.setExpert(false);
205: prop_dir.setHidden(false);
206: prop_dir.setPreferred(false);
207: attrib = new AttributeDescriptor("dir", false, null, true);
208: prop_dir.setValue(
209: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
210: attrib);
211: prop_dir
212: .setValue(
213: Constants.PropertyDescriptor.CATEGORY,
214: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
215: prop_dir
216: .setValue(
217: com.sun.rave.propertyeditors.DomainPropertyEditor.DOMAIN_CLASS,
218: com.sun.rave.propertyeditors.domains.TextDirectionDomain.class);
219:
220: PropertyDescriptor prop_disabled = new PropertyDescriptorBase(
221: "disabled", beanClass, "isDisabled", "setDisabled");
222: prop_disabled.setDisplayName(resources
223: .getString("HtmlOutputLink_disabled_DisplayName"));
224: prop_disabled.setShortDescription(resources
225: .getString("HtmlOutputLink_disabled_Description"));
226: prop_disabled.setExpert(false);
227: prop_disabled.setHidden(false);
228: prop_disabled.setPreferred(false);
229: attrib = new AttributeDescriptor("disabled", false, null,
230: true);
231: prop_disabled.setValue(
232: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
233: attrib);
234: prop_disabled
235: .setValue(
236: Constants.PropertyDescriptor.CATEGORY,
237: com.sun.rave.designtime.base.CategoryDescriptors.APPEARANCE);
238:
239: PropertyDescriptor prop_hreflang = new PropertyDescriptorBase(
240: "hreflang", beanClass, "getHreflang", "setHreflang");
241: prop_hreflang.setDisplayName(resources
242: .getString("HtmlOutputLink_hreflang_DisplayName"));
243: prop_hreflang.setShortDescription(resources
244: .getString("HtmlOutputLink_hreflang_Description"));
245: prop_hreflang
246: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
247: prop_hreflang.setExpert(false);
248: prop_hreflang.setHidden(false);
249: prop_hreflang.setPreferred(false);
250: attrib = new AttributeDescriptor("hreflang", false, null,
251: true);
252: prop_hreflang.setValue(
253: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
254: attrib);
255: prop_hreflang
256: .setValue(
257: Constants.PropertyDescriptor.CATEGORY,
258: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
259: prop_hreflang
260: .setValue(
261: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
262: com.sun.rave.propertyeditors.domains.LanguagesDomain.class);
263:
264: PropertyDescriptor prop_lang = new PropertyDescriptorBase(
265: "lang", beanClass, "getLang", "setLang");
266: prop_lang.setDisplayName(resources
267: .getString("HtmlOutputLink_lang_DisplayName"));
268: prop_lang.setShortDescription(resources
269: .getString("HtmlOutputLink_lang_Description"));
270: prop_lang
271: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
272: prop_lang.setExpert(false);
273: prop_lang.setHidden(false);
274: prop_lang.setPreferred(false);
275: attrib = new AttributeDescriptor("lang", false, null, true);
276: prop_lang.setValue(
277: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
278: attrib);
279: prop_lang
280: .setValue(
281: Constants.PropertyDescriptor.CATEGORY,
282: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
283: prop_lang
284: .setValue(
285: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
286: com.sun.rave.propertyeditors.domains.LanguagesDomain.class);
287:
288: PropertyDescriptor prop_rel = new PropertyDescriptorBase(
289: "rel", beanClass, "getRel", "setRel");
290: prop_rel.setDisplayName(resources
291: .getString("HtmlOutputLink_rel_DisplayName"));
292: prop_rel.setShortDescription(resources
293: .getString("HtmlOutputLink_rel_Description"));
294: prop_rel
295: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
296: prop_rel.setExpert(false);
297: prop_rel.setHidden(false);
298: prop_rel.setPreferred(false);
299: attrib = new AttributeDescriptor("rel", false, null, true);
300: prop_rel.setValue(
301: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
302: attrib);
303: prop_rel
304: .setValue(
305: Constants.PropertyDescriptor.CATEGORY,
306: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
307: prop_rel
308: .setValue(
309: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
310: com.sun.rave.propertyeditors.domains.HtmlLinkTypesDomain.class);
311:
312: PropertyDescriptor prop_rev = new PropertyDescriptorBase(
313: "rev", beanClass, "getRev", "setRev");
314: prop_rev.setDisplayName(resources
315: .getString("HtmlOutputLink_rev_DisplayName"));
316: prop_rev.setShortDescription(resources
317: .getString("HtmlOutputLink_rev_Description"));
318: prop_rev
319: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
320: prop_rev.setExpert(false);
321: prop_rev.setHidden(false);
322: prop_rev.setPreferred(false);
323: attrib = new AttributeDescriptor("rev", false, null, true);
324: prop_rev.setValue(
325: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
326: attrib);
327: prop_rev
328: .setValue(
329: Constants.PropertyDescriptor.CATEGORY,
330: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
331: prop_rev
332: .setValue(
333: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
334: com.sun.rave.propertyeditors.domains.HtmlLinkTypesDomain.class);
335:
336: PropertyDescriptor prop_shape = new PropertyDescriptorBase(
337: "shape", beanClass, "getShape", "setShape");
338: prop_shape.setDisplayName(resources
339: .getString("HtmlOutputLink_shape_DisplayName"));
340: prop_shape.setShortDescription(resources
341: .getString("HtmlOutputLink_shape_Description"));
342: prop_shape
343: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
344: prop_shape.setExpert(false);
345: prop_shape.setHidden(false);
346: prop_shape.setPreferred(false);
347: attrib = new AttributeDescriptor("shape", false, null, true);
348: prop_shape.setValue(
349: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
350: attrib);
351: prop_shape
352: .setValue(
353: Constants.PropertyDescriptor.CATEGORY,
354: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
355: prop_shape
356: .setValue(
357: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
358: com.sun.rave.propertyeditors.domains.HtmlRegionShapesDomain.class);
359:
360: PropertyDescriptor prop_tabindex = new PropertyDescriptorBase(
361: "tabindex", beanClass, "getTabindex", "setTabindex");
362: prop_tabindex.setDisplayName(resources
363: .getString("HtmlOutputLink_tabindex_DisplayName"));
364: prop_tabindex.setShortDescription(resources
365: .getString("HtmlOutputLink_tabindex_Description"));
366: prop_tabindex
367: .setPropertyEditorClass(com.sun.rave.propertyeditors.IntegerPropertyEditor.class);
368: prop_tabindex.setExpert(false);
369: prop_tabindex.setHidden(false);
370: prop_tabindex.setPreferred(false);
371: attrib = new AttributeDescriptor("tabindex", false, null,
372: true);
373: prop_tabindex.setValue(
374: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
375: attrib);
376: prop_tabindex
377: .setValue(
378: Constants.PropertyDescriptor.CATEGORY,
379: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
380: prop_tabindex.setValue("maxValue", new Integer(
381: Short.MAX_VALUE));
382: prop_tabindex.setValue("minValue", new Integer(0));
383:
384: PropertyDescriptor prop_target = new PropertyDescriptorBase(
385: "target", beanClass, "getTarget", "setTarget");
386: prop_target.setDisplayName(resources
387: .getString("HtmlOutputLink_target_DisplayName"));
388: prop_target.setShortDescription(resources
389: .getString("HtmlOutputLink_target_Description"));
390: prop_target
391: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
392: prop_target.setExpert(false);
393: prop_target.setHidden(false);
394: prop_target.setPreferred(false);
395: attrib = new AttributeDescriptor("target", false, null,
396: true);
397: prop_target.setValue(
398: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
399: attrib);
400: prop_target
401: .setValue(
402: Constants.PropertyDescriptor.CATEGORY,
403: com.sun.rave.designtime.base.CategoryDescriptors.GENERAL);
404: prop_target
405: .setValue(
406: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
407: com.sun.rave.propertyeditors.domains.HtmlFrameTargetsDomain.class);
408:
409: PropertyDescriptor prop_type = new PropertyDescriptorBase(
410: "type", beanClass, "getType", "setType");
411: prop_type.setDisplayName(resources
412: .getString("HtmlOutputLink_type_DisplayName"));
413: prop_type.setShortDescription(resources
414: .getString("HtmlOutputLink_type_Description"));
415: prop_type
416: .setPropertyEditorClass(com.sun.rave.propertyeditors.SelectOneDomainEditor.class);
417: prop_type.setExpert(false);
418: prop_type.setHidden(false);
419: prop_type.setPreferred(false);
420: attrib = new AttributeDescriptor("type", false, null, true);
421: prop_type.setValue(
422: Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR,
423: attrib);
424: prop_type
425: .setValue(
426: Constants.PropertyDescriptor.CATEGORY,
427: com.sun.rave.designtime.base.CategoryDescriptors.ADVANCED);
428: prop_type
429: .setValue(
430: "com.sun.rave.propertyeditors.DOMAIN_CLASS",
431: com.sun.rave.propertyeditors.domains.MimeTypesDomain.class);
432:
433: List<PropertyDescriptor> propertyDescriptorList = new ArrayList<PropertyDescriptor>();
434: propertyDescriptorList.add(prop_accesskey);
435: propertyDescriptorList.add(prop_charset);
436: propertyDescriptorList.add(prop_coords);
437: propertyDescriptorList.add(prop_dir);
438: propertyDescriptorList.add(prop_disabled);
439: propertyDescriptorList.add(prop_hreflang);
440: propertyDescriptorList.add(prop_lang);
441: propertyDescriptorList.add(prop_rel);
442: propertyDescriptorList.add(prop_rev);
443: propertyDescriptorList.add(prop_shape);
444: propertyDescriptorList.add(prop_tabindex);
445: propertyDescriptorList.add(prop_target);
446: propertyDescriptorList.add(prop_type);
447:
448: propertyDescriptorList.addAll(Properties
449: .getVisualPropertyList(beanClass));
450: propertyDescriptorList.addAll(Properties
451: .getKeyEventPropertyList(beanClass));
452: propertyDescriptorList.addAll(Properties
453: .getMouseEventPropertyList(beanClass));
454: propertyDescriptorList.addAll(Properties
455: .getClickEventPropertyList(beanClass));
456: propertyDescriptorList.addAll(Properties
457: .getFocusEventPropertyList(beanClass));
458: propertyDescriptorList.addAll(Arrays.asList(super
459: .getPropertyDescriptors()));
460: propertyDescriptors = propertyDescriptorList
461: .toArray(new PropertyDescriptor[propertyDescriptorList
462: .size()]);
463: return propertyDescriptors;
464:
465: } catch (IntrospectionException e) {
466: e.printStackTrace();
467: return null;
468: }
469:
470: }
471:
472: }
|