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.PropertyDescriptor;
012: import java.beans.SimpleBeanInfo;
013: import java.util.Vector;
014:
015: /**
016: * BeanInfo class for JOutlookBar.
017: */
018: public class JOutlookBarBeanInfo extends SimpleBeanInfo {
019:
020: /** Description of the Field */
021: protected BeanDescriptor bd = new BeanDescriptor(
022: com.l2fprod.common.swing.JOutlookBar.class);
023: /** Description of the Field */
024: protected Image iconMono16 = loadImage("JOutlookBar16-mono.gif");
025: /** Description of the Field */
026: protected Image iconColor16 = loadImage("JOutlookBar16.gif");
027: /** Description of the Field */
028: protected Image iconMono32 = loadImage("JOutlookBar32-mono.gif");
029: /** Description of the Field */
030: protected Image iconColor32 = loadImage("JOutlookBar32.gif");
031:
032: /** Constructor for the JOutlookBarBeanInfo object */
033: public JOutlookBarBeanInfo()
034: throws java.beans.IntrospectionException {
035: // setup bean descriptor in constructor.
036: bd.setName("JOutlookBar");
037:
038: bd
039: .setShortDescription("JOutlookBar brings the famous Outlook component to Swing");
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.JOutlookBar.class
066: .getSuperclass(); !cl
067: .equals(javax.swing.JTabbedPane.class
068: .getSuperclass()); cl = cl.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: /**
131: * Gets the Property Descriptors
132: *
133: * @return The propertyDescriptors value
134: */
135: public PropertyDescriptor[] getPropertyDescriptors() {
136: try {
137: Vector descriptors = new Vector();
138: PropertyDescriptor descriptor = null;
139:
140: try {
141: descriptor = new PropertyDescriptor("animated",
142: com.l2fprod.common.swing.JOutlookBar.class);
143: } catch (IntrospectionException e) {
144: descriptor = new PropertyDescriptor("animated",
145: com.l2fprod.common.swing.JOutlookBar.class,
146: "getAnimated", null);
147: }
148:
149: descriptor.setPreferred(true);
150:
151: descriptor.setBound(true);
152:
153: descriptors.add(descriptor);
154:
155: return (PropertyDescriptor[]) descriptors
156: .toArray(new PropertyDescriptor[descriptors.size()]);
157: } catch (Exception e) {
158: // do not ignore, bomb politely so use has chance to discover what went
159: // wrong...
160: // I know that this is suboptimal solution, but swallowing silently is
161: // even worse... Propose better solution!
162: e.printStackTrace();
163: }
164: return null;
165: }
166:
167: }
|