001: /*
002: * Generated file - Do not edit!
003: */
004: package com.l2fprod.common.swing;
005:
006: import java.awt.Image;
007: import java.beans.BeanDescriptor;
008: import java.beans.BeanInfo;
009: import java.beans.Introspector;
010: import java.beans.PropertyDescriptor;
011: import java.beans.SimpleBeanInfo;
012: import java.util.Vector;
013:
014: /**
015: * BeanInfo class for JLinkButton.
016: */
017: public class JLinkButtonBeanInfo extends SimpleBeanInfo {
018:
019: /** Description of the Field */
020: protected BeanDescriptor bd = new BeanDescriptor(
021: com.l2fprod.common.swing.JLinkButton.class);
022: /** Description of the Field */
023: protected Image iconMono16 = loadImage("JLinkButton16-mono.gif");
024: /** Description of the Field */
025: protected Image iconColor16 = loadImage("JLinkButton16.gif");
026: /** Description of the Field */
027: protected Image iconMono32 = loadImage("JLinkButton32-mono.gif");
028: /** Description of the Field */
029: protected Image iconColor32 = loadImage("JLinkButton32.gif");
030:
031: /** Constructor for the JLinkButtonBeanInfo object */
032: public JLinkButtonBeanInfo()
033: throws java.beans.IntrospectionException {
034: // setup bean descriptor in constructor.
035: bd.setName("JLinkButton");
036:
037: bd.setShortDescription("A button looking as an hyperlink.");
038:
039: bd.setValue("isContainer", Boolean.FALSE);
040:
041: BeanInfo info = Introspector.getBeanInfo(getBeanDescriptor()
042: .getBeanClass().getSuperclass());
043: String order = info.getBeanDescriptor().getValue(
044: "propertyorder") == null ? "" : (String) info
045: .getBeanDescriptor().getValue("propertyorder");
046: PropertyDescriptor[] pd = getPropertyDescriptors();
047: for (int i = 0; i != pd.length; i++) {
048: if (order.indexOf(pd[i].getName()) == -1) {
049: order = order + (order.length() == 0 ? "" : ":")
050: + pd[i].getName();
051: }
052: }
053: getBeanDescriptor().setValue("propertyorder", order);
054: }
055:
056: /**
057: * Gets the additionalBeanInfo
058: *
059: * @return The additionalBeanInfo value
060: */
061: public BeanInfo[] getAdditionalBeanInfo() {
062: Vector bi = new Vector();
063: BeanInfo[] biarr = null;
064: try {
065: for (Class cl = com.l2fprod.common.swing.JLinkButton.class
066: .getSuperclass(); !cl
067: .equals(java.awt.Component.class.getSuperclass()); cl = cl
068: .getSuperclass()) {
069: bi.addElement(Introspector.getBeanInfo(cl));
070: }
071: biarr = new BeanInfo[bi.size()];
072: bi.copyInto(biarr);
073: } catch (Exception e) {
074: // Ignore it
075: }
076: return biarr;
077: }
078:
079: /**
080: * Gets the beanDescriptor
081: *
082: * @return The beanDescriptor value
083: */
084: public BeanDescriptor getBeanDescriptor() {
085: return bd;
086: }
087:
088: /**
089: * Gets the defaultPropertyIndex
090: *
091: * @return The defaultPropertyIndex value
092: */
093: public int getDefaultPropertyIndex() {
094: String defName = "";
095: if (defName.equals("")) {
096: return -1;
097: }
098: PropertyDescriptor[] pd = getPropertyDescriptors();
099: for (int i = 0; i < pd.length; i++) {
100: if (pd[i].getName().equals(defName)) {
101: return i;
102: }
103: }
104: return -1;
105: }
106:
107: /**
108: * Gets the icon
109: *
110: * @param type
111: * Description of the Parameter
112: * @return The icon value
113: */
114: public Image getIcon(int type) {
115: if (type == BeanInfo.ICON_COLOR_16x16) {
116: return iconColor16;
117: }
118: if (type == BeanInfo.ICON_MONO_16x16) {
119: return iconMono16;
120: }
121: if (type == BeanInfo.ICON_COLOR_32x32) {
122: return iconColor32;
123: }
124: if (type == BeanInfo.ICON_MONO_32x32) {
125: return iconMono32;
126: }
127: return null;
128: }
129:
130: }
|