01: package org.firebirdsql.squirrel.util;
02:
03: /*
04: * Copyright (C) 2002 Colin Bell
05: * colbell@users.sourceforge.net
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: */
21: import java.beans.IntrospectionException;
22: import java.beans.PropertyDescriptor;
23: import java.beans.SimpleBeanInfo;
24:
25: import net.sourceforge.squirrel_sql.fw.util.StringManager;
26: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
27:
28: /**
29: * This is the <CODE>BeanInfo</CODE> class for <CODE>IndexInfo</CODE>.
30: *
31: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
32: */
33: public class IndexInfoBeanInfo extends SimpleBeanInfo {
34: /** Internationalized strings for this class. */
35: private static final StringManager s_stringMgr = StringManagerFactory
36: .getStringManager(IndexInfoBeanInfo.class);
37:
38: private static final Class<IndexInfo> CLAZZ = IndexInfo.class;
39:
40: private static interface IPropertyNames extends
41: IndexInfo.IPropertyNames {
42: // Empty body.
43: }
44:
45: private static PropertyDescriptor[] s_descr;
46:
47: public IndexInfoBeanInfo() throws IntrospectionException {
48: super ();
49: if (s_descr == null) {
50: s_descr = new PropertyDescriptor[10];
51: s_descr[0] = new PropertyDescriptor(IPropertyNames.NAME,
52: CLAZZ);
53: s_descr[0].setDisplayName(s_stringMgr
54: .getString("IndexInfoBeanInfo.name"));
55: s_descr[1] = new PropertyDescriptor(
56: IPropertyNames.DESCRIPTION, CLAZZ);
57: s_descr[1].setDisplayName(s_stringMgr
58: .getString("IndexInfoBeanInfo.description"));
59: s_descr[2] = new PropertyDescriptor(
60: IPropertyNames.RELATION_NAME, CLAZZ);
61: s_descr[2].setDisplayName(s_stringMgr
62: .getString("IndexInfoBeanInfo.relationname"));
63: s_descr[3] = new PropertyDescriptor(IPropertyNames.ID,
64: CLAZZ);
65: s_descr[3].setDisplayName(s_stringMgr
66: .getString("IndexInfoBeanInfo.id"));
67: s_descr[4] = new PropertyDescriptor(IPropertyNames.UNIQUE,
68: CLAZZ);
69: s_descr[4].setDisplayName(s_stringMgr
70: .getString("IndexInfoBeanInfo.unique"));
71: s_descr[5] = new PropertyDescriptor(
72: IPropertyNames.SEGMENT_COUNT, CLAZZ);
73: s_descr[5].setDisplayName(s_stringMgr
74: .getString("IndexInfoBeanInfo.segmentcount"));
75: s_descr[6] = new PropertyDescriptor(IPropertyNames.ACTIVE,
76: CLAZZ);
77: s_descr[6].setDisplayName(s_stringMgr
78: .getString("IndexInfoBeanInfo.active"));
79: s_descr[7] = new PropertyDescriptor(
80: IPropertyNames.EXPRESSION_SOURCE, CLAZZ);
81: s_descr[7].setDisplayName(s_stringMgr
82: .getString("IndexInfoBeanInfo.expressionsource"));
83: s_descr[8] = new PropertyDescriptor(
84: IPropertyNames.FOREIGN_KEY_CONSTRAINT, CLAZZ);
85: s_descr[8]
86: .setDisplayName(s_stringMgr
87: .getString("IndexInfoBeanInfo.foreignkeyconstraint"));
88: s_descr[9] = new PropertyDescriptor(
89: IPropertyNames.SYSTEM_DEFINED, CLAZZ);
90: s_descr[9].setDisplayName(s_stringMgr
91: .getString("IndexInfoBeanInfo.systemdefined"));
92: }
93: }
94:
95: public PropertyDescriptor[] getPropertyDescriptors() {
96: return s_descr;
97: }
98: }
|