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.IntrospectionException;
010: import java.beans.Introspector;
011: import java.beans.MethodDescriptor;
012: import java.beans.PropertyDescriptor;
013: import java.beans.SimpleBeanInfo;
014: import java.util.Vector;
015:
016: /**
017: * BeanInfo class for JCollapsiblePane.
018: */
019: public class JCollapsiblePaneBeanInfo extends SimpleBeanInfo {
020:
021: /** Description of the Field */
022: protected BeanDescriptor bd = new BeanDescriptor(
023: com.l2fprod.common.swing.JCollapsiblePane.class);
024: /** Description of the Field */
025: protected Image iconMono16;
026: /** Description of the Field */
027: protected Image iconColor16;
028: /** Description of the Field */
029: protected Image iconMono32;
030: /** Description of the Field */
031: protected Image iconColor32;
032:
033: /** Constructor for the JCollapsiblePaneBeanInfo object */
034: public JCollapsiblePaneBeanInfo()
035: throws java.beans.IntrospectionException {
036: // setup bean descriptor in constructor.
037: bd.setName("JCollapsiblePane");
038:
039: bd
040: .setShortDescription("A pane which hides its content with an animation.");
041:
042: bd.setValue("isContainer", Boolean.TRUE);
043: bd.setValue("containerDelegate", "getContentPane");
044:
045: BeanInfo info = Introspector.getBeanInfo(getBeanDescriptor()
046: .getBeanClass().getSuperclass());
047: String order = info.getBeanDescriptor().getValue(
048: "propertyorder") == null ? "" : (String) info
049: .getBeanDescriptor().getValue("propertyorder");
050: PropertyDescriptor[] pd = getPropertyDescriptors();
051: for (int i = 0; i != pd.length; i++) {
052: if (order.indexOf(pd[i].getName()) == -1) {
053: order = order + (order.length() == 0 ? "" : ":")
054: + pd[i].getName();
055: }
056: }
057: getBeanDescriptor().setValue("propertyorder", order);
058: }
059:
060: /**
061: * Gets the additionalBeanInfo
062: *
063: * @return The additionalBeanInfo value
064: */
065: public BeanInfo[] getAdditionalBeanInfo() {
066: Vector bi = new Vector();
067: BeanInfo[] biarr = null;
068: try {
069: for (Class cl = com.l2fprod.common.swing.JCollapsiblePane.class
070: .getSuperclass(); !cl
071: .equals(java.awt.Component.class.getSuperclass()); cl = cl
072: .getSuperclass()) {
073: bi.addElement(Introspector.getBeanInfo(cl));
074: }
075: biarr = new BeanInfo[bi.size()];
076: bi.copyInto(biarr);
077: } catch (Exception e) {
078: // Ignore it
079: }
080: return biarr;
081: }
082:
083: /**
084: * Gets the beanDescriptor
085: *
086: * @return The beanDescriptor value
087: */
088: public BeanDescriptor getBeanDescriptor() {
089: return bd;
090: }
091:
092: /**
093: * Gets the defaultPropertyIndex
094: *
095: * @return The defaultPropertyIndex value
096: */
097: public int getDefaultPropertyIndex() {
098: String defName = "";
099: if (defName.equals("")) {
100: return -1;
101: }
102: PropertyDescriptor[] pd = getPropertyDescriptors();
103: for (int i = 0; i < pd.length; i++) {
104: if (pd[i].getName().equals(defName)) {
105: return i;
106: }
107: }
108: return -1;
109: }
110:
111: /**
112: * Gets the icon
113: *
114: * @param type
115: * Description of the Parameter
116: * @return The icon value
117: */
118: public Image getIcon(int type) {
119: if (type == BeanInfo.ICON_COLOR_16x16) {
120: return iconColor16;
121: }
122: if (type == BeanInfo.ICON_MONO_16x16) {
123: return iconMono16;
124: }
125: if (type == BeanInfo.ICON_COLOR_32x32) {
126: return iconColor32;
127: }
128: if (type == BeanInfo.ICON_MONO_32x32) {
129: return iconMono32;
130: }
131: return null;
132: }
133:
134: /**
135: * Gets the Property Descriptors
136: *
137: * @return The propertyDescriptors value
138: */
139: public PropertyDescriptor[] getPropertyDescriptors() {
140: try {
141: Vector descriptors = new Vector();
142: PropertyDescriptor descriptor = null;
143:
144: try {
145: descriptor = new PropertyDescriptor("animated",
146: com.l2fprod.common.swing.JCollapsiblePane.class);
147: } catch (IntrospectionException e) {
148: descriptor = new PropertyDescriptor(
149: "animated",
150: com.l2fprod.common.swing.JCollapsiblePane.class,
151: "getAnimated", null);
152: }
153:
154: descriptor.setPreferred(true);
155:
156: descriptor.setBound(true);
157:
158: descriptors.add(descriptor);
159: try {
160: descriptor = new PropertyDescriptor("collapsed",
161: com.l2fprod.common.swing.JCollapsiblePane.class);
162: } catch (IntrospectionException e) {
163: descriptor = new PropertyDescriptor(
164: "collapsed",
165: com.l2fprod.common.swing.JCollapsiblePane.class,
166: "getCollapsed", null);
167: }
168:
169: descriptor.setPreferred(true);
170:
171: descriptor.setBound(true);
172:
173: descriptors.add(descriptor);
174:
175: return (PropertyDescriptor[]) descriptors
176: .toArray(new PropertyDescriptor[descriptors.size()]);
177: } catch (Exception e) {
178: // do not ignore, bomb politely so use has chance to discover what went
179: // wrong...
180: // I know that this is suboptimal solution, but swallowing silently is
181: // even worse... Propose better solution!
182: e.printStackTrace();
183: }
184: return null;
185: }
186:
187: /**
188: * Gets the methodDescriptors attribute ...
189: *
190: * @return The methodDescriptors value
191: */
192: public MethodDescriptor[] getMethodDescriptors() {
193: return new MethodDescriptor[0];
194: }
195:
196: }
|