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.MethodDescriptor;
011: import java.beans.PropertyDescriptor;
012: import java.beans.SimpleBeanInfo;
013: import java.util.Vector;
014:
015: /**
016: * BeanInfo class for JButtonBar.
017: */
018: public class JButtonBarBeanInfo extends SimpleBeanInfo {
019: /** Description of the Field */
020: protected BeanDescriptor bd = new BeanDescriptor(
021: com.l2fprod.common.swing.JButtonBar.class);
022: /** Description of the Field */
023: protected Image iconMono16 = loadImage("JButtonBar16-mono.gif");
024: /** Description of the Field */
025: protected Image iconColor16 = loadImage("JButtonBar16.gif");
026: /** Description of the Field */
027: protected Image iconMono32 = loadImage("JButtonBar32-mono.gif");
028: /** Description of the Field */
029: protected Image iconColor32 = loadImage("JButtonBar32.gif");
030:
031: /** Constructor for the JButtonBarBeanInfo object */
032: public JButtonBarBeanInfo()
033: throws java.beans.IntrospectionException {
034: // setup bean descriptor in constructor.
035: bd.setName("JButtonBar");
036:
037: bd
038: .setShortDescription("JButtonBar helps organizing buttons together"
039: + " (as seen in Mozilla Firefox or IntelliJ).");
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.JButtonBar.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: /**
131: * Gets the Property Descriptors
132: *
133: * @return The propertyDescriptors value
134: */
135: public PropertyDescriptor[] getPropertyDescriptors() {
136: return new PropertyDescriptor[0];
137: }
138:
139: /**
140: * Gets the methodDescriptors attribute ...
141: *
142: * @return The methodDescriptors value
143: */
144: public MethodDescriptor[] getMethodDescriptors() {
145: return new MethodDescriptor[0];
146: }
147:
148: }
|